kfaraz commented on code in PR #16810:
URL: https://github.com/apache/druid/pull/16810#discussion_r1696307664
##########
server/src/main/java/org/apache/druid/server/coordinator/ClusterCompactionConfig.java:
##########
@@ -17,38 +17,39 @@
* under the License.
*/
-package org.apache.druid.server.http;
+package org.apache.druid.server.coordinator;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.druid.indexer.CompactionEngine;
import javax.annotation.Nullable;
+import java.util.Objects;
/**
- * Payload to update the cluster-level compaction config.
- * All fields of this class must be nullable. A non-value indicates that the
- * corresponding field is being updated.
+ * Cluster-level compaction configs.
+ * All fields of this class are nullable. A non-null value denotes that the
+ * corresponding field has been explicitly specified.
*/
-public class CompactionConfigUpdateRequest
+public class ClusterCompactionConfig
{
private final Double compactionTaskSlotRatio;
private final Integer maxCompactionTaskSlots;
private final Boolean useAutoScaleSlots;
- private final CompactionEngine compactionEngine;
+ private final CompactionEngine engine;
@JsonCreator
- public CompactionConfigUpdateRequest(
+ public ClusterCompactionConfig(
@JsonProperty("compactionTaskSlotRatio") @Nullable Double
compactionTaskSlotRatio,
@JsonProperty("maxCompactionTaskSlots") @Nullable Integer
maxCompactionTaskSlots,
@JsonProperty("useAutoScaleSlots") @Nullable Boolean useAutoScaleSlots,
- @JsonProperty("compactionEngine") @Nullable CompactionEngine
compactionEngine
+ @JsonProperty("engine") @Nullable CompactionEngine engine
)
{
Review Comment:
I considered that. But that becomes problematic since this payload is used
to update cluster configs.
If we assign non-null values in the constructor, it would seem that the
values are being updated even if we don't want them to be updated.
The audit entry thing is not an issue as there we always use non-null values.
See `DruidCompactionConfig.clusterConfig()` method which always returns
non-null values.
--
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]