Open kesihai opened 4 years ago
@fpj , I think there is a bug, and it should be the workerName, not the path in getAbsentWorkerTasks(path)
ChildrenCallback workerAssignmentCallback = new ChildrenCallback() { public void processResult(int rc, String path, Object ctx, List<String> children){ switch (Code.get(rc)) { case CONNECTIONLOSS: getAbsentWorkerTasks(path); // Here should be path.subString(path.lastIndexOf('/') + 1, path.length()); break; case OK: LOG.info("Succesfully got a list of assignments: " + children.size() + " tasks"); /* * Reassign the tasks of the absent worker. */ for(String task: children) { getDataReassign(path + "/" + task, task); } break; default: LOG.error("getChildren failed", KeeperException.create(Code.get(rc), path)); } } };
https://github.com/fpj/zookeeper-book-example/blob/135b79b472fd2c45b82d78a3653532eecd69b6fe/src/main/java/org/apache/zookeeper/book/Master.java#L491
@fpj , I think there is a bug, and it should be the workerName, not the path in getAbsentWorkerTasks(path)
https://github.com/fpj/zookeeper-book-example/blob/135b79b472fd2c45b82d78a3653532eecd69b6fe/src/main/java/org/apache/zookeeper/book/Master.java#L491