egor-ryashin commented on a change in pull request #6349: maintenance mode for 
Historical
URL: https://github.com/apache/incubator-druid/pull/6349#discussion_r220915673
 
 

 ##########
 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:
   The order of servers doesn't matter in my tests (ie the cost-based strategy 
goes through all the servers independently and segments move quota is large 
enough to accommodate all) and I tried to make as less refactoring of existing 
code as possible for brevity.

----------------------------------------------------------------
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]

Reply via email to