Can I customize partition names when using Apache Helix?

71 views Asked by At

While playing with Apache Helix I noticed that it automatically generates partition names in following manner: ResourceName_0, ResourceName_1, ... ResourceName_N. It is a bit awkward to translate this back and forth to some real, existing resource names like queues in message broker.

I'm configuring cluster from Java like this, it is a snippet from rabbitmq-consumer-groups recipe.

ZkClient zkclient = new ZkClient(ZOOKEEPER_ADDRESS, ZkClient.DEFAULT_SESSION_TIMEOUT, ZkClient.DEFAULT_CONNECTION_TIMEOUT, new ZNRecordSerializer());
ZKHelixAdmin admin = new ZKHelixAdmin(zkclient);

// add cluster
admin.addCluster("ClusterName", true);

// add state model definition
admin.addStateModelDef("ClusterName", DEFAULT_STATE_MODEL, new StateModelDefinition(StateModelConfigGenerator.generateConfigForOnlineOffline()));

int partitions = 3;
admin.addResource("ClusterName", "ResourceName", partitions, DEFAULT_STATE_MODEL, IdealState.RebalanceMode.FULL_AUTO.toString());

int replicas = 1;
admin.rebalance("ClusterName", "ResourceName", replicas);

Can it be customized somehow?

0

There are 0 answers