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 TypeMethodDescriptionvoid
Block until a connection to ZooKeeper is available.boolean
blockUntilConnected
(int maxWaitTime, TimeUnit units) Block until a connection to ZooKeeper is available or the maxWaitTime has been exceededvoid
clearWatcherReferences
(org.apache.zookeeper.Watcher watcher) Curator can hold internal references to watchers that may inhibit garbage collection.void
close()
Stop the clientboolean
Return 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.QuorumVerifier
Current 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 compatibilityboolean
Deprecated.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.void
start()
Start the client.usingNamespace
(String newNamespace) Returns a facade of the current instance that uses the specified namespace or no namespace ifnewNamespace
isnull
.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, watches
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.curator.framework.CuratorFramework
postSafeNotify
-
Field Details
-
debugUnhandledErrorListener
-
-
Constructor Details
-
CuratorFrameworkImpl
-
-
Method Details
-
runSafe
Description copied from interface:CuratorFramework
Curator (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:CuratorFramework
Current 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:CuratorFramework
Curator 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
-
getState
Description copied from interface:CuratorFramework
Returns the state of this instance- Returns:
- state
-
isStarted
Deprecated.Description copied from interface:CuratorFramework
Return true if the client is started, not closed, etc.- Returns:
- true/false
-
blockUntilConnected
Description copied from interface:CuratorFramework
Block until a connection to ZooKeeper is available or the maxWaitTime has been exceeded- Parameters:
maxWaitTime
- The maximum wait time. 1.value <= 0
andunits != null
to return immediately; 2.value <= 0
andunits == null
to 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:CuratorFramework
Block 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:CuratorFramework
Return the configured error policy- Returns:
- error policy
-
start
public void start()Description copied from interface:CuratorFramework
Start the client. Most mutator methods will not work until the client is started -
close
public void close()Description copied from interface:CuratorFramework
Stop the client -
usingNamespace
Description copied from interface:CuratorFramework
Returns a facade of the current instance that uses the specified namespace or no namespace ifnewNamespace
isnull
.- Parameters:
newNamespace
- the new namespace or null for none- Returns:
- facade
-
getConnectionStateListenable
Description copied from interface:CuratorFramework
Returns the listenable interface for the Connect State- Returns:
- listenable
-
getCuratorListenable
Description copied from interface:CuratorFramework
Returns the listenable interface for events- Returns:
- listenable
-
getUnhandledErrorListenable
Description copied from interface:CuratorFramework
Returns the listenable interface for unhandled errors- Returns:
- listenable
-
getZookeeperClient
Description copied from interface:CuratorFramework
Return the managed zookeeper client- Returns:
- client
-
getZookeeperCompatibility
Description copied from interface:CuratorFramework
Return zookeeper server compatibility- Returns:
- compatibility
-
newNamespaceAwareEnsurePath
Description copied from interface:CuratorFramework
Allocates an ensure path instance that is namespace aware- Specified by:
newNamespaceAwareEnsurePath
in interfaceCuratorFramework
- Overrides:
newNamespaceAwareEnsurePath
in classCuratorFrameworkBase
- Parameters:
path
- path to ensure- Returns:
- new EnsurePath instance
-
getSchemaSet
Description copied from interface:CuratorFramework
Return this instance's schema set- Returns:
- schema set
-
compressionEnabled
public boolean compressionEnabled()Description copied from interface:CuratorFramework
Return whether compression is enabled by default for all create, setData and getData operations.- Returns:
- if compression is enabled
-