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 of
CuratorFramework
for testing purposes.- Author:
- mpolden
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
blockUntilConnected
(int i, TimeUnit timeUnit) org.apache.curator.framework.api.ExistsBuilder
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) void
createDirectoryCache
(String path) 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
org.apache.curator.framework.api.GetACLBuilder
getACL()
org.apache.curator.framework.api.GetChildrenBuilder
org.apache.curator.framework.api.GetConfigBuilder
org.apache.curator.framework.state.ConnectionStateErrorPolicy
org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.state.ConnectionStateListener>
org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.CuratorListener>
org.apache.zookeeper.server.quorum.flexible.QuorumVerifier
org.apache.curator.framework.api.GetDataBuilder
getData()
org.apache.curator.framework.schema.SchemaSet
org.apache.curator.framework.imps.CuratorFrameworkState
getState()
org.apache.curator.framework.listen.Listenable<org.apache.curator.framework.api.UnhandledErrorListener>
org.apache.curator.CuratorZookeeperClient
org.apache.curator.framework.api.transaction.CuratorTransaction
boolean
Deprecated.org.apache.curator.utils.EnsurePath
Deprecated.org.apache.curator.framework.WatcherRemoveCuratorFramework
org.apache.curator.framework.CuratorFramework
Deprecated.postSafeNotify
(Object monitorHolder) org.apache.curator.framework.api.ReconfigBuilder
reconfig()
org.apache.curator.framework.api.SetACLBuilder
setACL()
org.apache.curator.framework.api.SetDataBuilder
setData()
void
start()
org.apache.curator.framework.api.SyncBuilder
sync()
void
Deprecated.org.apache.curator.framework.api.transaction.CuratorMultiTransaction
org.apache.curator.framework.api.transaction.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()
-
Constructor Details
-
MockCuratorFramework
public MockCuratorFramework(boolean stableOrdering, boolean shouldTimeoutOnEnter)
-
-
Method Details
-
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.- 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
- Specified by:
postSafeNotify
in interfaceorg.apache.curator.framework.CuratorFramework
-
runSafe
- Specified by:
runSafe
in interfaceorg.apache.curator.framework.CuratorFramework
-
sync
Deprecated.- Specified by:
sync
in interfaceorg.apache.curator.framework.CuratorFramework
-
createContainers
- 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.- Specified by:
nonNamespaceView
in interfaceorg.apache.curator.framework.CuratorFramework
-
usingNamespace
- Specified by:
usingNamespace
in interfaceorg.apache.curator.framework.CuratorFramework
-
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.- 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
- 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
-
createAtomicCounter
public com.yahoo.vespa.curator.mock.MockCuratorFramework.MockAtomicCounter createAtomicCounter(String path) -
createCompletionWaiter
-
createDirectoryCache
-
createFileCache
-
validatePath
Validates a path using the same rules as ZooKeeper- Throws:
IllegalArgumentException
-