Search in sources :

Example 1 with BuildingSingleDimensionShardSpec

use of org.apache.druid.timeline.partition.BuildingSingleDimensionShardSpec in project druid by druid-io.

the class SegmentPublisherHelperTest method testAnnotateCorePartitionSetSizeForSingleDimensionShardSpec.

@Test
public void testAnnotateCorePartitionSetSizeForSingleDimensionShardSpec() {
    final Set<DataSegment> segments = ImmutableSet.of(newSegment(new BuildingSingleDimensionShardSpec(0, "dim", null, "ccc", 0)), newSegment(new BuildingSingleDimensionShardSpec(1, "dim", null, "ccc", 1)), newSegment(new BuildingSingleDimensionShardSpec(2, "dim", null, "ccc", 2)));
    final Set<DataSegment> annotated = SegmentPublisherHelper.annotateShardSpec(segments);
    for (DataSegment segment : annotated) {
        Assert.assertSame(SingleDimensionShardSpec.class, segment.getShardSpec().getClass());
        final SingleDimensionShardSpec shardSpec = (SingleDimensionShardSpec) segment.getShardSpec();
        Assert.assertEquals(3, shardSpec.getNumCorePartitions());
    }
}
Also used : BuildingSingleDimensionShardSpec(org.apache.druid.timeline.partition.BuildingSingleDimensionShardSpec) DataSegment(org.apache.druid.timeline.DataSegment) BuildingSingleDimensionShardSpec(org.apache.druid.timeline.partition.BuildingSingleDimensionShardSpec) SingleDimensionShardSpec(org.apache.druid.timeline.partition.SingleDimensionShardSpec) Test(org.junit.Test)

Aggregations

DataSegment (org.apache.druid.timeline.DataSegment)1 BuildingSingleDimensionShardSpec (org.apache.druid.timeline.partition.BuildingSingleDimensionShardSpec)1 SingleDimensionShardSpec (org.apache.druid.timeline.partition.SingleDimensionShardSpec)1 Test (org.junit.Test)1