Skip to content

Commit 4e7279f

Browse files
committed
Restore compatibility constructors for config APIs
1 parent f1b823a commit 4e7279f

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/ForwardIndexConfig.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static ForwardIndexConfig getDefault() {
7575
}
7676

7777
public static ForwardIndexConfig getDisabled() {
78-
return new ForwardIndexConfig(true, null, null, null, null, null, null, null, null);
78+
return new ForwardIndexConfig(true, (CompressionCodecSpec) null, null, null, null, null, null);
7979
}
8080

8181
@JsonProperty("compressionCodec")
@@ -104,6 +104,20 @@ public ForwardIndexConfig(@Nullable Boolean disabled, @Nullable CompressionCodec
104104
rawIndexWriterVersion, targetMaxChunkSize, targetDocsPerChunk, configs);
105105
}
106106

107+
/**
108+
* @deprecated Kept for binary compatibility with callers still constructing the config via legacy compression types.
109+
*/
110+
@Deprecated
111+
public ForwardIndexConfig(@Nullable Boolean disabled, @Nullable CompressionCodec compressionCodec,
112+
@Nullable ChunkCompressionType chunkCompressionType, @Nullable DictIdCompressionType dictIdCompressionType,
113+
@Nullable Boolean deriveNumDocsPerChunk, @Nullable Integer rawIndexWriterVersion,
114+
@Nullable String targetMaxChunkSize, @Nullable Integer targetDocsPerChunk,
115+
@Nullable Map<String, Object> configs) {
116+
this(disabled, getActualCompressionCodecSpec(CompressionCodecSpec.fromCompressionCodec(compressionCodec),
117+
chunkCompressionType, dictIdCompressionType), deriveNumDocsPerChunk, rawIndexWriterVersion,
118+
targetMaxChunkSize, targetDocsPerChunk, configs);
119+
}
120+
107121
private ForwardIndexConfig(@Nullable Boolean disabled, @Nullable CompressionCodecSpec compressionCodecSpec,
108122
@Nullable Boolean deriveNumDocsPerChunk, @Nullable Integer rawIndexWriterVersion,
109123
@Nullable String targetMaxChunkSize, @Nullable Integer targetDocsPerChunk,

pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,19 @@ public FieldConfig(String name, EncodingType encodingType, @Nullable IndexType i
104104
timestampConfig, null, properties, null);
105105
}
106106

107+
/**
108+
* Deprecated compatibility constructor retained for binary compatibility with callers that still construct
109+
* {@link FieldConfig} directly with the enum-based compression codec.
110+
*/
111+
@Deprecated
112+
public FieldConfig(String name, EncodingType encodingType, @Nullable IndexType indexType,
113+
@Nullable List<IndexType> indexTypes, @Nullable CompressionCodec compressionCodec,
114+
@Nullable TimestampConfig timestampConfig, @Nullable JsonNode indexes,
115+
@Nullable Map<String, String> properties, @Nullable JsonNode tierOverwrites) {
116+
this(name, encodingType, indexType, indexTypes, CompressionCodecSpec.fromCompressionCodec(compressionCodec),
117+
timestampConfig, indexes, properties, tierOverwrites);
118+
}
119+
107120
@JsonCreator
108121
public FieldConfig(@JsonProperty(value = "name", required = true) String name,
109122
@JsonProperty(value = "encodingType") EncodingType encodingType,

0 commit comments

Comments
 (0)