This commit is contained in:
Xiaoxi Wang 2022-02-28 10:39:29 -08:00
parent 5e74b5006e
commit e0d624c167
3 changed files with 15 additions and 15 deletions

View File

@ -2444,21 +2444,21 @@ Future<Optional<std::string>> DataDistributionImpl::commit(ReadYourWritesTransac
try {
boost::lexical_cast<int>(iter->value().second.get().toString());
} catch (boost::bad_lexical_cast& e) {
ManagementAPIError::toJsonString(false,
"datadistribution",
"Invalid datadistribution rebalance ignore option (int or empty): " +
iter->value().second.get().toString());
ManagementAPIError::toJsonString(
false,
"datadistribution",
"Invalid datadistribution rebalance ignore option (int or empty): " +
iter->value().second.get().toString());
val = ""_sr;
}
ryw->getTransaction().set(rebalanceDDIgnoreKey, iter->value().second.get());
// if (iter->value().second.get().size())
// msg =
// ManagementAPIError::toJsonString(false,
// "datadistribution",
// "Value is unused for the data_distribution/rebalance_ignored "
// "key, please set it to an empty value");
// else
// ryw->getTransaction().set(rebalanceDDIgnoreKey, LiteralStringRef("on"));
// if (iter->value().second.get().size())
// msg =
// ManagementAPIError::toJsonString(false,
// "datadistribution",
// "Value is unused for the
//data_distribution/rebalance_ignored " "key, please set it to an empty value"); else
// ryw->getTransaction().set(rebalanceDDIgnoreKey, LiteralStringRef("on"));
} else {
msg = ManagementAPIError::toJsonString(
false,

View File

@ -309,7 +309,7 @@ std::pair<UID, Key> serverKeysDecodeServerBegin(const KeyRef& key) {
rd >> server_id;
rd.readBytes(1); // skip "/"
std::string bytes;
while(!rd.empty()) {
while (!rd.empty()) {
bytes.push_back((char)*rd.arenaRead(1));
}
// std::cout << bytes.size() << " " <<bytes << std::endl;

View File

@ -97,7 +97,7 @@ extern const ValueRef serverKeysTrue, serverKeysTrueEmptyRange, serverKeysFalse;
const Key serverKeysKey(UID serverID, const KeyRef& keys);
const Key serverKeysPrefixFor(UID serverID);
UID serverKeysDecodeServer(const KeyRef& key);
std::pair<UID, Key> serverKeysDecodeServerBegin(const KeyRef& key) ;
std::pair<UID, Key> serverKeysDecodeServerBegin(const KeyRef& key);
bool serverHasKey(ValueRef storedValue);
extern const KeyRangeRef conflictingKeysRange;
@ -486,7 +486,7 @@ extern const KeyRangeRef monitorConfKeys;
extern const KeyRef healthyZoneKey;
extern const StringRef ignoreSSFailuresZoneString;
extern const KeyRef rebalanceDDIgnoreKey;
enum DDIgnore {REBALANCE_DISK = 1, REBALANCE_READ = 2};
enum DDIgnore { REBALANCE_DISK = 1, REBALANCE_READ = 2 };
const Value healthyZoneValue(StringRef const& zoneId, Version version);
std::pair<Key, Version> decodeHealthyZoneValue(ValueRef const&);