From b04da69a6d8f4529e6f30649aec26004dbcb4552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikael=20Ronstr=C3=B6m?= Date: Wed, 12 Feb 2025 10:40:21 +0100 Subject: [PATCH] Fixing compilation warnings --- storage/ndb/rest-server2/server/src/ttl_purge.cpp | 8 +++++++- storage/ndb/rest-server2/server/src/ttl_purge.hpp | 2 +- storage/ndb/src/rondis/include/dispatch_thread.h | 4 ++-- storage/ndb/src/rondis/include/pink_thread.h | 2 +- storage/ndb/src/rondis/include/redis_conn.h | 4 ++-- storage/ndb/src/rondis/include/rondis_thread.h | 2 +- storage/ndb/src/rondis/include/server_thread.h | 7 ++----- storage/ndb/src/rondis/include/worker_thread.h | 4 ++-- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/storage/ndb/rest-server2/server/src/ttl_purge.cpp b/storage/ndb/rest-server2/server/src/ttl_purge.cpp index a20343808a0..4b9f3887dd3 100644 --- a/storage/ndb/rest-server2/server/src/ttl_purge.cpp +++ b/storage/ndb/rest-server2/server/src/ttl_purge.cpp @@ -122,7 +122,9 @@ void TTLPurger::SchemaWatcherJob() { NdbEventOperation* op = nullptr; NdbDictionary::Dictionary::List list; const char* message_buf = "API_OK"; +#ifdef DEBUG_EVENT Uint32 event_nums = 0; +#endif [[maybe_unused]] char event_name_buf[128]; char slock_buf_pre[32]; char slock_buf[32]; @@ -353,11 +355,13 @@ void TTLPurger::SchemaWatcherJob() { op->getNdbError().message); goto err; } +#ifdef DEBUG_EVENT event_nums++; DEB_EVENT("EVENT [%u]: %s, GCI = %llu", event_nums, GetEventName(op->getEventType(), event_name_buf), op->getGCI()); +#endif char* ptr_pre = nullptr; char* ptr = nullptr; std::string db_str_pre; @@ -922,13 +926,15 @@ enum SpecialShardVal { kShardFirst = 0 }; +/* static const uint mon_lengths[2][MONS_PER_YEAR] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; +static const uint year_lengths[2] = {DAYS_PER_NYEAR, DAYS_PER_LYEAR}; +*/ static const uint mon_starts[2][MONS_PER_YEAR] = { {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}, {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}}; -static const uint year_lengths[2] = {DAYS_PER_NYEAR, DAYS_PER_LYEAR}; #define LEAPS_THRU_END_OF(y) ((y) / 4 - (y) / 100 + (y) / 400) static my_time_t sec_since_epoch(int year, int mon, int mday, int hour, int min, int sec) { diff --git a/storage/ndb/rest-server2/server/src/ttl_purge.hpp b/storage/ndb/rest-server2/server/src/ttl_purge.hpp index da748967433..0655c2abd9f 100644 --- a/storage/ndb/rest-server2/server/src/ttl_purge.hpp +++ b/storage/ndb/rest-server2/server/src/ttl_purge.hpp @@ -70,7 +70,7 @@ class TTLPurger { Ndb* worker_ndb_; std::atomic exit_; - typedef struct { + typedef struct TTLInfo { Int32 table_id; Uint32 ttl_sec; Uint32 col_no; diff --git a/storage/ndb/src/rondis/include/dispatch_thread.h b/storage/ndb/src/rondis/include/dispatch_thread.h index 987bf28982e..6c078065e5b 100644 --- a/storage/ndb/src/rondis/include/dispatch_thread.h +++ b/storage/ndb/src/rondis/include/dispatch_thread.h @@ -4,7 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. /* - Copyright (c) 2024, 2024, Hopsworks and/or its affiliates. + Copyright (c) 2024, 2025, Hopsworks and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -70,7 +70,7 @@ class DispatchThread : public ServerThread { int queue_limit, const ServerHandle* handle); - virtual ~DispatchThread(); + virtual ~DispatchThread() override; virtual int StartThread() override; diff --git a/storage/ndb/src/rondis/include/pink_thread.h b/storage/ndb/src/rondis/include/pink_thread.h index 92d087db799..71096a90a78 100644 --- a/storage/ndb/src/rondis/include/pink_thread.h +++ b/storage/ndb/src/rondis/include/pink_thread.h @@ -4,7 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. /* - Copyright (c) 2024, 2024, Hopsworks and/or its affiliates. + Copyright (c) 2024, 2025, Hopsworks and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, diff --git a/storage/ndb/src/rondis/include/redis_conn.h b/storage/ndb/src/rondis/include/redis_conn.h index 9c994a68dfa..db9e036b349 100644 --- a/storage/ndb/src/rondis/include/redis_conn.h +++ b/storage/ndb/src/rondis/include/redis_conn.h @@ -4,7 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. /* - Copyright (c) 2024, 2024, Hopsworks and/or its affiliates. + Copyright (c) 2024, 2025, Hopsworks and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -56,7 +56,7 @@ class RedisConn: public PinkConn { PinkEpoll* pink_epoll = nullptr, const HandleType& handle_type = kSynchronous, const int rbuf_max_len = REDIS_MAX_MESSAGE); - virtual ~RedisConn(); + virtual ~RedisConn() override; virtual ReadStatus GetRequest() override; virtual WriteStatus SendReply() override; diff --git a/storage/ndb/src/rondis/include/rondis_thread.h b/storage/ndb/src/rondis/include/rondis_thread.h index 018c2997815..24f4d29a8cf 100644 --- a/storage/ndb/src/rondis/include/rondis_thread.h +++ b/storage/ndb/src/rondis/include/rondis_thread.h @@ -43,7 +43,7 @@ class RondisConn : public pink::RedisConn const std::string &ip_port, pink::Thread *thread, void *worker_specific_data); - virtual ~RondisConn() = default; + virtual ~RondisConn() override = default; protected: int DealMessage(const pink::RedisCmdArgsType &argv, std::string *response) override; diff --git a/storage/ndb/src/rondis/include/server_thread.h b/storage/ndb/src/rondis/include/server_thread.h index f182e753404..25ed22b1070 100644 --- a/storage/ndb/src/rondis/include/server_thread.h +++ b/storage/ndb/src/rondis/include/server_thread.h @@ -4,7 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. /* - Copyright (c) 2024, 2024, Hopsworks and/or its affiliates. + Copyright (c) 2024, 2025, Hopsworks and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -179,7 +179,7 @@ class ServerThread : public Thread { virtual void SetQueueLimit([[maybe_unused]]/*todo remove?*/ int queue_limit) { } - virtual ~ServerThread(); + virtual ~ServerThread() override; protected: /* @@ -251,14 +251,11 @@ extern ServerThread *NewHolyThread( * This type Dispatch thread just get Connection and then Dispatch the fd to * worker thread * - * @brief - * * @param port the port number * @param conn_factory connection factory object * @param cron_interval the cron job interval * @param queue_limit the size limit of workers' connection queue * @param handle the server's handle (e.g. CronHandle, AccessHandle...) - * @param ehandle the worker's enviroment setting handle */ extern ServerThread *NewDispatchThread( int port, diff --git a/storage/ndb/src/rondis/include/worker_thread.h b/storage/ndb/src/rondis/include/worker_thread.h index 344e6a9bc73..27727575859 100644 --- a/storage/ndb/src/rondis/include/worker_thread.h +++ b/storage/ndb/src/rondis/include/worker_thread.h @@ -4,7 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. /* - Copyright (c) 2024, 2024, Hopsworks and/or its affiliates. + Copyright (c) 2024, 2025, Hopsworks and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2.0, @@ -59,7 +59,7 @@ class WorkerThread : public Thread { explicit WorkerThread(ConnFactory *conn_factory, ServerThread* server_thread, int queue_limit_, int cron_interval = 0); - virtual ~WorkerThread(); + virtual ~WorkerThread() override; void set_keepalive_timeout(int timeout) { keepalive_timeout_ = timeout;