himanshukandwal commented on code in PR #2735:
URL: https://github.com/apache/helix/pull/2735#discussion_r1488875270
##########
helix-core/src/test/java/org/apache/helix/TestHelper.java:
##########
@@ -278,16 +281,18 @@ public static void setupCluster(String clusterName,
String zkAddr, int startPort
public static void setupCluster(String clusterName, String zkAddr, int
startPort,
String participantNamePrefix, String resourceNamePrefix, int resourceNb,
int partitionNb,
int nodesNb, int replica, String stateModelDef, RebalanceMode mode,
boolean doRebalance) {
- HelixZkClient zkClient = SharedZkClientFactory.getInstance()
- .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr));
+ HelixZkClient zkClient = createZkClient(zkAddr);
try {
if (zkClient.exists("/" + clusterName)) {
LOG.warn("Cluster already exists:" + clusterName + ". Deleting it");
zkClient.deleteRecursively("/" + clusterName);
}
ClusterSetup setupTool = new ClusterSetup(zkAddr);
- setupTool.addCluster(clusterName, true);
+ List<BuiltInStateModelDefinitions> stateModelDefinitions =
Objects.isNull(stateModelDef)
+ ? (resourceNb == 0 ? Collections.emptyList() :
Arrays.asList(BuiltInStateModelDefinitions.values()))
+ : Arrays.asList(BuiltInStateModelDefinitions.valueOf(stateModelDef));
+ setupTool.addCluster(clusterName, stateModelDefinitions, false);
Review Comment:
Yes, updated the reasoning with a comment as well along here. This is needed
to avoid loading all the state-model defs and loading only the one which user
has explicitly specified. Otherwise, we will load all.
--
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]