Remove unneeded ZK operations for setting watches
@@ -138,23 +138,6 @@ public class ZKMetadataStore extends AbstractMetadataStore implements MetadataSt
if (code == Code.OK) {
future.complete(Optional.of(new GetResult(data, getStat(path1, stat))));
} else if (code == Code.NONODE) {
- // Place a watch on the non-existing node, so we'll get notified
- // when it gets created and we can invalidate the negative cache.
- existsFromStore(path).thenAccept(exists -> {
- if (exists) {
- get(path).thenAccept(c -> future.complete(c))
- .exceptionally(ex -> {
- future.completeExceptionally(ex);
- return null;
- });
- } else {
- // Z-node does not exist
- future.complete(Optional.empty());
- }
- }).exceptionally(ex -> {
- future.completeExceptionally(ex);
- return null;
- });
future.complete(Optional.empty());
} else {
future.completeExceptionally(getException(code, path));
@@ -180,25 +163,8 @@ public class ZKMetadataStore extends AbstractMetadataStore implements MetadataSt
Collections.sort(children);
future.complete(children);
} else if (code == Code.NONODE) {
- // The node we want may not exist yet, so put a watcher on its existence
- // before throwing up the exception. Its possible that the node could have
- // been created after the call to getChildren, but before the call to exists().
- // If this is the case, exists will return true, and we just call getChildren
- // again.
- existsFromStore(path).thenAccept(exists -> {
- if (exists) {
- getChildrenFromStore(path).thenAccept(c -> future.complete(c)).exceptionally(ex -> {
- future.completeExceptionally(ex);
- return null;
- });
- } else {
// Z-node does not exist
future.complete(Collections.emptyList());
- }
- }).exceptionally(ex -> {
- future.completeExceptionally(ex);
- return null;
- });
} else {
future.completeExceptionally(getException(code, path));
}
