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());
}
Aggregations