Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void setup() throws IOException
indexFile = INDEX_MERGER_V9.persist(
incIndex,
tmpDir,
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
qIndex = INDEX_IO.loadIndex(indexFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public void setup(FilteredAggregatorBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
qIndexesDir,
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public void setup() throws IOException
final File file = INDEX_MERGER_V9.persist(
index,
new File(tmpDir, String.valueOf(i)),
new IndexSpec(),
IndexSpec.DEFAULT,
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void setup() throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndexes.get(i),
tmpFile,
new IndexSpec(),
IndexSpec.DEFAULT,
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void setup() throws IOException
File indexFile = indexMergerV9.persist(
incIndex,
tmpDir,
new IndexSpec(),
IndexSpec.DEFAULT,
null
);

Expand All @@ -166,7 +166,7 @@ public void mergeV9(Blackhole blackhole) throws Exception
rollup,
schemaInfo.getAggsArray(),
tmpFile,
new IndexSpec(),
IndexSpec.DEFAULT,
null,
-1
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void persistV9(Blackhole blackhole) throws Exception
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
tmpDir,
new IndexSpec(),
IndexSpec.DEFAULT,
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public void setup(GroupByBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ public void setup(ScanBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public void setup(SearchBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,7 @@ public void setup()
final QueryableIndex index = segmentGenerator.generate(
dataSegment,
schemaInfo,
new IndexSpec(
null,
null,
encodingStrategy,
null,
null,
null,
null
),
IndexSpec.builder().withStringDictionaryEncoding(encodingStrategy).build(),
Granularities.NONE,
rowsPerSegment
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,15 +322,7 @@ public void setup()
schemaInfo,
dimsSpec,
transformSpec,
new IndexSpec(
null,
null,
encodingStrategy,
null,
null,
null,
null
),
IndexSpec.builder().withStringDictionaryEncoding(encodingStrategy).build(),
Granularities.NONE,
rowsPerSegment
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ public void setup(TimeseriesBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void setup(TopNBenchmark global) throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndex,
new File(qIndexesDir, String.valueOf(i)),
new IndexSpec(),
IndexSpec.DEFAULT,
null
);
incIndex.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public void setup() throws IOException
File indexFile = INDEX_MERGER_V9.persist(
incIndexes.get(i),
tmpDir,
new IndexSpec(),
IndexSpec.DEFAULT,
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
public class K8sTestUtils
{

private static final IndexSpec INDEX_SPEC = new IndexSpec();
private static final IndexSpec INDEX_SPEC = IndexSpec.DEFAULT;


/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertNull(config.getMaxTotalRows());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
Assert.assertEquals(new IndexSpec(), config.getIndexSpec());
Assert.assertEquals(new IndexSpec(), config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(false, config.isReportParseExceptions());
Assert.assertEquals(0, config.getHandoffConditionTimeout());
}
Expand Down Expand Up @@ -112,8 +112,14 @@ public void testSerdeWithNonDefaults() throws Exception
Assert.assertEquals(100, config.getMaxPendingPersists());
Assert.assertEquals(true, config.isReportParseExceptions());
Assert.assertEquals(100, config.getHandoffConditionTimeout());
Assert.assertEquals(new IndexSpec(null, null, CompressionStrategy.NONE, null), config.getIndexSpec());
Assert.assertEquals(new IndexSpec(null, CompressionStrategy.UNCOMPRESSED, null, null), config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(
IndexSpec.builder().withMetricCompression(CompressionStrategy.NONE).build(),
config.getIndexSpec()
);
Assert.assertEquals(
IndexSpec.builder().withDimensionCompression(CompressionStrategy.UNCOMPRESSED).build(),
config.getIndexSpecForIntermediatePersists()
);
}

@Test
Expand All @@ -128,8 +134,8 @@ public void testConvert()
10L,
new Period("PT3S"),
4,
new IndexSpec(),
new IndexSpec(),
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
true,
5L,
null,
Expand All @@ -156,7 +162,7 @@ public void testConvert()
Assert.assertEquals(new Period("PT3S"), copy.getIntermediatePersistPeriod());
Assert.assertNull(copy.getBasePersistDirectory());
Assert.assertEquals(4, copy.getMaxPendingPersists());
Assert.assertEquals(new IndexSpec(), copy.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, copy.getIndexSpec());
Assert.assertEquals(true, copy.isReportParseExceptions());
Assert.assertEquals(5L, copy.getHandoffConditionTimeout());
}
Expand All @@ -174,8 +180,8 @@ public void testSerdeWithModifiedTuningConfigAddedField() throws IOException
new Period("PT3S"),
new File("/tmp/xxx"),
4,
new IndexSpec(),
new IndexSpec(),
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
true,
5L,
null,
Expand Down Expand Up @@ -222,8 +228,8 @@ public void testSerdeWithModifiedTuningConfigRemovedField() throws IOException
10L,
new Period("PT3S"),
4,
new IndexSpec(),
new IndexSpec(),
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
true,
5L,
null,
Expand Down Expand Up @@ -262,7 +268,12 @@ public void testSerdeWithModifiedTuningConfigRemovedField() throws IOException
public void testEqualsAndHashCode()
{
EqualsVerifier.forClass(KafkaIndexTaskTuningConfig.class)
.usingGetClass()
.verify();
.withPrefabValues(
IndexSpec.class,
IndexSpec.DEFAULT,
IndexSpec.builder().withDimensionCompression(CompressionStrategy.ZSTD).build()
)
.usingGetClass()
.verify();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
Assert.assertEquals(new IndexSpec(), config.getIndexSpec());
Assert.assertEquals(new IndexSpec(), config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(false, config.isReportParseExceptions());
Assert.assertEquals(0, config.getHandoffConditionTimeout());
Assert.assertNull(config.getWorkerThreads());
Expand Down Expand Up @@ -122,8 +122,14 @@ public void testSerdeWithNonDefaults() throws Exception
Assert.assertEquals(Duration.standardSeconds(15), config.getHttpTimeout());
Assert.assertEquals(Duration.standardSeconds(95), config.getShutdownTimeout());
Assert.assertEquals(Duration.standardSeconds(20), config.getOffsetFetchPeriod());
Assert.assertEquals(new IndexSpec(null, null, CompressionStrategy.NONE, null), config.getIndexSpec());
Assert.assertEquals(new IndexSpec(null, CompressionStrategy.UNCOMPRESSED, null, null), config.getIndexSpecForIntermediatePersists());
Assert.assertEquals(
IndexSpec.builder().withMetricCompression(CompressionStrategy.NONE).build(),
config.getIndexSpec()
);
Assert.assertEquals(
IndexSpec.builder().withDimensionCompression(CompressionStrategy.UNCOMPRESSED).build(),
config.getIndexSpecForIntermediatePersists()
);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.druid.indexing.kinesis.test.TestModifiedKinesisIndexTaskTuningConfig;
import org.apache.druid.jackson.DefaultObjectMapper;
import org.apache.druid.segment.IndexSpec;
import org.apache.druid.segment.data.CompressionStrategy;
import org.apache.druid.segment.incremental.OnheapIncrementalIndex;
import org.apache.druid.segment.indexing.TuningConfig;
import org.hamcrest.CoreMatchers;
Expand Down Expand Up @@ -73,7 +74,7 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
Assert.assertEquals(new IndexSpec(), config.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
Assert.assertFalse(config.isReportParseExceptions());
Assert.assertEquals(0, config.getHandoffConditionTimeout());
Assert.assertNull(config.getRecordBufferSizeConfigured());
Expand Down Expand Up @@ -146,8 +147,8 @@ public void testSerdeWithModifiedTuningConfigAddedField() throws IOException
new Period("PT3S"),
new File("/tmp/xxx"),
4,
new IndexSpec(),
new IndexSpec(),
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
true,
5L,
true,
Expand Down Expand Up @@ -205,8 +206,8 @@ public void testSerdeWithModifiedTuningConfigRemovedField() throws IOException
new Period("PT3S"),
new File("/tmp/xxx"),
4,
new IndexSpec(),
new IndexSpec(),
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
true,
5L,
true,
Expand Down Expand Up @@ -289,8 +290,8 @@ public void testConvert()
100L,
new Period("PT3S"),
4,
new IndexSpec(),
new IndexSpec(),
IndexSpec.DEFAULT,
IndexSpec.DEFAULT,
true,
5L,
true,
Expand Down Expand Up @@ -325,7 +326,7 @@ public void testConvert()
Assert.assertEquals(new Period("PT3S"), copy.getIntermediatePersistPeriod());
Assert.assertNull(copy.getBasePersistDirectory());
Assert.assertEquals(4, copy.getMaxPendingPersists());
Assert.assertEquals(new IndexSpec(), copy.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, copy.getIndexSpec());
Assert.assertTrue(copy.isReportParseExceptions());
Assert.assertEquals(5L, copy.getHandoffConditionTimeout());
Assert.assertEquals(1000, (int) copy.getRecordBufferSizeConfigured());
Expand All @@ -342,7 +343,12 @@ public void testConvert()
public void testEqualsAndHashCode()
{
EqualsVerifier.forClass(KinesisIndexTaskTuningConfig.class)
.usingGetClass()
.verify();
.withPrefabValues(
IndexSpec.class,
IndexSpec.DEFAULT,
IndexSpec.builder().withDimensionCompression(CompressionStrategy.ZSTD).build()
)
.usingGetClass()
.verify();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void testSerdeWithDefaults() throws Exception
Assert.assertEquals(5_000_000, config.getMaxRowsPerSegment().intValue());
Assert.assertEquals(new Period("PT10M"), config.getIntermediatePersistPeriod());
Assert.assertEquals(0, config.getMaxPendingPersists());
Assert.assertEquals(new IndexSpec(), config.getIndexSpec());
Assert.assertEquals(IndexSpec.DEFAULT, config.getIndexSpec());
Assert.assertEquals(false, config.isReportParseExceptions());
Assert.assertEquals(0, config.getHandoffConditionTimeout());
Assert.assertNull(config.getWorkerThreads());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public int getRowsPerSegment()

public IndexSpec getIndexSpec()
{
return indexSpec != null ? indexSpec : new IndexSpec();
return indexSpec != null ? indexSpec : IndexSpec.DEFAULT;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,13 +302,13 @@ public IndexSpec getIndexSpec()
public IndexSpec getIndexSpecForIntermediatePersists()
{
// Disable compression for intermediate persists to reduce direct memory usage.
return new IndexSpec(
null,
CompressionStrategy.UNCOMPRESSED, // Dimensions don't support NONE, so use UNCOMPRESSED
CompressionStrategy.NONE, // NONE is more efficient than UNCOMPRESSED
CompressionFactory.LongEncodingStrategy.LONGS,
null
);
return IndexSpec.builder()
// Dimensions don't support NONE, so use UNCOMPRESSED
.withDimensionCompression(CompressionStrategy.UNCOMPRESSED)
// NONE is more efficient than UNCOMPRESSED
.withMetricCompression(CompressionStrategy.NONE)
.withLongEncoding(CompressionFactory.LongEncodingStrategy.LONGS)
.build();
}

@Override
Expand Down
Loading