use of org.apache.druid.indexer.partitions.DynamicPartitionsSpec in project druid by druid-io.
the class UserCompactionTaskQueryTuningConfigTest method testSerde.
@Test
public void testSerde() throws IOException {
final UserCompactionTaskQueryTuningConfig tuningConfig = new UserCompactionTaskQueryTuningConfig(40000, 2000L, null, new SegmentsSplitHintSpec(new HumanReadableBytes(42L), null), new DynamicPartitionsSpec(1000, 20000L), new IndexSpec(new DefaultBitmapSerdeFactory(), CompressionStrategy.LZ4, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(new DefaultBitmapSerdeFactory(), CompressionStrategy.LZ4, CompressionStrategy.UNCOMPRESSED, LongEncodingStrategy.AUTO), 2, 1000L, TmpFileSegmentWriteOutMediumFactory.instance(), 100, 5, 1000L, new Duration(3000L), 7, 1000, 100);
final String json = OBJECT_MAPPER.writeValueAsString(tuningConfig);
final UserCompactionTaskQueryTuningConfig fromJson = OBJECT_MAPPER.readValue(json, UserCompactionTaskQueryTuningConfig.class);
Assert.assertEquals(tuningConfig, fromJson);
}
use of org.apache.druid.indexer.partitions.DynamicPartitionsSpec in project druid by druid-io.
the class DataSourceCompactionConfigTest method testSerdeUserCompactionTuningConfig.
@Test
public void testSerdeUserCompactionTuningConfig() throws IOException {
final UserCompactionTaskQueryTuningConfig tuningConfig = new UserCompactionTaskQueryTuningConfig(40000, 2000L, null, new SegmentsSplitHintSpec(new HumanReadableBytes(100000L), null), new DynamicPartitionsSpec(1000, 20000L), new IndexSpec(new DefaultBitmapSerdeFactory(), CompressionStrategy.LZ4, CompressionStrategy.LZF, LongEncodingStrategy.LONGS), new IndexSpec(new DefaultBitmapSerdeFactory(), CompressionStrategy.LZ4, CompressionStrategy.UNCOMPRESSED, LongEncodingStrategy.AUTO), 2, 1000L, TmpFileSegmentWriteOutMediumFactory.instance(), 100, 5, 1000L, new Duration(3000L), 7, 1000, 100);
final String json = OBJECT_MAPPER.writeValueAsString(tuningConfig);
final UserCompactionTaskQueryTuningConfig fromJson = OBJECT_MAPPER.readValue(json, UserCompactionTaskQueryTuningConfig.class);
Assert.assertEquals(tuningConfig, fromJson);
}
Aggregations