Class CuratorFrameworkImpl

java.lang.Object
org.apache.curator.framework.imps.CuratorFrameworkBase
org.apache.curator.framework.imps.CuratorFrameworkImpl
All Implemented Interfaces:
Closeable, AutoCloseable, CuratorFramework

public final class CuratorFrameworkImpl extends CuratorFrameworkBase
  • Field Details

  • Constructor Details

  • Method Details

    • runSafe

      public CompletableFuture<Void> runSafe(Runnable runnable)
      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

      public CuratorFrameworkState getState()
      Description copied from interface: CuratorFramework
      Returns the state of this instance
      Returns:
      state
    • isStarted

      @Deprecated public boolean isStarted()
      Deprecated.
      Description copied from interface: CuratorFramework
      Return true if the client is started, not closed, etc.
      Returns:
      true/false
    • blockUntilConnected

      public boolean blockUntilConnected(int maxWaitTime, TimeUnit units) throws InterruptedException
      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 and units != null to return immediately; 2. value <= 0 and units == null to wait indefinitely, which is same as CuratorFramework.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

      public void blockUntilConnected() throws InterruptedException
      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

      public ConnectionStateErrorPolicy 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

      public CuratorFramework usingNamespace(String newNamespace)
      Description copied from interface: CuratorFramework
      Returns a facade of the current instance that uses the specified namespace or no namespace if newNamespace is null.
      Parameters:
      newNamespace - the new namespace or null for none
      Returns:
      facade
    • getConnectionStateListenable

      public Listenable<ConnectionStateListener> getConnectionStateListenable()
      Description copied from interface: CuratorFramework
      Returns the listenable interface for the Connect State
      Returns:
      listenable
    • getCuratorListenable

      public Listenable<CuratorListener> getCuratorListenable()
      Description copied from interface: CuratorFramework
      Returns the listenable interface for events
      Returns:
      listenable
    • getUnhandledErrorListenable

      public Listenable<UnhandledErrorListener> getUnhandledErrorListenable()
      Description copied from interface: CuratorFramework
      Returns the listenable interface for unhandled errors
      Returns:
      listenable
    • getZookeeperClient

      public CuratorZookeeperClient getZookeeperClient()
      Description copied from interface: CuratorFramework
      Return the managed zookeeper client
      Returns:
      client
    • getZookeeperCompatibility

      public ZookeeperCompatibility getZookeeperCompatibility()
      Description copied from interface: CuratorFramework
      Return zookeeper server compatibility
      Returns:
      compatibility
    • newNamespaceAwareEnsurePath

      public EnsurePath newNamespaceAwareEnsurePath(String path)
      Description copied from interface: CuratorFramework
      Allocates an ensure path instance that is namespace aware
      Specified by:
      newNamespaceAwareEnsurePath in interface CuratorFramework
      Overrides:
      newNamespaceAwareEnsurePath in class CuratorFrameworkBase
      Parameters:
      path - path to ensure
      Returns:
      new EnsurePath instance
    • getSchemaSet

      public SchemaSet 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