From 4442a51c4394b8ecbbdbc5a47067964623cdd344 Mon Sep 17 00:00:00 2001 From: lzydmxy <13126752315@163.com> Date: Thu, 13 Jun 2024 17:48:13 +0800 Subject: [PATCH] Put const value under macro COMPATIBLE_MODE_ZOOKEEPER --- src/Service/KeeperCommon.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Service/KeeperCommon.h b/src/Service/KeeperCommon.h index 2977ba4a71..543d0da5cd 100644 --- a/src/Service/KeeperCommon.h +++ b/src/Service/KeeperCommon.h @@ -12,21 +12,22 @@ namespace RK using RunnerId = size_t; using ThreadPoolPtr = std::shared_ptr; -const String CLICKHOUSE_KEEPER_SYSTEM_PATH = "/keeper"; -const String CLICKHOUSE_KEEPER_API_VERSION_PATH = CLICKHOUSE_KEEPER_SYSTEM_PATH + "/api_version"; - -enum class KeeperApiVersion : uint8_t -{ - ZOOKEEPER_COMPATIBLE = 0, - WITH_FILTERED_LIST, - WITH_MULTI_READ -}; - -inline constexpr auto CURRENT_KEEPER_API_VERSION = KeeperApiVersion::WITH_MULTI_READ; - -const String ZOOKEEPER_SYSTEM_PATH= "/zookeeper"; -const String ZOOKEEPER_CONFIG_NODE= ZOOKEEPER_SYSTEM_PATH + "/config"; +#ifdef COMPATIBLE_MODE_ZOOKEEPER + const String ZOOKEEPER_SYSTEM_PATH = "/zookeeper"; + const String ZOOKEEPER_CONFIG_NODE = ZOOKEEPER_SYSTEM_PATH + "/config"; +#else + const String CLICKHOUSE_KEEPER_SYSTEM_PATH = "/keeper"; + const String CLICKHOUSE_KEEPER_API_VERSION_PATH = CLICKHOUSE_KEEPER_SYSTEM_PATH + "/api_version"; + + enum class KeeperApiVersion : uint8_t + { + ZOOKEEPER_COMPATIBLE = 0, + WITH_FILTERED_LIST, + WITH_MULTI_READ + }; + inline constexpr auto CURRENT_KEEPER_API_VERSION = KeeperApiVersion::WITH_MULTI_READ; +#endif struct RequestId;