Search in sources :

Example 1 with DimensionRangeBucketShardSpec

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

the class RangePartitionCachingLocalSegmentAllocatorTest method testAllocate.

private void testAllocate(InputRow row, Interval interval, int bucketId, @Nullable StringTuple partitionStart, @Nullable StringTuple partitionEnd) {
    String sequenceName = sequenceNameFunction.getSequenceName(interval, row);
    SegmentIdWithShardSpec segmentIdWithShardSpec = allocate(row, sequenceName);
    Assert.assertEquals(SegmentId.of(DATASOURCE, interval, INTERVAL_TO_VERSION.get(interval), bucketId), segmentIdWithShardSpec.asSegmentId());
    DimensionRangeBucketShardSpec shardSpec = (DimensionRangeBucketShardSpec) segmentIdWithShardSpec.getShardSpec();
    Assert.assertEquals(PARTITION_DIMENSIONS, shardSpec.getDimensions());
    Assert.assertEquals(bucketId, shardSpec.getBucketId());
    Assert.assertEquals(partitionStart, shardSpec.getStart());
    Assert.assertEquals(partitionEnd, shardSpec.getEnd());
}
Also used : SegmentIdWithShardSpec(org.apache.druid.segment.realtime.appenderator.SegmentIdWithShardSpec) DimensionRangeBucketShardSpec(org.apache.druid.timeline.partition.DimensionRangeBucketShardSpec)

Aggregations

SegmentIdWithShardSpec (org.apache.druid.segment.realtime.appenderator.SegmentIdWithShardSpec)1 DimensionRangeBucketShardSpec (org.apache.druid.timeline.partition.DimensionRangeBucketShardSpec)1