Search in sources :

Example 16 with NumberedOverwriteShardSpec

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());
    }
}
Also used : NumberedOverwriteShardSpec(org.apache.druid.timeline.partition.NumberedOverwriteShardSpec) DataSegment(org.apache.druid.timeline.DataSegment) Test(org.junit.Test)

Aggregations

NumberedOverwriteShardSpec (org.apache.druid.timeline.partition.NumberedOverwriteShardSpec)16 DataSegment (org.apache.druid.timeline.DataSegment)15 Test (org.junit.Test)14 NumberedShardSpec (org.apache.druid.timeline.partition.NumberedShardSpec)13 HashBasedNumberedShardSpec (org.apache.druid.timeline.partition.HashBasedNumberedShardSpec)11 ImmutableList (com.google.common.collect.ImmutableList)10 ArrayList (java.util.ArrayList)10 List (java.util.List)10 Builder (org.apache.druid.indexing.common.task.CompactionTask.Builder)9 TaskStatus (org.apache.druid.indexer.TaskStatus)7 Interval (org.joda.time.Interval)6 Pair (org.apache.druid.java.util.common.Pair)3 UniformGranularitySpec (org.apache.druid.segment.indexing.granularity.UniformGranularitySpec)3 File (java.io.File)2 CountDownLatch (java.util.concurrent.CountDownLatch)2 ClientCompactionTaskGranularitySpec (org.apache.druid.client.indexing.ClientCompactionTaskGranularitySpec)2 AbstractParallelIndexSupervisorTaskTest (org.apache.druid.indexing.common.task.batch.parallel.AbstractParallelIndexSupervisorTaskTest)2 DimensionRangeShardSpec (org.apache.druid.timeline.partition.DimensionRangeShardSpec)2 ShardSpec (org.apache.druid.timeline.partition.ShardSpec)2 SingleDimensionShardSpec (org.apache.druid.timeline.partition.SingleDimensionShardSpec)2