egor-ryashin commented on a change in pull request #6349: maintenance mode for
Historical
URL: https://github.com/apache/incubator-druid/pull/6349#discussion_r221228815
##########
File path:
server/src/test/java/org/apache/druid/server/coordinator/DruidCoordinatorBalancerTest.java
##########
@@ -432,4 +628,39 @@ public void emitStats(
delegate.emitStats(tier, stats, serverHolderList);
}
}
+
+ private DruidCoordinatorRuntimeParams setupParamsForMaintenancePriority(int
priority)
+ {
+ mockDruidServer(druidServer1, "1", "normal", 30L, 100L,
ImmutableMap.of(segment1.getIdentifier(), segment1, segment3.getIdentifier(),
segment3));
+ mockDruidServer(druidServer2, "2", "normal", 30L, 100L,
ImmutableMap.of(segment2.getIdentifier(), segment2, segment3.getIdentifier(),
segment3));
+ mockDruidServer(druidServer3, "3", "normal", 0L, 100L,
Collections.emptyMap());
+
+ EasyMock.replay(druidServer4);
+
+ mockCoordinator(coordinator);
+
+ // either maintenance servers list or general ones (ie servers list is [2]
or [1, 3])
+ BalancerStrategy strategy = EasyMock.createMock(BalancerStrategy.class);
+ EasyMock.expect(strategy.pickSegmentToMove(ImmutableList.of(new
ServerHolder(druidServer2, peon2, true))))
+ .andReturn(new BalancerSegmentHolder(druidServer2, segment2));
+ EasyMock.expect(strategy.pickSegmentToMove(anyObject()))
+ .andReturn(new BalancerSegmentHolder(druidServer1, segment1));
+
+ EasyMock.expect(strategy.findNewSegmentHomeBalancer(anyObject(),
anyObject())).andReturn(new ServerHolder(druidServer3, peon3)).anyTimes();
+ replay(strategy);
+
+ return defaultRuntimeParamsBuilder(
+ ImmutableList.of(druidServer1, druidServer2, druidServer3),
+ ImmutableList.of(peon1, peon2, peon3),
+ ImmutableList.of(false, true, false)
+ )
+ .withDynamicConfigs(
+ CoordinatorDynamicConfig.builder()
Review comment:
:white_check_mark:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]