FrankChen021 commented on code in PR #20806:
URL: https://github.com/apache/druid/pull/20806#discussion_r4435620482


##########
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:
   [P1] Preserve Java compatibility
   
   **Finding:** This change removes the public getZip() and isZip(boolean) 
accessors and adds a Format overload that makes previously valid calls such as 
new DeepStorageSegmentConfig(null) ambiguous for source clients. Existing 
downstream extensions can fail at runtime or compilation even though 
druid.storage.zip is only deprecated.
   
   **Suggestion:** Retain deprecated compatibility accessors and avoid an 
ambiguous null overload while migrating internal callers.



-- 
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]

Reply via email to