feat(cluster): Implement CLUSTER INFO. (#1258)

Implementation supports 3 cases:
1. Emulated mode (as was previously implemented)
2. Non-configured cluster mode
3. Configured cluster mode
This commit is contained in:
Chaka 2023-05-22 09:29:06 +03:00 committed by GitHub
parent 74b33121de
commit 7289a83087
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 125 additions and 18 deletions

View file

@ -255,8 +255,12 @@ ClusterConfig::Node ClusterConfig::GetMasterNodeForSlot(SlotId id) const {
ClusterConfig::ClusterShards ClusterConfig::GetConfig() const {
shared_lock gu(mu_);
return config_;
}
bool ClusterConfig::IsConfigured() const {
shared_lock gu(mu_);
return !config_.empty();
}
} // namespace dfly