aboutsummaryrefslogtreecommitdiffstats
path: root/zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-08-03 11:58:11 +0200
committerGitHub <noreply@github.com>2020-08-03 11:58:11 +0200
commitc3886cf930430ac5517bcb0ebbbbd3c54884a0d3 (patch)
treea2478bd2cf6652909f5d0b631e5ff12d92c7976b /zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java
parentcb7bacfafde63f3464e962d21b4619741ae7f942 (diff)
Revert "Revert "Reapply "Upgrade to Curator 2.13.0"""
Diffstat (limited to 'zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java')
-rw-r--r--zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java114
1 files changed, 76 insertions, 38 deletions
diff --git a/zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java b/zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java
index 8e4a4530493..3da7678c44e 100644
--- a/zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java
+++ b/zkfacade/src/main/java/com/yahoo/vespa/curator/mock/MockCurator.java
@@ -14,6 +14,7 @@ import org.apache.curator.CuratorZookeeperClient;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.api.ACLBackgroundPathAndBytesable;
import org.apache.curator.framework.api.ACLCreateModeBackgroundPathAndBytesable;
+import org.apache.curator.framework.api.ACLCreateModePathAndBytesable;
import org.apache.curator.framework.api.ACLPathAndBytesable;
import org.apache.curator.framework.api.BackgroundCallback;
import org.apache.curator.framework.api.BackgroundPathAndBytesable;
@@ -25,6 +26,8 @@ import org.apache.curator.framework.api.CreateBuilder;
import org.apache.curator.framework.api.CuratorListener;
import org.apache.curator.framework.api.CuratorWatcher;
import org.apache.curator.framework.api.DeleteBuilder;
+import org.apache.curator.framework.api.ErrorListenerPathAndBytesable;
+import org.apache.curator.framework.api.ErrorListenerPathable;
import org.apache.curator.framework.api.ExistsBuilder;
import org.apache.curator.framework.api.ExistsBuilderMain;
import org.apache.curator.framework.api.GetACLBuilder;
@@ -39,6 +42,7 @@ import org.apache.curator.framework.api.SetDataBackgroundVersionable;
import org.apache.curator.framework.api.SetDataBuilder;
import org.apache.curator.framework.api.SyncBuilder;
import org.apache.curator.framework.api.UnhandledErrorListener;
+import org.apache.curator.framework.api.VersionPathAndBytesable;
import org.apache.curator.framework.api.WatchPathable;
import org.apache.curator.framework.api.Watchable;
import org.apache.curator.framework.api.transaction.CuratorTransaction;
@@ -94,7 +98,7 @@ import static com.yahoo.vespa.curator.mock.MemoryFileSystem.Node;
* Due to the "fluent API" style of Curator managing to break JavaDoc at a fundamental level, there is no
* documentation on the contract of each method. The behavior here is deduced by observing what using code exists
* and peeking at the Curator code. It may be incorrect in some corner cases.</p>
- *
+ *
* <p>Contains some code from PathUtils in ZooKeeper, licensed under the Apache 2.0 license.</p>
*
* @author bratseth
@@ -636,30 +640,6 @@ public class MockCurator extends Curator {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
- public PathAndBytesable<T> inBackground() {
- throw new UnsupportedOperationException("Not implemented in MockCurator");
- }
-
- public PathAndBytesable<T> inBackground(Object o) {
- throw new UnsupportedOperationException("Not implemented in MockCurator");
- }
-
- public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback) {
- throw new UnsupportedOperationException("Not implemented in MockCurator");
- }
-
- public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback, Object o) {
- throw new UnsupportedOperationException("Not implemented in MockCurator");
- }
-
- public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback, Executor executor) {
- throw new UnsupportedOperationException("Not implemented in MockCurator");
- }
-
- public PathAndBytesable<T> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) {
- throw new UnsupportedOperationException("Not implemented in MockCurator");
- }
-
public ACLBackgroundPathAndBytesable<T> withMode(CreateMode createMode) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@@ -727,59 +707,88 @@ public class MockCurator extends Curator {
return createNode(s, bytes, createParents, createMode, fileSystem.root(), listeners);
}
+ @Override
+ public ErrorListenerPathAndBytesable<String> inBackground() {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<String> inBackground(Object o) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<String> inBackground(BackgroundCallback backgroundCallback) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<String> inBackground(BackgroundCallback backgroundCallback, Object o) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<String> inBackground(BackgroundCallback backgroundCallback, Executor executor) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<String> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
}
private class MockBackgroundPathableBuilder<T> implements BackgroundPathable<T>, Watchable<BackgroundPathable<T>> {
@Override
- public Pathable<T> inBackground() {
+ public ErrorListenerPathable<T> inBackground() {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public Pathable<T> inBackground(Object o) {
+ public ErrorListenerPathable<T> inBackground(Object o) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public Pathable<T> inBackground(BackgroundCallback backgroundCallback) {
+ public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public Pathable<T> inBackground(BackgroundCallback backgroundCallback, Object o) {
+ public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback, Object o) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public Pathable<T> inBackground(BackgroundCallback backgroundCallback, Executor executor) {
+ public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback, Executor executor) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public Pathable<T> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) {
+ public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public BackgroundPathable<T> watched() {
+ public T forPath(String s) throws Exception {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public BackgroundPathable<T> usingWatcher(Watcher watcher) {
+ public BackgroundPathable<T> watched() {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@Override
- public BackgroundPathable<T> usingWatcher(CuratorWatcher curatorWatcher) {
+ public BackgroundPathable<T> usingWatcher(Watcher watcher) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
- public T forPath(String path) throws Exception {
+ @Override
+ public BackgroundPathable<T> usingWatcher(CuratorWatcher curatorWatcher) {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
-
}
private class MockGetChildrenBuilder extends MockBackgroundPathableBuilder<List<String>> implements GetChildrenBuilder {
@@ -880,6 +889,35 @@ public class MockCurator extends Curator {
return null;
}
+ @Override
+ public ErrorListenerPathAndBytesable<Stat> inBackground() {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<Stat> inBackground(Object o) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<Stat> inBackground(BackgroundCallback backgroundCallback) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<Stat> inBackground(BackgroundCallback backgroundCallback, Object o) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<Stat> inBackground(BackgroundCallback backgroundCallback, Executor executor) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
+
+ @Override
+ public ErrorListenerPathAndBytesable<Stat> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) {
+ throw new UnsupportedOperationException("Not implemented in MockCurator");
+ }
}
/** Allows addition of directoryListeners which are never called */
@@ -958,7 +996,7 @@ public class MockCurator extends Curator {
}
@Override
- public ACLPathAndBytesable<CuratorTransactionBridge> compressed() {
+ public ACLCreateModePathAndBytesable<CuratorTransactionBridge> compressed() {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}
@@ -1000,7 +1038,7 @@ public class MockCurator extends Curator {
private class MockTransactionSetDataBuilder implements TransactionSetDataBuilder {
@Override
- public PathAndBytesable<CuratorTransactionBridge> compressed() {
+ public VersionPathAndBytesable<CuratorTransactionBridge> compressed() {
throw new UnsupportedOperationException("Not implemented in MockCurator");
}