somiljain2006 commented on code in PR #20806:
URL: https://github.com/apache/druid/pull/20806#discussion_r4435781240
##########
processing/src/main/java/org/apache/druid/segment/loading/DeepStorageSegmentConfig.java:
##########
@@ -40,34 +43,59 @@
*/
public class DeepStorageSegmentConfig
{
- @JsonProperty
+ private static final Logger log = new Logger(DeepStorageSegmentConfig.class);
+
+ @JsonProperty("compressionFormat")
@Nullable
- private final Boolean zip;
+ private final CompressionUtils.Format compressionFormat;
@JsonCreator
- public DeepStorageSegmentConfig(@JsonProperty("zip") @Nullable Boolean zip)
+ public DeepStorageSegmentConfig(
+ @JsonProperty("zip") @Nullable Boolean zip,
+ @JsonProperty("compressionFormat") @Nullable CompressionUtils.Format
compressionFormat
+ )
+ {
+ if (zip != null) {
+ log.warn("druid.storage.zip is deprecated, use
druid.storage.compressionFormat instead.");
+ }
+ if (compressionFormat != null) {
+ this.compressionFormat = compressionFormat;
+ } else if (zip != null) {
+ this.compressionFormat = zip ? CompressionUtils.Format.ZIP :
CompressionUtils.Format.NONE;
+ } else {
+ this.compressionFormat = null;
+ }
+ }
+
+ public DeepStorageSegmentConfig(@Nullable Boolean zip)
+ {
+ this(zip, null);
+ }
+
+ public DeepStorageSegmentConfig(@Nullable CompressionUtils.Format
compressionFormat)
Review Comment:
The constructor ambiguity has been addressed by removing the single-argument
Boolean and CompressionUtils.Format overloads. The no-argument constructor and
the two-argument @JsonCreator constructor are retained, and all internal call
sites have been updated accordingly.
The zip property is intentionally no longer stored or exposed through Java
accessors, following the maintainer's direction. It is still accepted as a
legacy JSON configuration property and converted to CompressionUtils.Format,
with a deprecation warning. Explicit compressionFormat takes precedence when
both properties are provided.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]