jihoonson commented on a change in pull request #8038: Making optimal usage of
multiple segment cache locations
URL: https://github.com/apache/incubator-druid/pull/8038#discussion_r321068607
##########
File path:
server/src/test/java/org/apache/druid/segment/loading/SegmentLoaderLocalCacheManagerTest.java
##########
@@ -372,24 +372,276 @@ public void testEmptyToFullOrder() throws Exception
}
private DataSegment dataSegmentWithInterval(String intervalStr)
+ {
+ return dataSegmentWithInterval(intervalStr, 10L);
+ }
+
+ private DataSegment dataSegmentWithInterval(String intervalStr, long size)
{
return DataSegment.builder()
- .dataSource("test_segment_loader")
- .interval(Intervals.of(intervalStr))
- .loadSpec(
- ImmutableMap.of(
- "type",
- "local",
- "path",
- "somewhere"
- )
- )
- .version("2015-05-27T03:38:35.683Z")
- .dimensions(ImmutableList.of())
- .metrics(ImmutableList.of())
- .shardSpec(NoneShardSpec.instance())
- .binaryVersion(9)
- .size(10L)
- .build();
+ .dataSource("test_segment_loader")
+ .interval(Intervals.of(intervalStr))
+ .loadSpec(
+ ImmutableMap.of(
+ "type",
+ "local",
+ "path",
+ "somewhere"
+ )
+ )
+ .version("2015-05-27T03:38:35.683Z")
+ .dimensions(ImmutableList.of())
+ .metrics(ImmutableList.of())
+ .shardSpec(NoneShardSpec.instance())
+ .binaryVersion(9)
+ .size(size)
+ .build();
+ }
+
+ @Test
+ public void testSegmentDistributionUsingRoundRobinStrategy() throws Exception
Review comment:
What I'm saying is this is not a good place to test
`StorageLocationSelectorStrategy`. The newly added tests here test some part of
`StorageLocationSelectorStrategy` but are not fully testing in various
situations. Also, they are duplicate with other tests in this class because
they should end up calling `SegmentLoaderLocalCacheManager` API. I think most
of the codes in the new tests are not necessary if we add a new test class for
testing only `StorageLocationSelectorStrategy`.
Similarly, `SegmentLoaderLocalCacheManagerConcurrencyTest` is to do some
concurrency test for `SegmentLoaderLocalCacheManager` not
`StorageLocationSelectorStrategy`. Please add a new class for it.
----------------------------------------------------------------
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.
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]