List<String> toks = PathUtils.tokenize_path(path);
int size = toks.size();
if (size >= 1) {
String params = null;
String root = toks.get(0);
RunnableCallback fn = null;
if (root.equals(Cluster.ASSIGNMENTS_ROOT)) {
if (size == 1) {
// set null and get the old value
fn = assignments_callback.getAndSet(null);
} else {
params = toks.get(1);
fn = assignment_info_callback.remove(params);
}
} else if (root.equals(Cluster.SUPERVISORS_ROOT)) {
fn = supervisors_callback.getAndSet(null);
} else if (root.equals(Cluster.STORMS_ROOT) && size > 1) {
params = toks.get(1);
fn = storm_base_callback.remove(params);
} else if (root.equals(Cluster.MASTER_ROOT)) {
fn = master_callback.getAndSet(null);
} else {
LOG.error("Unknown callback for subtree " + path);
}
if (fn != null) {
// FIXME How to set the args
// fn.setArgs(params, zkEventTypes, path);
fn.run();
}
}
return null;
}