Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cluster-enable in kvrocks2redis to cluster-enabled #1673

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion utils/kvrocks2redis/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ Status Config::parseConfigFromString(const std::string &input) {
kvrocks_auth = args[2];
}
} else if (size == 1 && key == "cluster-enable") {
cluster_enable = GET_OR_RET(yesnotoi(args[0]).Prefixed("key 'cluster-enable'"));
// Renamed to cluster-enabled, keeping the old one for compatibility.
cluster_enabled = GET_OR_RET(yesnotoi(args[0]).Prefixed("key 'cluster-enable'"));
} else if (size == 1 && key == "cluster-enabled") {
cluster_enabled = GET_OR_RET(yesnotoi(args[0]).Prefixed("key 'cluster-enabled'"));
} else if (size >= 2 && strncasecmp(key.data(), "namespace.", 10) == 0) {
std::string ns = original_key.substr(10);
if (ns.size() > INT8_MAX) {
Expand Down
2 changes: 1 addition & 1 deletion utils/kvrocks2redis/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct Config {
std::string kvrocks_host;
int kvrocks_port = 0;
std::map<std::string, RedisServer> tokens;
bool cluster_enable = false;
bool cluster_enabled = false;

Status Load(std::string path);
Config() = default;
Expand Down
2 changes: 1 addition & 1 deletion utils/kvrocks2redis/kvrocks2redis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kvrocks 127.0.0.1 6666
# Enable cluster mode.
#
# Default: no
cluster-enable no
cluster-enabled no

################################ NAMESPACE AND Sync Target Redis #####################################
# Synchronize the specified namespace data to the specified Redis DB.
Expand Down
4 changes: 2 additions & 2 deletions utils/kvrocks2redis/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ int main(int argc, char *argv[]) {

Config kvrocks_config;
kvrocks_config.db_dir = config.db_dir;
kvrocks_config.cluster_enabled = config.cluster_enable;
kvrocks_config.slot_id_encoded = config.cluster_enable;
kvrocks_config.cluster_enabled = config.cluster_enabled;
kvrocks_config.slot_id_encoded = config.cluster_enabled;

engine::Storage storage(&kvrocks_config);
s = storage.Open(true);
Expand Down