diff options
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.java | 114 |
1 files changed, 38 insertions, 76 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 2f4351b7954..f5848a07109 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,7 +14,6 @@ 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; @@ -26,8 +25,6 @@ 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; @@ -42,7 +39,6 @@ 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; @@ -98,7 +94,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 @@ -637,6 +633,30 @@ 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"); } @@ -704,71 +724,37 @@ 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 ErrorListenerPathable<T> inBackground() { + public Pathable<T> inBackground() { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @Override - public ErrorListenerPathable<T> inBackground(Object o) { + public Pathable<T> inBackground(Object o) { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @Override - public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback) { + public Pathable<T> inBackground(BackgroundCallback backgroundCallback) { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @Override - public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback, Object o) { + public Pathable<T> inBackground(BackgroundCallback backgroundCallback, Object o) { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @Override - public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback, Executor executor) { + public Pathable<T> inBackground(BackgroundCallback backgroundCallback, Executor executor) { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @Override - public ErrorListenerPathable<T> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) { - throw new UnsupportedOperationException("Not implemented in MockCurator"); - } - - @Override - public T forPath(String s) throws Exception { + public Pathable<T> inBackground(BackgroundCallback backgroundCallback, Object o, Executor executor) { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @@ -786,6 +772,11 @@ public class MockCurator extends Curator { public BackgroundPathable<T> usingWatcher(CuratorWatcher curatorWatcher) { throw new UnsupportedOperationException("Not implemented in MockCurator"); } + + public T forPath(String path) throws Exception { + throw new UnsupportedOperationException("Not implemented in MockCurator"); + } + } private class MockGetChildrenBuilder extends MockBackgroundPathableBuilder<List<String>> implements GetChildrenBuilder { @@ -886,35 +877,6 @@ 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 */ @@ -993,7 +955,7 @@ public class MockCurator extends Curator { } @Override - public ACLCreateModePathAndBytesable<CuratorTransactionBridge> compressed() { + public ACLPathAndBytesable<CuratorTransactionBridge> compressed() { throw new UnsupportedOperationException("Not implemented in MockCurator"); } @@ -1035,7 +997,7 @@ public class MockCurator extends Curator { private class MockTransactionSetDataBuilder implements TransactionSetDataBuilder { @Override - public VersionPathAndBytesable<CuratorTransactionBridge> compressed() { + public PathAndBytesable<CuratorTransactionBridge> compressed() { throw new UnsupportedOperationException("Not implemented in MockCurator"); } |