use of org.apache.druid.timeline.partition.NumberedOverwriteShardSpec in project druid by druid-io.
the class SegmentPublisherHelperTest method testAnnotateAtomicUpdateGroupSize.
@Test
public void testAnnotateAtomicUpdateGroupSize() {
final Set<DataSegment> segments = ImmutableSet.of(newSegment(new NumberedOverwriteShardSpec(PartitionIds.NON_ROOT_GEN_START_PARTITION_ID, 0, 3, (short) 1)), newSegment(new NumberedOverwriteShardSpec(PartitionIds.NON_ROOT_GEN_START_PARTITION_ID + 1, 0, 3, (short) 1)), newSegment(new NumberedOverwriteShardSpec(PartitionIds.NON_ROOT_GEN_START_PARTITION_ID + 2, 0, 3, (short) 1)));
final Set<DataSegment> annotated = SegmentPublisherHelper.annotateShardSpec(segments);
for (DataSegment segment : annotated) {
Assert.assertSame(NumberedOverwriteShardSpec.class, segment.getShardSpec().getClass());
final NumberedOverwriteShardSpec shardSpec = (NumberedOverwriteShardSpec) segment.getShardSpec();
Assert.assertEquals(3, shardSpec.getAtomicUpdateGroupSize());
}
}
Aggregations