Package com.yahoo.vespa.curator.mock
Class MockCuratorFramework
- java.lang.Object
-
- com.yahoo.vespa.curator.mock.MockCuratorFramework
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.curator.framework.CuratorFramework
public class MockCuratorFramework extends Object implements org.apache.curator.framework.CuratorFramework
A mock implementation ofCuratorFramework
for testing purposes.- Author:
- mpolden
-
-
Constructor Summary
Constructors Constructor Description MockCuratorFramework(boolean stableOrdering, boolean shouldTimeoutOnEnter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<String,com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter>
atomicCounters()
void
blockUntilConnected()
boolean
blockUntilConnected(int i, TimeUnit timeUnit)
org.apache.curator.framework.api.ExistsBuilder
checkExists()
void
clearWatcherReferences(org.apache.zookeeper.Watcher watcher)
void
close()
org.apache.curator.framework.api.CreateBuilder
create()
com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter
createAtomicCounter(String path)
Curator.CompletionWaiter
createCompletionWaiter()
void
createContainers(String s)
Curator.DirectoryCache
createDirectoryCache(String path)
Curator.FileCache
createFileCache(String path)
org.apache.curator.framework.recipes.locks.InterProcessLock
createMutex(String path)
org.apache.curator.framework.api.DeleteBuilder
delete()
com.yahoo.vespa.curator.mock.MemoryFileSystem
fileSystem()
org.apache.curator.framework.api.GetACLBuilder
getACL()
org.apache.curator.framework.api.GetChildrenBuilder
getChildren()
org.apache.curator.framework.api.GetConfigBuilder
getConfig()
org.apache.curator.framework.state.ConnectionStateErrorPolicy
getConnectionStateErrorPolicy()
org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.state.ConnectionStateListener>
getConnectionStateListenable()
org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.CuratorListener>
getCuratorListenable()
org.apache.zookeeper.server.quorum.flexible.QuorumVerifier
getCurrentConfig()
org.apache.curator.framework.api.GetDataBuilder
getData()
String
getNamespace()
org.apache.curator.framework.schema.SchemaSet
getSchemaSet()
org.apache.curator.framework.imps.CuratorFrameworkState
getState()
org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.UnhandledErrorListener>
getUnhandledErrorListenable()
org.apache.curator.CuratorZookeeperClient
getZookeeperClient()
org.apache.curator.framework.api.transaction.CuratorTransaction
inTransaction()
boolean
isStarted()
Deprecated.org.apache.curator.utils.EnsurePath
newNamespaceAwareEnsurePath(String path)
Deprecated.org.apache.curator.framework.WatcherRemoveCuratorFramework
newWatcherRemoveCuratorFramework()
org.apache.curator.framework.CuratorFramework
nonNamespaceView()
Deprecated.CompletableFuture<Void>
postSafeNotify(Object monitorHolder)
org.apache.curator.framework.api.ReconfigBuilder
reconfig()
CompletableFuture<Void>
runSafe(Runnable runnable)
org.apache.curator.framework.api.SetACLBuilder
setACL()
org.apache.curator.framework.api.SetDataBuilder
setData()
void
start()
org.apache.curator.framework.api.SyncBuilder
sync()
void
sync(String path, Object backgroundContextObject)
Deprecated.org.apache.curator.framework.api.transaction.CuratorMultiTransaction
transaction()
org.apache.curator.framework.api.transaction.TransactionOp
transactionOp()
org.apache.curator.framework.CuratorFramework
usingNamespace(String newNamespace)
static String
validatePath(String path)
Validates a path using the same rules as ZooKeeperorg.apache.curator.framework.api.WatchesBuilder
watchers()
org.apache.curator.framework.api.RemoveWatchesBuilder
watches()
-
-
-
Method Detail
-
atomicCounters
public Map<String,com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter> atomicCounters()
-
fileSystem
public com.yahoo.vespa.curator.mock.MemoryFileSystem fileSystem()
-
start
public void start()
- Specified by:
start
in interfaceorg.apache.curator.framework.CuratorFramework
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.curator.framework.CuratorFramework
-
getState
public org.apache.curator.framework.imps.CuratorFrameworkState getState()
- Specified by:
getState
in interfaceorg.apache.curator.framework.CuratorFramework
-
isStarted
@Deprecated public boolean isStarted()
Deprecated.- Specified by:
isStarted
in interfaceorg.apache.curator.framework.CuratorFramework
-
create
public org.apache.curator.framework.api.CreateBuilder create()
- Specified by:
create
in interfaceorg.apache.curator.framework.CuratorFramework
-
delete
public org.apache.curator.framework.api.DeleteBuilder delete()
- Specified by:
delete
in interfaceorg.apache.curator.framework.CuratorFramework
-
checkExists
public org.apache.curator.framework.api.ExistsBuilder checkExists()
- Specified by:
checkExists
in interfaceorg.apache.curator.framework.CuratorFramework
-
getData
public org.apache.curator.framework.api.GetDataBuilder getData()
- Specified by:
getData
in interfaceorg.apache.curator.framework.CuratorFramework
-
setData
public org.apache.curator.framework.api.SetDataBuilder setData()
- Specified by:
setData
in interfaceorg.apache.curator.framework.CuratorFramework
-
getChildren
public org.apache.curator.framework.api.GetChildrenBuilder getChildren()
- Specified by:
getChildren
in interfaceorg.apache.curator.framework.CuratorFramework
-
getACL
public org.apache.curator.framework.api.GetACLBuilder getACL()
- Specified by:
getACL
in interfaceorg.apache.curator.framework.CuratorFramework
-
setACL
public org.apache.curator.framework.api.SetACLBuilder setACL()
- Specified by:
setACL
in interfaceorg.apache.curator.framework.CuratorFramework
-
reconfig
public org.apache.curator.framework.api.ReconfigBuilder reconfig()
- Specified by:
reconfig
in interfaceorg.apache.curator.framework.CuratorFramework
-
getConfig
public org.apache.curator.framework.api.GetConfigBuilder getConfig()
- Specified by:
getConfig
in interfaceorg.apache.curator.framework.CuratorFramework
-
inTransaction
public org.apache.curator.framework.api.transaction.CuratorTransaction inTransaction()
- Specified by:
inTransaction
in interfaceorg.apache.curator.framework.CuratorFramework
-
transaction
public org.apache.curator.framework.api.transaction.CuratorMultiTransaction transaction()
- Specified by:
transaction
in interfaceorg.apache.curator.framework.CuratorFramework
-
transactionOp
public org.apache.curator.framework.api.transaction.TransactionOp transactionOp()
- Specified by:
transactionOp
in interfaceorg.apache.curator.framework.CuratorFramework
-
watches
public org.apache.curator.framework.api.RemoveWatchesBuilder watches()
- Specified by:
watches
in interfaceorg.apache.curator.framework.CuratorFramework
-
watchers
public org.apache.curator.framework.api.WatchesBuilder watchers()
- Specified by:
watchers
in interfaceorg.apache.curator.framework.CuratorFramework
-
newWatcherRemoveCuratorFramework
public org.apache.curator.framework.WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework()
- Specified by:
newWatcherRemoveCuratorFramework
in interfaceorg.apache.curator.framework.CuratorFramework
-
getConnectionStateErrorPolicy
public org.apache.curator.framework.state.ConnectionStateErrorPolicy getConnectionStateErrorPolicy()
- Specified by:
getConnectionStateErrorPolicy
in interfaceorg.apache.curator.framework.CuratorFramework
-
getCurrentConfig
public org.apache.zookeeper.server.quorum.flexible.QuorumVerifier getCurrentConfig()
- Specified by:
getCurrentConfig
in interfaceorg.apache.curator.framework.CuratorFramework
-
getSchemaSet
public org.apache.curator.framework.schema.SchemaSet getSchemaSet()
- Specified by:
getSchemaSet
in interfaceorg.apache.curator.framework.CuratorFramework
-
postSafeNotify
public CompletableFuture<Void> postSafeNotify(Object monitorHolder)
- Specified by:
postSafeNotify
in interfaceorg.apache.curator.framework.CuratorFramework
-
runSafe
public CompletableFuture<Void> runSafe(Runnable runnable)
- Specified by:
runSafe
in interfaceorg.apache.curator.framework.CuratorFramework
-
sync
@Deprecated public void sync(String path, Object backgroundContextObject)
Deprecated.- Specified by:
sync
in interfaceorg.apache.curator.framework.CuratorFramework
-
createContainers
public void createContainers(String s)
- Specified by:
createContainers
in interfaceorg.apache.curator.framework.CuratorFramework
-
getConnectionStateListenable
public org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.state.ConnectionStateListener> getConnectionStateListenable()
- Specified by:
getConnectionStateListenable
in interfaceorg.apache.curator.framework.CuratorFramework
-
getCuratorListenable
public org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.CuratorListener> getCuratorListenable()
- Specified by:
getCuratorListenable
in interfaceorg.apache.curator.framework.CuratorFramework
-
getUnhandledErrorListenable
public org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.UnhandledErrorListener> getUnhandledErrorListenable()
- Specified by:
getUnhandledErrorListenable
in interfaceorg.apache.curator.framework.CuratorFramework
-
nonNamespaceView
@Deprecated public org.apache.curator.framework.CuratorFramework nonNamespaceView()
Deprecated.- Specified by:
nonNamespaceView
in interfaceorg.apache.curator.framework.CuratorFramework
-
usingNamespace
public org.apache.curator.framework.CuratorFramework usingNamespace(String newNamespace)
- Specified by:
usingNamespace
in interfaceorg.apache.curator.framework.CuratorFramework
-
getNamespace
public String getNamespace()
- Specified by:
getNamespace
in interfaceorg.apache.curator.framework.CuratorFramework
-
getZookeeperClient
public org.apache.curator.CuratorZookeeperClient getZookeeperClient()
- Specified by:
getZookeeperClient
in interfaceorg.apache.curator.framework.CuratorFramework
-
newNamespaceAwareEnsurePath
@Deprecated public org.apache.curator.utils.EnsurePath newNamespaceAwareEnsurePath(String path)
Deprecated.- Specified by:
newNamespaceAwareEnsurePath
in interfaceorg.apache.curator.framework.CuratorFramework
-
clearWatcherReferences
public void clearWatcherReferences(org.apache.zookeeper.Watcher watcher)
- Specified by:
clearWatcherReferences
in interfaceorg.apache.curator.framework.CuratorFramework
-
blockUntilConnected
public boolean blockUntilConnected(int i, TimeUnit timeUnit)
- Specified by:
blockUntilConnected
in interfaceorg.apache.curator.framework.CuratorFramework
-
blockUntilConnected
public void blockUntilConnected()
- Specified by:
blockUntilConnected
in interfaceorg.apache.curator.framework.CuratorFramework
-
sync
public org.apache.curator.framework.api.SyncBuilder sync()
- Specified by:
sync
in interfaceorg.apache.curator.framework.CuratorFramework
-
createMutex
public org.apache.curator.framework.recipes.locks.InterProcessLock createMutex(String path)
-
createAtomicCounter
public com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter createAtomicCounter(String path)
-
createCompletionWaiter
public Curator.CompletionWaiter createCompletionWaiter()
-
createDirectoryCache
public Curator.DirectoryCache createDirectoryCache(String path)
-
createFileCache
public Curator.FileCache createFileCache(String path)
-
validatePath
public static String validatePath(String path) throws IllegalArgumentException
Validates a path using the same rules as ZooKeeper- Throws:
IllegalArgumentException
-
-