somiljain2006 commented on code in PR #20806:
URL: https://github.com/apache/druid/pull/20806#discussion_r4467086583
##########
processing/src/main/java/org/apache/druid/segment/loading/DeepStorageSegmentConfig.java:
##########
@@ -40,34 +45,62 @@
*/
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
+ )
{
- this.zip = zip;
+ 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()
{
- this(null);
+ this(null, null);
}
/**
- * Whether segments should be written as a zip file, falling back to {@code
defaultZip} when
- * {@code druid.storage.zip} has not been set.
+ * Resolves the effective compression format to use, falling back to {@code
defaultFormat} when neither
+ * {@code druid.storage.compressionFormat} nor {@code druid.storage.zip} has
been set.
+ * <p>
+ * When {@code supportedFormats} is non-empty, throws {@link IAE} if the
resolved format is not among them.
*/
- public boolean isZip(boolean defaultZip)
+ public CompressionUtils.Format getEffectiveCompressionFormat(
Review Comment:
The removal of the stored zip property and its accessors is intentional and
follows the maintainer's direction.
--
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]