Address Meng's comment

This commit is contained in:
Xin Dong 2020-07-01 20:23:18 -07:00
parent 3ecdaf24ce
commit ae63304392
1 changed files with 2 additions and 12 deletions

View File

@ -3692,18 +3692,8 @@ ACTOR Future<StorageMetrics> getStorageMetricsLargeKeyRange(Database cx, KeyRang
state StorageMetrics total; state StorageMetrics total;
KeyRef partBegin, partEnd; KeyRef partBegin, partEnd;
for (int i = 0; i < nLocs; i++) { for (int i = 0; i < nLocs; i++) {
if (i == 0) { partBegin = (i == 0) ? keys.begin : locations[i].first.begin;
// Use the actual begin key instead of the shard begin partEnd = (i == nLocs - 1) ? keys.end : locations[i].first.end;
partBegin = keys.begin;
} else {
partBegin = locations[i].first.begin;
}
if (i == nLocs - 1) {
// Use the actual end key instead of the shard end
partEnd = keys.end;
} else {
partEnd = locations[i].first.end;
}
fx[i] = doGetStorageMetrics(cx, KeyRangeRef(partBegin, partEnd), locations[i].second); fx[i] = doGetStorageMetrics(cx, KeyRangeRef(partBegin, partEnd), locations[i].second);
} }
wait(waitForAll(fx)); wait(waitForAll(fx));