use of org.apache.druid.timeline.partition.BuildingDimensionRangeShardSpec in project druid by druid-io.
the class SegmentPublisherHelperTest method testAnnotateCorePartitionSetSizeForDimensionRangeShardSpec.
@Test
public void testAnnotateCorePartitionSetSizeForDimensionRangeShardSpec() {
final Set<DataSegment> segments = ImmutableSet.of(newSegment(new BuildingDimensionRangeShardSpec(0, Arrays.asList("dim1", "dim2"), null, StringTuple.create("a", "5"), 0)), newSegment(new BuildingDimensionRangeShardSpec(1, Arrays.asList("dim1", "dim2"), null, StringTuple.create("a", "5"), 1)), newSegment(new BuildingDimensionRangeShardSpec(2, Arrays.asList("dim1", "dim2"), null, StringTuple.create("a", "5"), 2)));
final Set<DataSegment> annotated = SegmentPublisherHelper.annotateShardSpec(segments);
for (DataSegment segment : annotated) {
Assert.assertSame(DimensionRangeShardSpec.class, segment.getShardSpec().getClass());
final DimensionRangeShardSpec shardSpec = (DimensionRangeShardSpec) segment.getShardSpec();
Assert.assertEquals(3, shardSpec.getNumCorePartitions());
}
}
Aggregations