leventov commented on a change in pull request #6349: maintenance mode for
Historical
URL: https://github.com/apache/incubator-druid/pull/6349#discussion_r220510923
##########
File path:
server/src/test/java/org/apache/druid/server/coordinator/rules/LoadRuleTest.java
##########
@@ -685,6 +685,210 @@ public void testMaxLoadingQueueSize()
EasyMock.verify(throttler, mockBalancerStrategy);
}
+ /**
+ * 2 servers in different tiers, the first is in maitenance mode.
+ * Should not load a segment to the server in maintenance mode.
+ */
+ @Test
+ public void testLoadDuringMaitenance()
+ {
+ final LoadQueuePeon mockPeon1 = createEmptyPeon();
+ final LoadQueuePeon mockPeon2 = createOneCallPeonMock();
+
+ LoadRule rule = createLoadRule(ImmutableMap.of(
+ "tier1", 1,
+ "tier2", 1
+ ));
+
+ final DataSegment segment = createDataSegment("foo");
+
+
EasyMock.expect(mockBalancerStrategy.findNewSegmentHomeReplicator(EasyMock.anyObject(),
EasyMock.anyObject()))
+ .andDelegateTo(balancerStrategy)
+ .times(1);
+
+ EasyMock.replay(mockPeon1, mockPeon2, mockBalancerStrategy);
+
+
+ DruidCluster druidCluster = new DruidCluster(
+ null,
+ ImmutableMap.of(
+ "tier1",
+ Stream.of(
Review comment:
For testing purposes, it would be easier to have `Map<String,
Iterable<ServerHolder>>` parameter in the exposed `DruidCluster` constructor,
and convert to TreeSets internally. It's tedious to provide the proper
comparator everywhere in tests, for example here you didn't do it.
----------------------------------------------------------------
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]