when we start a newCluster, we must define the number of Tasks, and i
notice that in TaskSetup.class:
public void setup(String cluster, int tasks, int initialPort) {
try {
zkclient.createPersistent("/s4/streams", true);
} catch (ZkException ignored) {
// ignore if exists
}
zkclient.createPersistent("/s4/clusters/" + cluster + "/tasks", true);
zkclient.createPersistent("/s4/clusters/" + cluster + "/process", true);
zkclient.createPersistent("/s4/clusters/" + cluster + "/app", true);
for (int i = 0; i < tasks; i++) {
String taskId = "Task-" + i;
ZNRecord record = new ZNRecord(taskId);
record.putSimpleField("taskId", taskId);
record.putSimpleField("port", String.valueOf(initialPort + i));
record.putSimpleField("partition", String.valueOf(i));
record.putSimpleField("cluster", cluster);
zkclient.createPersistent("/s4/clusters/" + cluster + "/tasks/"
+ taskId, record);
}
}
so my question is:
if i want to change the nbTasks dynamically and then add the corresponding
S4Nodes , do i just need to write some codes in the TaskSetUp class? or i
have to change some other codes