deardeng commented on code in PR #26412:
URL: https://github.com/apache/doris/pull/26412#discussion_r1384265136
##########
fe/fe-core/src/main/java/org/apache/doris/clone/PartitionRebalancer.java:
##########
@@ -233,6 +233,21 @@ private boolean checkMoveCompleted(TabletMove move) {
return !bes.contains(move.fromBe) && bes.contains(move.toBe);
}
+ public boolean isNeedBalanced(LoadStatisticForTag clusterStat,
TStorageMedium medium,
+ List<Long> fromBes, List<Long> toBes) {
+ MovesCacheMap.MovesCache movesInProgress =
movesCacheMap.getCache(clusterStat.getTag(), medium);
+ if (movesInProgress == null) {
+ return checkCacheEmptyForLong();
+ }
+
+ fromBes.addAll(movesInProgress.get().asMap().values().stream()
+ .filter(p -> p.second != -1L).map(p ->
p.first.fromBe).collect(Collectors.toList()));
+ toBes.addAll(movesInProgress.get().asMap().values().stream()
+ .filter(p -> p.second != -1L).map(p ->
p.first.toBe).collect(Collectors.toList()));
+
+ return checkCacheEmptyForLong();
+ }
+
// cache empty for 10 min
public boolean checkCacheEmptyForLong() {
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]