You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ji...@apache.org on 2020/02/21 19:40:35 UTC
[helix] branch customizeView updated: Add java API to add or remove
CustomizedStateAggregationConfig (#792)
This is an automated email from the ASF dual-hosted git repository.
jiajunwang pushed a commit to branch customizeView
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/customizeView by this push:
new dc25323 Add java API to add or remove CustomizedStateAggregationConfig (#792)
dc25323 is described below
commit dc25323529bde61e3c7f924efb3c615ba9648fda
Author: Ali Reza Zamani Zadeh Najari <an...@linkedin.com>
AuthorDate: Fri Feb 21 11:40:28 2020 -0800
Add java API to add or remove CustomizedStateAggregationConfig (#792)
In this commit the below APIs have been added.
1- addCustomizedStateAggregationConfig
2- removeCustomizedStateAggregationConfig.
3- addTypeToCustomizedStateAggregationConfig
4- removeTypeFromCustomizedStateAggregationConfig
Tests have been added to check the functionality of these APIs.
---
.../main/java/org/apache/helix/ConfigAccessor.java | 2 +-
.../src/main/java/org/apache/helix/HelixAdmin.java | 26 ++++++
.../org/apache/helix/manager/zk/ZKHelixAdmin.java | 82 +++++++++++++++++++
.../model/CustomizedStateAggregationConfig.java | 78 +++++++++---------
.../apache/helix/manager/zk/TestZkHelixAdmin.java | 94 ++++++++++++++++++++++
.../java/org/apache/helix/mock/MockHelixAdmin.java | 22 +++++
.../TestCustomizedStateAggregationConfig.java | 15 ++--
7 files changed, 272 insertions(+), 47 deletions(-)
diff --git a/helix-core/src/main/java/org/apache/helix/ConfigAccessor.java b/helix-core/src/main/java/org/apache/helix/ConfigAccessor.java
index 43d47cd..7eed9a3 100644
--- a/helix-core/src/main/java/org/apache/helix/ConfigAccessor.java
+++ b/helix-core/src/main/java/org/apache/helix/ConfigAccessor.java
@@ -579,7 +579,7 @@ public class ConfigAccessor {
return null;
}
- return new CustomizedStateAggregationConfig(record);
+ return new CustomizedStateAggregationConfig.Builder(record).build();
}
/**
diff --git a/helix-core/src/main/java/org/apache/helix/HelixAdmin.java b/helix-core/src/main/java/org/apache/helix/HelixAdmin.java
index a11b235..86edb78 100644
--- a/helix-core/src/main/java/org/apache/helix/HelixAdmin.java
+++ b/helix-core/src/main/java/org/apache/helix/HelixAdmin.java
@@ -26,6 +26,7 @@ import java.util.Map;
import org.apache.helix.model.ClusterConstraints;
import org.apache.helix.model.ClusterConstraints.ConstraintType;
import org.apache.helix.model.ConstraintItem;
+import org.apache.helix.model.CustomizedStateAggregationConfig;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.HelixConfigScope;
import org.apache.helix.model.IdealState;
@@ -104,6 +105,31 @@ public interface HelixAdmin {
*/
void addClusterToGrandCluster(String clusterName, String grandCluster);
+ /** Add a CustomizedStateAggregationConfig to a cluster
+ * @param clusterName
+ * @param customizedStateAggregationConfig
+ */
+ void addCustomizedStateAggregationConfig(String clusterName,
+ CustomizedStateAggregationConfig customizedStateAggregationConfig);
+
+ /**
+ * Remove CustomizedStateAggregationConfig from specific cluster
+ * @param clusterName
+ */
+ void removeCustomizedStateAggregationConfig(String clusterName);
+
+ /**
+ * Add a type to CustomizedStateAggregationConfig of specific cluster
+ * @param clusterName
+ */
+ void addTypeToCustomizedStateAggregationConfig(String clusterName, String type);
+
+ /**
+ * Remove a type from CustomizedStateAggregationConfig of specific cluster
+ * @param clusterName
+ */
+ void removeTypeFromCustomizedStateAggregationConfig(String clusterName, String type);
+
/**
* Add a resource to a cluster, using the default ideal state mode AUTO
* @param clusterName
diff --git a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
index 0a978e5..e087728 100644
--- a/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
+++ b/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixAdmin.java
@@ -65,6 +65,7 @@ import org.apache.helix.model.ClusterConstraints.ConstraintType;
import org.apache.helix.model.ConstraintItem;
import org.apache.helix.model.ControllerHistory;
import org.apache.helix.model.CurrentState;
+import org.apache.helix.model.CustomizedStateAggregationConfig;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.HelixConfigScope;
import org.apache.helix.model.IdealState;
@@ -1105,6 +1106,87 @@ public class ZKHelixAdmin implements HelixAdmin {
}
@Override
+ public void addCustomizedStateAggregationConfig(String clusterName,
+ CustomizedStateAggregationConfig customizedStateAggregationConfig) {
+ logger.info(
+ "Add CustomizedStateAggregationConfig to cluster {}, CustomizedStateAggregationConfig is {}",
+ clusterName, customizedStateAggregationConfig.toString());
+
+ if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) {
+ throw new HelixException("cluster " + clusterName + " is not setup yet");
+ }
+
+ CustomizedStateAggregationConfig.Builder builder =
+ new CustomizedStateAggregationConfig.Builder(customizedStateAggregationConfig);
+ CustomizedStateAggregationConfig customizedStateAggregationConfigFromBuilder = builder.build();
+
+ ZKHelixDataAccessor accessor =
+ new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
+ Builder keyBuilder = accessor.keyBuilder();
+ accessor.setProperty(keyBuilder.customizedStateAggregationConfig(),
+ customizedStateAggregationConfigFromBuilder);
+ }
+
+ @Override
+ public void removeCustomizedStateAggregationConfig(String clusterName) {
+ logger.info(
+ "Remove CustomizedStateAggregationConfig from cluster {}.", clusterName);
+
+ ZKHelixDataAccessor accessor =
+ new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
+ Builder keyBuilder = accessor.keyBuilder();
+ accessor.removeProperty(keyBuilder.customizedStateAggregationConfig());
+
+ }
+
+ @Override
+ public void addTypeToCustomizedStateAggregationConfig(String clusterName, String type) {
+ logger.info("Add type {} to CustomizedStateAggregationConfig of cluster {}", type, clusterName);
+
+ if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) {
+ throw new HelixException("cluster " + clusterName + " is not setup yet");
+ }
+ CustomizedStateAggregationConfig.Builder builder =
+ new CustomizedStateAggregationConfig.Builder();
+
+ builder.addAggregationEnabledType(type);
+ CustomizedStateAggregationConfig customizedStateAggregationConfigFromBuilder = builder.build();
+
+ ZKHelixDataAccessor accessor =
+ new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
+ Builder keyBuilder = accessor.keyBuilder();
+ accessor.updateProperty(keyBuilder.customizedStateAggregationConfig(),
+ customizedStateAggregationConfigFromBuilder);
+ }
+
+
+ @Override
+ public void removeTypeFromCustomizedStateAggregationConfig(String clusterName, String type) {
+ logger.info("Remove type {} to CustomizedStateAggregationConfig of cluster {}", type,
+ clusterName);
+
+ if (!ZKUtil.isClusterSetup(clusterName, _zkClient)) {
+ throw new HelixException("cluster " + clusterName + " is not setup yet");
+ }
+
+ CustomizedStateAggregationConfig.Builder builder = new CustomizedStateAggregationConfig.Builder(
+ _configAccessor.getCustomizedStateAggregationConfig(clusterName));
+
+ if (!builder.getAggregationEnabledTypes().contains(type)) {
+ throw new HelixException("Type " + type
+ + " is missing from the CustomizedStateAggregationConfig of cluster " + clusterName);
+ }
+
+ builder.removeAggregationEnabledType(type);
+ CustomizedStateAggregationConfig customizedStateAggregationConfigFromBuilder = builder.build();
+ ZKHelixDataAccessor accessor =
+ new ZKHelixDataAccessor(clusterName, new ZkBaseDataAccessor<ZNRecord>(_zkClient));
+ Builder keyBuilder = accessor.keyBuilder();
+ accessor.setProperty(keyBuilder.customizedStateAggregationConfig(),
+ customizedStateAggregationConfigFromBuilder);
+ }
+
+ @Override
public List<String> getConfigKeys(HelixConfigScope scope) {
return _configAccessor.getKeys(scope);
}
diff --git a/helix-core/src/main/java/org/apache/helix/model/CustomizedStateAggregationConfig.java b/helix-core/src/main/java/org/apache/helix/model/CustomizedStateAggregationConfig.java
index 0e4a065..29a8a7a 100644
--- a/helix-core/src/main/java/org/apache/helix/model/CustomizedStateAggregationConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/model/CustomizedStateAggregationConfig.java
@@ -21,6 +21,7 @@ package org.apache.helix.model;
import java.util.ArrayList;
import java.util.List;
+import org.apache.helix.HelixException;
import org.apache.helix.HelixProperty;
import org.apache.helix.ZNRecord;
@@ -28,6 +29,10 @@ import org.apache.helix.ZNRecord;
* CustomizedStateAggregation configurations
*/
public class CustomizedStateAggregationConfig extends HelixProperty {
+
+ public static final String CUSTOMIZED_STATE_AGGREGATION_CONFIG_KW =
+ "CustomizedStateAggregationConfig";
+
/**
* Indicate which customized states will be aggregated.
* NOTE: Do NOT use this field name directly, use its corresponding getter/setter in the
@@ -39,10 +44,9 @@ public class CustomizedStateAggregationConfig extends HelixProperty {
/**
* Instantiate the CustomizedStateAggregationConfig
- * @param cluster
*/
- public CustomizedStateAggregationConfig(String cluster) {
- super(cluster);
+ public CustomizedStateAggregationConfig() {
+ super(CUSTOMIZED_STATE_AGGREGATION_CONFIG_KW);
}
/**
@@ -50,21 +54,10 @@ public class CustomizedStateAggregationConfig extends HelixProperty {
* @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 aggregationEnabledTypes
- */
- public CustomizedStateAggregationConfig(String cluster, List<String> aggregationEnabledTypes) {
- super(cluster);
- _record.setListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name(),
- aggregationEnabledTypes);
-
+ super(CUSTOMIZED_STATE_AGGREGATION_CONFIG_KW);
+ _record.setSimpleFields(record.getSimpleFields());
+ _record.setListFields(record.getListFields());
+ _record.setMapFields(record.getMapFields());
}
/**
@@ -86,25 +79,26 @@ public class CustomizedStateAggregationConfig extends HelixProperty {
}
public static class Builder {
- private String _clusterName = null;
- private List<String> _aggregationEnabledTypes;
+ private ZNRecord _record;
+
public CustomizedStateAggregationConfig build() {
- return new CustomizedStateAggregationConfig(_clusterName, _aggregationEnabledTypes);
+ return new CustomizedStateAggregationConfig(_record);
}
/**
* Default constructor
*/
public Builder() {
+ _record = new ZNRecord(CUSTOMIZED_STATE_AGGREGATION_CONFIG_KW);
}
/**
- * Constructor with Cluster Name as input
- * @param clusterName
+ * Instantiate with a pre-populated record
+ * @param record a ZNRecord corresponding to a Customized State Aggregation configuration
*/
- public Builder(String clusterName) {
- _clusterName = clusterName;
+ public Builder(ZNRecord record) {
+ _record = record;
}
/**
@@ -112,33 +106,39 @@ public class CustomizedStateAggregationConfig extends HelixProperty {
* @param customizedStateAggregationConfig
*/
public Builder(CustomizedStateAggregationConfig customizedStateAggregationConfig) {
- _aggregationEnabledTypes = customizedStateAggregationConfig.getAggregationEnabledTypes();
+ _record = customizedStateAggregationConfig.getRecord();
}
- public Builder setClusterName(String v) {
- _clusterName = v;
+ public Builder setAggregationEnabledTypes(List<String> aggregationEnabledTypes) {
+ _record.setListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name(), aggregationEnabledTypes);
return this;
}
- public Builder setAggregationEnabledTypes(List<String> v) {
- _aggregationEnabledTypes = v;
+ public Builder addAggregationEnabledType(String type) {
+ if (_record.getListField(
+ CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name()) == null) {
+ _record.setListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name(), new ArrayList<String>());
+ }
+ List<String> aggregationEnabledTypes = _record.getListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name());
+ aggregationEnabledTypes.add(type);
+ _record.setListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name(), aggregationEnabledTypes);
return this;
}
- public Builder addAggregationEnabledType(String v) {
- if (_aggregationEnabledTypes == null) {
- _aggregationEnabledTypes = new ArrayList<String>();
+ public Builder removeAggregationEnabledType(String type) {
+ if (!_record.getListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name())
+ .contains(type)) {
+ throw new HelixException(
+ "Type " + type + " is missing from the CustomizedStateAggregationConfig");
}
- _aggregationEnabledTypes.add(v);
+ _record.getListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name())
+ .remove(type);
return this;
}
- public String getClusterName() {
- return _clusterName;
- }
-
public List<String> getAggregationEnabledTypes() {
- return _aggregationEnabledTypes;
+ return _record
+ .getListField(CustomizedStateAggregationProperty.AGGREGATION_ENABLED_TYPES.name());
}
}
}
diff --git a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java
index 20acef4..df9336c 100644
--- a/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java
+++ b/helix-core/src/test/java/org/apache/helix/manager/zk/TestZkHelixAdmin.java
@@ -27,6 +27,7 @@ import java.util.List;
import java.util.Map;
import org.apache.helix.BaseDataAccessor;
+import org.apache.helix.ConfigAccessor;
import org.apache.helix.HelixAdmin;
import org.apache.helix.HelixDataAccessor;
import org.apache.helix.HelixException;
@@ -44,6 +45,7 @@ import org.apache.helix.model.ClusterConstraints;
import org.apache.helix.model.ClusterConstraints.ConstraintAttribute;
import org.apache.helix.model.ClusterConstraints.ConstraintType;
import org.apache.helix.model.ConstraintItem;
+import org.apache.helix.model.CustomizedStateAggregationConfig;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.HelixConfigScope;
import org.apache.helix.model.HelixConfigScope.ConfigScopeProperty;
@@ -506,4 +508,96 @@ public class TestZkHelixAdmin extends ZkUnitTestBase {
.getListField(InstanceConfig.InstanceConfigProperty.HELIX_DISABLED_PARTITION.name()).size(),
2);
}
+
+ @Test
+ public void testAddCustomizedStateAggregationConfig() {
+ String className = TestHelper.getTestClassName();
+ String methodName = TestHelper.getTestMethodName();
+ String clusterName = className + "_" + methodName;
+
+ HelixAdmin admin = new ZKHelixAdmin(_gZkClient);
+ admin.addCluster(clusterName, true);
+ CustomizedStateAggregationConfig.Builder builder =
+ new CustomizedStateAggregationConfig.Builder();
+ builder.addAggregationEnabledType("mockType1");
+ CustomizedStateAggregationConfig customizedStateAggregationConfig = builder.build();
+
+ admin.addCustomizedStateAggregationConfig(clusterName, customizedStateAggregationConfig);
+
+ // Read CustomizedStateAggregationConfig from Zookeeper and check the content
+ ConfigAccessor _configAccessor = new ConfigAccessor(_gZkClient);
+ CustomizedStateAggregationConfig configFromZk =
+ _configAccessor.getCustomizedStateAggregationConfig(clusterName);
+ List<String> listTypesFromZk = configFromZk.getAggregationEnabledTypes();
+ Assert.assertEquals(listTypesFromZk.get(0), "mockType1");
+ }
+
+ @Test
+ public void testRemoveCustomizedStateAggregationConfig() throws Exception {
+ String className = TestHelper.getTestClassName();
+ String methodName = TestHelper.getTestMethodName();
+ String clusterName = className + "_" + methodName;
+
+ HelixAdmin admin = new ZKHelixAdmin(_gZkClient);
+ admin.addCluster(clusterName, true);
+ CustomizedStateAggregationConfig.Builder builder =
+ new CustomizedStateAggregationConfig.Builder();
+ builder.addAggregationEnabledType("mockType1");
+ CustomizedStateAggregationConfig customizedStateAggregationConfig = builder.build();
+
+ admin.addCustomizedStateAggregationConfig(clusterName, customizedStateAggregationConfig);
+
+ // Read CustomizedStateAggregationConfig from Zookeeper and check the content
+ ConfigAccessor _configAccessor = new ConfigAccessor(_gZkClient);
+ CustomizedStateAggregationConfig configFromZk =
+ _configAccessor.getCustomizedStateAggregationConfig(clusterName);
+ List<String> listTypesFromZk = configFromZk.getAggregationEnabledTypes();
+ Assert.assertEquals(listTypesFromZk.get(0), "mockType1");
+
+ // Remove CustomizedStateAggregationConfig Config and make sure it has been removed from
+ // Zookeeper
+ admin.removeCustomizedStateAggregationConfig(clusterName);
+ configFromZk = _configAccessor.getCustomizedStateAggregationConfig(clusterName);
+ Assert.assertNull(configFromZk);
+ }
+
+ @Test
+ public void testUpdateCustomizedStateAggregationConfig() throws Exception {
+ String className = TestHelper.getTestClassName();
+ String methodName = TestHelper.getTestMethodName();
+ String clusterName = className + "_" + methodName;
+
+ HelixAdmin admin = new ZKHelixAdmin(_gZkClient);
+ admin.addCluster(clusterName, true);
+ CustomizedStateAggregationConfig.Builder builder =
+ new CustomizedStateAggregationConfig.Builder();
+ builder.addAggregationEnabledType("mockType1");
+ CustomizedStateAggregationConfig customizedStateAggregationConfig = builder.build();
+
+ admin.addCustomizedStateAggregationConfig(clusterName, customizedStateAggregationConfig);
+
+ // Read CustomizedStateAggregationConfig from Zookeeper and check the content
+ ConfigAccessor _configAccessor = new ConfigAccessor(_gZkClient);
+ CustomizedStateAggregationConfig configFromZk =
+ _configAccessor.getCustomizedStateAggregationConfig(clusterName);
+ List<String> listTypesFromZk = configFromZk.getAggregationEnabledTypes();
+ Assert.assertEquals(listTypesFromZk.get(0), "mockType1");
+
+ admin.addTypeToCustomizedStateAggregationConfig(clusterName, "mockType2");
+ admin.addTypeToCustomizedStateAggregationConfig(clusterName, "mockType3");
+ configFromZk =
+ _configAccessor.getCustomizedStateAggregationConfig(clusterName);
+ listTypesFromZk = configFromZk.getAggregationEnabledTypes();
+ Assert.assertEquals(listTypesFromZk.get(0), "mockType1");
+ Assert.assertEquals(listTypesFromZk.get(1), "mockType2");
+ Assert.assertEquals(listTypesFromZk.get(2), "mockType3");
+
+ admin.removeTypeFromCustomizedStateAggregationConfig(clusterName, "mockType1");
+ configFromZk =
+ _configAccessor.getCustomizedStateAggregationConfig(clusterName);
+ listTypesFromZk = configFromZk.getAggregationEnabledTypes();
+ Assert.assertEquals(listTypesFromZk.get(0), "mockType2");
+ Assert.assertEquals(listTypesFromZk.get(1), "mockType3");
+ }
+
}
diff --git a/helix-core/src/test/java/org/apache/helix/mock/MockHelixAdmin.java b/helix-core/src/test/java/org/apache/helix/mock/MockHelixAdmin.java
index b299ab1..82c8459 100644
--- a/helix-core/src/test/java/org/apache/helix/mock/MockHelixAdmin.java
+++ b/helix-core/src/test/java/org/apache/helix/mock/MockHelixAdmin.java
@@ -34,6 +34,7 @@ import org.apache.helix.ZNRecord;
import org.apache.helix.model.ClusterConfig;
import org.apache.helix.model.ClusterConstraints;
import org.apache.helix.model.ConstraintItem;
+import org.apache.helix.model.CustomizedStateAggregationConfig;
import org.apache.helix.model.ExternalView;
import org.apache.helix.model.HelixConfigScope;
import org.apache.helix.model.IdealState;
@@ -141,6 +142,27 @@ public class MockHelixAdmin implements HelixAdmin {
}
+ @Override
+ public void addCustomizedStateAggregationConfig(String clusterName,
+ CustomizedStateAggregationConfig customizedStateAggregationConfig) {
+
+ }
+
+ @Override
+ public void removeCustomizedStateAggregationConfig(String clusterName) {
+
+ }
+
+ @Override
+ public void addTypeToCustomizedStateAggregationConfig(String clusterName, String type) {
+
+ }
+
+ @Override
+ public void removeTypeFromCustomizedStateAggregationConfig(String clusterName, String type) {
+
+ }
+
@Override public void addResource(String clusterName, String resourceName, int numPartitions,
String stateModelRef) {
diff --git a/helix-core/src/test/java/org/apache/helix/model/TestCustomizedStateAggregationConfig.java b/helix-core/src/test/java/org/apache/helix/model/TestCustomizedStateAggregationConfig.java
index 5cdc333..2b9752a 100644
--- a/helix-core/src/test/java/org/apache/helix/model/TestCustomizedStateAggregationConfig.java
+++ b/helix-core/src/test/java/org/apache/helix/model/TestCustomizedStateAggregationConfig.java
@@ -62,12 +62,14 @@ public class TestCustomizedStateAggregationConfig extends ZkUnitTestBase {
TestHelper.setupEmptyCluster(_gZkClient, clusterName);
// Create dummy CustomizedStateAggregationConfig object
- CustomizedStateAggregationConfig customizedStateAggregationConfig =
- new CustomizedStateAggregationConfig(clusterName);
+ CustomizedStateAggregationConfig.Builder customizedStateAggregationConfigBuilder =
+ new CustomizedStateAggregationConfig.Builder();
List<String> aggregationEnabledTypes = new ArrayList<String>();
- aggregationEnabledTypes.add("mockState1");
- aggregationEnabledTypes.add("mockState2");
- customizedStateAggregationConfig.setAggregationEnabledTypes(aggregationEnabledTypes);
+ aggregationEnabledTypes.add("mockType1");
+ aggregationEnabledTypes.add("mockType2");
+ customizedStateAggregationConfigBuilder.setAggregationEnabledTypes(aggregationEnabledTypes);
+ CustomizedStateAggregationConfig customizedStateAggregationConfig =
+ customizedStateAggregationConfigBuilder.build();
// Write the CustomizedStateAggregationConfig to Zookeeper
ZKHelixDataAccessor accessor =
@@ -92,12 +94,11 @@ public class TestCustomizedStateAggregationConfig extends ZkUnitTestBase {
String clusterName = "CLUSTER_" + className;
TestHelper.setupEmptyCluster(_gZkClient, clusterName);
CustomizedStateAggregationConfig.Builder builder =
- new CustomizedStateAggregationConfig.Builder(clusterName);
+ new CustomizedStateAggregationConfig.Builder();
builder.addAggregationEnabledType("mockType1");
builder.addAggregationEnabledType("mockType2");
// Check builder getter methods
- Assert.assertEquals(builder.getClusterName(), clusterName);
List<String> aggregationEnabledTypes = builder.getAggregationEnabledTypes();
Assert.assertEquals(aggregationEnabledTypes.size(), 2);
Assert.assertEquals(aggregationEnabledTypes.get(0), "mockType1");