Jackie-Jiang commented on code in PR #18317:
URL: https://github.com/apache/pinot/pull/18317#discussion_r3243191636
##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/BloomFilterConfig.java:
##########
@@ -20,49 +20,78 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.base.Preconditions;
import java.util.Objects;
public class BloomFilterConfig extends IndexConfig {
public static final double DEFAULT_FPP = 0.05;
- public static final BloomFilterConfig DEFAULT = new
BloomFilterConfig(BloomFilterConfig.DEFAULT_FPP, 0, false);
- public static final BloomFilterConfig DISABLED = new BloomFilterConfig(true,
BloomFilterConfig.DEFAULT_FPP, 0,
- false);
+ public static final BloomFilterConfig DEFAULT = new BloomFilterConfig(null,
null, null, null);
+ public static final BloomFilterConfig DISABLED = new BloomFilterConfig(true,
null, null, null);
- private final double _fpp;
- private final int _maxSizeInBytes;
- private final boolean _loadOnHeap;
+ private final Double _fpp;
+ private final Integer _maxSizeInBytes;
+ private final Boolean _loadOnHeap;
public BloomFilterConfig(double fpp, int maxSizeInBytes, boolean loadOnHeap)
{
- this(false, fpp, maxSizeInBytes, loadOnHeap);
+ // Forward to the wrapper @JsonCreator. Boolean.FALSE for arg0
disambiguates from the deprecated
+ // primitive overload below (which would otherwise tie on overload
resolution).
+ this(Boolean.FALSE, Double.valueOf(fpp), Integer.valueOf(maxSizeInBytes),
Boolean.valueOf(loadOnHeap));
+ }
+
+ /// Binary-compat delegate for the pre-wrapper `(Boolean, double, int,
boolean)` ctor. Kept so existing
+ /// compiled call sites resolved to the primitive signature continue to
link. Prefer the wrapper-typed
+ /// `@JsonCreator` ctor below for new code.
+ @Deprecated
+ public BloomFilterConfig(Boolean disabled, double fpp, int maxSizeInBytes,
boolean loadOnHeap) {
+ this(disabled, Double.valueOf(fpp), Integer.valueOf(maxSizeInBytes),
Boolean.valueOf(loadOnHeap));
}
@JsonCreator
- public BloomFilterConfig(@JsonProperty("disabled") Boolean disabled,
@JsonProperty(value = "fpp") double fpp,
- @JsonProperty(value = "maxSizeInBytes") int maxSizeInBytes,
- @JsonProperty(value = "loadOnHeap") boolean loadOnHeap) {
+ public BloomFilterConfig(@JsonProperty("disabled") Boolean disabled,
@JsonProperty(value = "fpp") Double fpp,
Review Comment:
For all optional arguments, consider putting `@Nullable` annotation. Same
for all changes
--
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]