alirezazamani commented on a change in pull request #776: add 
CustomizedStateAggregation config
URL: https://github.com/apache/helix/pull/776#discussion_r380914433
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/model/CustomizedStateAggregationConfig.java
 ##########
 @@ -0,0 +1,144 @@
+package org.apache.helix.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.helix.HelixProperty;
+import org.apache.helix.ZNRecord;
+
+/**
+ * CustomizedStateAggregation configurations
+ */
+public class CustomizedStateAggregationConfig extends HelixProperty {
+  /**
+   * Indicate which customized states will be aggregated.
+   * NOTE: Do NOT use this field name directly, use its corresponding 
getter/setter in the
+   * CustomizedStateAggregationConfig.
+   */
+  public enum CustomizedStateAggregationProperty {
+    AGGREGATION_ENABLED_STATES,
+  }
+
+  /**
+   * Instantiate the CustomizedStateAggregationConfig
+   * @param cluster
+   */
+  public CustomizedStateAggregationConfig(String cluster) {
+    super(cluster);
+  }
+
+  /**
+   * Instantiate with a pre-populated record
+   * @param record a ZNRecord corresponding to a 
CustomizedStateAggregationConfig
+   */
+  public CustomizedStateAggregationConfig(ZNRecord record) {
+    super(record);
+  }
+
+  /**
+   * Instantiate the config using each field individually.
+   * Users should use CustomizedStateAggregationConfig.Builder to create
+   * CustomizedStateAggregationConfig.
+   * @param cluster
+   * @param aggregationEnabledStates
+   */
+  public CustomizedStateAggregationConfig(String cluster, List<String> 
aggregationEnabledStates) {
+    super(cluster);
+    
_record.setListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_STATES.name(),
+        aggregationEnabledStates);
+
+  }
+
+  /**
+   * Set the AGGREGATION_ENABLED_STATES field.
+   * @param aggregationEnabledStates
+   */
+  public void setAggregationEnabledStates(List<String> 
aggregationEnabledStates) {
+    
_record.setListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_STATES.name(),
+        aggregationEnabledStates);
+  }
+
+  /**
+   * Get the AGGREGATION_ENABLED_STATES field.
+   * @return AGGREGATION_ENABLED_STATES field.
+   */
+  public List<String> getAggregationEnabledStates() {
+    return _record
+        
.getListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_STATES.name());
+  }
+
+  public static class Builder {
+    private String _clusterName = null;
+    private List<String> _aggregationEnabledStates;
 
 Review comment:
   If we decided to go with AGGREGATION_ENABLED_TYPE, please change this name 
as well.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org

Reply via email to