use of io.druid.timeline.DataSegment in project druid by druid-io.
the class DruidCoordinatorSegmentMergerTest method testOverlappingMerge8.
@Test
public void testOverlappingMerge8() {
final List<DataSegment> segments = ImmutableList.of(DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-01/P1D")).version("2").size(80).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-02/P4D")).version("2").size(120).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-03/P1D")).version("3").size(1).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-04/P1D")).version("1").size(1).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-05/P1D")).version("3").size(1).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-06/P1D")).version("2").size(80).build());
Assert.assertEquals(ImmutableList.of(ImmutableList.of(segments.get(4), segments.get(5))), merge(segments));
}
use of io.druid.timeline.DataSegment in project druid by druid-io.
the class DruidCoordinatorSegmentMergerTest method testMergeAtStart.
@Test
public void testMergeAtStart() {
final List<DataSegment> segments = ImmutableList.of(DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-01/P1D")).version("2").size(20).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-02/P1D")).version("2").size(80).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-03/P1D")).version("2").size(20).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-04/P1D")).version("2").size(90).build());
Assert.assertEquals(ImmutableList.of(ImmutableList.of(segments.get(0), segments.get(1))), merge(segments));
}
use of io.druid.timeline.DataSegment in project druid by druid-io.
the class DruidCoordinatorSegmentMergerTest method testMergeAtEnd.
@Test
public void testMergeAtEnd() {
final List<DataSegment> segments = ImmutableList.of(DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-01/P1D")).version("2").size(80).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-02/P1D")).version("2").size(80).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-03/P1D")).version("2").size(80).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-04/P1D")).version("2").size(20).build());
Assert.assertEquals(ImmutableList.of(ImmutableList.of(segments.get(2), segments.get(3))), merge(segments));
}
use of io.druid.timeline.DataSegment in project druid by druid-io.
the class DruidCoordinatorSegmentMergerTest method testOverlappingMerge6.
@Test
public void testOverlappingMerge6() {
final List<DataSegment> segments = ImmutableList.of(DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-01/P1D")).version("2").size(1).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-02/P4D")).version("2").size(80).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-03/P1D")).version("3").size(25).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-04/P1D")).version("4").size(25).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-05/P1D")).version("3").size(25).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-06/P1D")).version("2").size(80).build());
Assert.assertEquals(ImmutableList.of(ImmutableList.of(segments.get(2), segments.get(3), segments.get(4))), merge(segments));
}
use of io.druid.timeline.DataSegment in project druid by druid-io.
the class DruidCoordinatorSegmentMergerTest method testMergeLinearShardSpecs.
@Test
public void testMergeLinearShardSpecs() {
final List<DataSegment> segments = ImmutableList.of(DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-01/P1D")).version("1").shardSpec(new LinearShardSpec(1)).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-02/P1D")).version("1").shardSpec(new LinearShardSpec(7)).build(), DataSegment.builder().dataSource("foo").interval(new Interval("2012-01-03/P1D")).version("1").shardSpec(new LinearShardSpec(1500)).build());
Assert.assertEquals(ImmutableList.of(), merge(segments));
}
Aggregations