snleee commented on a change in pull request #4858: Introduce the base JSON 
config class and clean up the config classes
URL: https://github.com/apache/incubator-pinot/pull/4858#discussion_r350999668
 
 

 ##########
 File path: 
pinot-common/src/main/java/org/apache/pinot/common/config/instance/InstanceReplicaGroupPartitionConfig.java
 ##########
 @@ -18,89 +18,68 @@
  */
 package org.apache.pinot.common.config.instance;
 
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.annotation.JsonPropertyDescription;
+import org.apache.pinot.common.config.BaseJsonConfig;
 
 
-@JsonIgnoreProperties(ignoreUnknown = true)
-public class InstanceReplicaGroupPartitionConfig {
+public class InstanceReplicaGroupPartitionConfig extends BaseJsonConfig {
 
   @JsonPropertyDescription("Whether to use replica-group based selection, 
false by default")
-  private boolean _replicaGroupBased;
+  private final boolean _replicaGroupBased;
 
   @JsonPropertyDescription("Number of instances to select for 
non-replica-group based selection, select all instances if not specified")
-  private int _numInstances;
+  private final int _numInstances;
 
   @JsonPropertyDescription("Number of replica-groups for replica-group based 
selection")
-  private int _numReplicaGroups;
+  private final int _numReplicaGroups;
 
   @JsonPropertyDescription("Number of instances per replica-group for 
replica-group based selection, select as many instances as possible if not 
specified")
-  private int _numInstancesPerReplicaGroup;
+  private final int _numInstancesPerReplicaGroup;
 
   @JsonPropertyDescription("Number of partitions for replica-group based 
selection, do not partition the replica-group (1 partition) if not specified")
-  private int _numPartitions;
+  private final int _numPartitions;
 
   @JsonPropertyDescription("Number of instances per partition (within a 
replica-group) for replica-group based selection, select all instances if not 
specified")
-  private int _numInstancesPerPartition;
+  private final int _numInstancesPerPartition;
+
+  @JsonCreator
+  public 
InstanceReplicaGroupPartitionConfig(@JsonProperty("replicaGroupBased") boolean 
replicaGroupBased,
 
 Review comment:
   When there are a lot of parameters for constructor, I think that builder 
pattern usually helps because it's easier to read.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to