egor-ryashin commented on a change in pull request #6349: maintenance mode for
Historical
URL: https://github.com/apache/incubator-druid/pull/6349#discussion_r221182166
##########
File path:
server/src/test/java/org/apache/druid/server/coordinator/rules/BroadcastDistributionRuleTest.java
##########
@@ -253,6 +313,46 @@ public void testBroadcastToSingleDataSource()
assertFalse(holderOfSmallSegment.getPeon().getSegmentsToLoad().contains(smallSegment));
}
+ /**
+ * Servers:
+ * name | segments
+ * -------------+--------------
+ * general | large segment
+ * maintenance1 | small segment
+ * maintenance2 | large segment
+ *
+ * After running the rule for the small segment:
+ * general | large & small segments
+ * maintenance1 |
+ * maintenance2 | large segment
+ */
+ @Test
+ public void testBroadcastWithMaintenance()
+ {
+ final ForeverBroadcastDistributionRule rule = new
ForeverBroadcastDistributionRule(ImmutableList.of("large_source"));
+
+ CoordinatorStats stats = rule.run(
+ null,
+ DruidCoordinatorRuntimeParams.newBuilder()
+ .withDruidCluster(secondCluster)
+
.withSegmentReplicantLookup(SegmentReplicantLookup.make(secondCluster))
+
.withBalancerReferenceTimestamp(DateTimes.of("2013-01-01"))
+ .withAvailableSegments(Lists.newArrayList(
Review comment:
Sure, but imagine, for example, given a production class with a single
method, I add 3 methods which are used only in tests, the test will look more
succinct, but the class won't. The coder who needs to understand the logic of
the whole component needs to check usages of all 4 methods and scan through
them to confirm that those 3 used only in tests and are not called in
production and shouldn't be followed to understand how the component operates -
waste of time and concentration, I think.
Meanwhile it's could be impossible to use a debugger in a production to
understand the workflow, while you can run the test in debugger easily if you
don't get some steps.
----------------------------------------------------------------
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]