Class CuratorFrameworkImpl
java.lang.Object
org.apache.curator.framework.imps.CuratorFrameworkBase
org.apache.curator.framework.imps.CuratorFrameworkImpl
- All Implemented Interfaces:
Closeable,AutoCloseable,CuratorFramework
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidBlock until a connection to ZooKeeper is available.booleanblockUntilConnected(int maxWaitTime, TimeUnit units) Block until a connection to ZooKeeper is available or the maxWaitTime has been exceededvoidclearWatcherReferences(org.apache.zookeeper.Watcher watcher) Curator can hold internal references to watchers that may inhibit garbage collection.client()Return the underlying client which is the one constructed fromCuratorFrameworkFactory.voidclose()Stop the clientbooleanReturn whether compression is enabled by default for all create, setData and getData operations.Return the configured error policyReturns the listenable interface for the Connect StateReturns the listenable interface for eventsorg.apache.zookeeper.server.quorum.flexible.QuorumVerifierCurrent maintains a cached view of the Zookeeper quorum config.Return this instance's schema setgetState()Returns the state of this instanceReturns the listenable interface for unhandled errorsReturn the managed zookeeper clientReturn zookeeper server compatibilitybooleanDeprecated.Allocates an ensure path instance that is namespace awareCurator (and user) recipes can use this to run notifyAll and other blocking calls that might normally block ZooKeeper's event thread.voidstart()Start the client.usingNamespace(String newNamespace) Returns a facade of the current instance that uses the specified namespace or no namespace ifnewNamespaceisnull.Methods inherited from class org.apache.curator.framework.imps.CuratorFrameworkBase
checkExists, checkState, create, createContainers, delete, getACL, getChildren, getConfig, getData, getNamespace, internalSync, inTransaction, newWatcherRemoveCuratorFramework, nonNamespaceView, reconfig, setACL, setData, sync, sync, transaction, transactionOp, watchers, watchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.curator.framework.CuratorFramework
postSafeNotify
-
Field Details
-
debugUnhandledErrorListener
-
-
Constructor Details
-
CuratorFrameworkImpl
-
-
Method Details
-
runSafe
Description copied from interface:CuratorFrameworkCurator (and user) recipes can use this to run notifyAll and other blocking calls that might normally block ZooKeeper's event thread.- Parameters:
runnable- proc to call from a safe internal thread- Returns:
- a CompletableFuture that can be used to monitor when the call is complete
-
getCurrentConfig
public org.apache.zookeeper.server.quorum.flexible.QuorumVerifier getCurrentConfig()Description copied from interface:CuratorFrameworkCurrent maintains a cached view of the Zookeeper quorum config.- Returns:
- the current config
-
clearWatcherReferences
public void clearWatcherReferences(org.apache.zookeeper.Watcher watcher) Description copied from interface:CuratorFrameworkCurator can hold internal references to watchers that may inhibit garbage collection. Call this method on watchers you are no longer interested in.- Parameters:
watcher- the watcher
-
client
Description copied from class:CuratorFrameworkBaseReturn the underlying client which is the one constructed fromCuratorFrameworkFactory.- Specified by:
clientin classCuratorFrameworkBase
-
getState
Description copied from interface:CuratorFrameworkReturns the state of this instance- Returns:
- state
-
isStarted
Deprecated.Description copied from interface:CuratorFrameworkReturn true if the client is started, not closed, etc.- Returns:
- true/false
-
blockUntilConnected
Description copied from interface:CuratorFrameworkBlock until a connection to ZooKeeper is available or the maxWaitTime has been exceeded- Parameters:
maxWaitTime- The maximum wait time. 1.value <= 0andunits != nullto return immediately; 2.value <= 0andunits == nullto wait indefinitely, which is same asCuratorFramework.blockUntilConnected().units- The time units for the maximum wait time.- Returns:
- True if connection has been established, false otherwise.
- Throws:
InterruptedException- If interrupted while waiting
-
blockUntilConnected
Description copied from interface:CuratorFrameworkBlock until a connection to ZooKeeper is available. This method will not return until a connection is available, or it is interrupted, in which case an InterruptedException will be thrown- Throws:
InterruptedException- If interrupted while waiting
-
getConnectionStateErrorPolicy
Description copied from interface:CuratorFrameworkReturn the configured error policy- Returns:
- error policy
-
start
public void start()Description copied from interface:CuratorFrameworkStart the client. Most mutator methods will not work until the client is started -
close
public void close()Description copied from interface:CuratorFrameworkStop the client -
usingNamespace
Description copied from interface:CuratorFrameworkReturns a facade of the current instance that uses the specified namespace or no namespace ifnewNamespaceisnull.- Parameters:
newNamespace- the new namespace or null for none- Returns:
- facade
-
getConnectionStateListenable
Description copied from interface:CuratorFrameworkReturns the listenable interface for the Connect State- Returns:
- listenable
-
getCuratorListenable
Description copied from interface:CuratorFrameworkReturns the listenable interface for events- Returns:
- listenable
-
getUnhandledErrorListenable
Description copied from interface:CuratorFrameworkReturns the listenable interface for unhandled errors- Returns:
- listenable
-
getZookeeperClient
Description copied from interface:CuratorFrameworkReturn the managed zookeeper client- Returns:
- client
-
getZookeeperCompatibility
Description copied from interface:CuratorFrameworkReturn zookeeper server compatibility- Returns:
- compatibility
-
newNamespaceAwareEnsurePath
Description copied from interface:CuratorFrameworkAllocates an ensure path instance that is namespace aware- Specified by:
newNamespaceAwareEnsurePathin interfaceCuratorFramework- Overrides:
newNamespaceAwareEnsurePathin classCuratorFrameworkBase- Parameters:
path- path to ensure- Returns:
- new EnsurePath instance
-
getSchemaSet
Description copied from interface:CuratorFrameworkReturn this instance's schema set- Returns:
- schema set
-
compressionEnabled
public boolean compressionEnabled()Description copied from interface:CuratorFrameworkReturn whether compression is enabled by default for all create, setData and getData operations.- Returns:
- if compression is enabled
-