Commit 01da7f15 authored by tammam.alsoleman's avatar tammam.alsoleman

handle NodeChildrenChanged event

parent 75d1cc44
......@@ -26,6 +26,7 @@ import org.apache.zookeeper.*;
import java.io.File;
import java.io.IOException;
import java.util.List;
public class Autohealer implements Watcher {
......@@ -81,9 +82,13 @@ public class Autohealer implements Watcher {
}
}
break;
/**
* Add states code here to respond to the relevant events
*/
case NodeChildrenChanged:
// This event is triggered when workers are added or removed
if (event.getPath() != null && event.getPath().equals(AUTOHEALER_ZNODES_PATH)) {
System.out.println("Detected change in workers. Re-evaluating if new workers are needed...");
launchWorkersIfNecessary();
}
break;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment