kfaraz commented on code in PR #13197:
URL: https://github.com/apache/druid/pull/13197#discussion_r1010207839
##########
server/src/test/java/org/apache/druid/server/coordinator/BalancerStrategyTest.java:
##########
@@ -84,29 +84,32 @@ public void findNewSegmentHomeReplicatorNotEnoughSpace()
new LoadQueuePeonTester());
serverHolders = new ArrayList<>();
serverHolders.add(serverHolder);
- final ServerHolder foundServerHolder =
balancerStrategy.findNewSegmentHomeReplicator(proposedDataSegment,
serverHolders);
// since there is not enough space on server having available size 10L to
host a segment of size 11L, it should be null
- Assert.assertNull(foundServerHolder);
+ Assert.assertFalse(
+ balancerStrategy.findNewSegmentHomeReplicator(proposedDataSegment,
serverHolders)
+ .hasNext()
+ );
Review Comment:
Removed as we don't need the comment anymore.
##########
server/src/main/java/org/apache/druid/server/coordinator/SegmentReplicantLookup.java:
##########
@@ -156,4 +161,45 @@ public Object2LongMap<String>
getBroadcastUnderReplication(SegmentId segmentId)
}
return perTier;
}
+
+ /**
+ * Counts of replicas of a segment in different states.
+ */
+ private static class ReplicaCount
+ {
+ int loaded;
+ int loading;
+ int dropping;
+ int moving;
+
+ void addLoaded()
+ {
+ ++loaded;
+ }
+
+ void addQueued(SegmentState state)
+ {
+ switch (state) {
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]