trait AsynchronousZookeeper extends Zookeeper

A ZooKeeper client with asynchronous operations.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsynchronousZookeeper
  2. Zookeeper
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def async: AsynchronousZookeeper

    Returns a view of this client in which operations are performed asynchronously.

    Returns a view of this client in which operations are performed asynchronously.

    returns

    an asynchronous view of this client

    Definition Classes
    Zookeeper
  2. abstract def children(path: String): Future[(Seq[String], Status)]

    Asynchronously gets the children of the node specified by the given path.

    Asynchronously gets the children of the node specified by the given path.

    path

    the path of the node

    returns

    a future, which upon success, yields an unordered sequence containing the names of each child node, otherwise one of the following exceptions:

    • NoNodeException if the node does not exist
  3. abstract def close(): Unit

    Closes the client connection to the ZooKeeper cluster.

    Closes the client connection to the ZooKeeper cluster.

    A consequence of closing the connection is that ZooKeeper will expire the corresponding session, which further implies that all ephemeral nodes created by this client will be deleted.

    Definition Classes
    Zookeeper
  4. abstract def create(path: String, data: Array[Byte], acl: Seq[ACL], disp: Disposition): Future[String]

    Asynchronously creates a new node at the given path.

    Asynchronously creates a new node at the given path.

    If a sequential disposition is provided in disp, then path is appended with a monotonically increasing sequence, thus guaranteeing that all sequential nodes are unique with path as their prefix.

    path

    the path of the node to create

    data

    the data to associate with the node, which may be empty, but not null

    acl

    an access control list to apply to the node, which must not be empty

    disp

    the disposition of the node

    returns

    a future yielding the final path of the created node, which will differ from path if disp is either PersistentSequential, PersistentSequentialTimeToLive or EphemeralSequential

  5. abstract def delete(path: String, version: Option[Int]): Future[Unit]

    Asynchronously deletes the node specified by the given path.

    Asynchronously deletes the node specified by the given path.

    path

    the path of the node

    version

    a Some containing the expected version of the node or None if a version match is not required

    returns

    a future, which upon success, yields Unit, otherwise one of the following exceptions:

    • NoNodeException if the node does not exist
    • BadVersionException if version is specified and does not match the node version
    • NotEmptyException if the node contains children
  6. abstract def ensure(path: String): Future[Unit]

    Ensures that the value of a node, specified by the given path, is synchronized across the ZooKeeper cluster.

    Ensures that the value of a node, specified by the given path, is synchronized across the ZooKeeper cluster.

    An important note on consistency: ZooKeeper does not guarantee, for any given point in time, that all clients will have a consistent view of the cluster. Since reads can be served by any node in the cluster, whereas writes are serialized through the leader, there exists the possibility in which two separate clients may have inconsistent views. This scenario occurs when the leader commits a change once consensus is reached, but the change has not yet propagated across the cluster. Therefore, reads occurring before the commit has propagated will be globally inconsistent. This behavior is normally acceptable, but for some use cases, writes may need to be globally visible before subsequent reads occur.

    This method is particularly useful when a write occurring in one process is followed by a read in another process. For example, consider the following sequence of operations:

    • process A writes a value
    • process A sends a message to process B
    • process B reads the value

    The assumption is that process B expects to see the value written by process A, but as mentioned, ZooKeeper does not make this guarantee. A call to this method before process B attempts to read the value ensures that all prior writes are consistently applied across the cluster, thus observing the write in process A.

    returns

    a future that completes when the node is synchronized across the cluster

    Definition Classes
    Zookeeper
  7. abstract def exists(path: String): Future[Option[Status]]

    Asynchronously determines the status of the node specified by the given path if it exists.

    Asynchronously determines the status of the node specified by the given path if it exists.

    path

    the path of the node

    returns

    a future yielding a Some containing the node status or None if the node does not exist

  8. abstract def get(path: String): Future[(Array[Byte], Status)]

    Asynchronously gets the data and status of the node specified by the given path.

    Asynchronously gets the data and status of the node specified by the given path.

    path

    the path of the node

    returns

    a future, which upon success, yeilds a tuple containing the data and status of the node, otherwise one of the following exceptions:

    • NoNodeException if the node does not exist
  9. abstract def getACL(path: String): Future[(Seq[ACL], Status)]

    Asynchronously gets the ACL and status of the node specified by the given path.

    Asynchronously gets the ACL and status of the node specified by the given path.

    path

    the path of the node

    returns

    a future, which upon success, yields a tuple containing the ACL and status of the node, otherwise one of the following exceptions:

    • NoNodeException if the node does not exist
  10. abstract def session(): Session

    Returns the session associated with ZooKeeper.

    Returns the session associated with ZooKeeper.

    Note that the connection with ZooKeeper is established asynchronously, which means there is no implied guarantee that the session has connected nor will eventually connect at the time that an instance of this trait is created.

    returns

    the session associated with ZooKeeper

    Definition Classes
    Zookeeper
  11. abstract def set(path: String, data: Array[Byte], version: Option[Int]): Future[Status]

    Asynchronously sets the data for the node specified by the given path.

    Asynchronously sets the data for the node specified by the given path.

    path

    the path of the node

    data

    the data to associate with the node, which may be empty, but not null

    version

    a Some containing the expected version of the node or None if a version match is not required

    returns

    a future, which upon success, yields the status of the node, otherwise one of the following exceptions:

    • NoNodeException if the node does not exist
    • BadVersionException if version is specified and does not match the node version
  12. abstract def setACL(path: String, acl: Seq[ACL], version: Option[Int]): Future[Status]

    Asynchronously sets the ACL for the node specified by the given path.

    Asynchronously sets the ACL for the node specified by the given path.

    path

    the path of the node

    acl

    an access control list to apply to the node, which must not be empty

    version

    a Some containing the expected version of the node or None if a version match is not required

    returns

    a future, which upon success, yields the status of the node, otherwise one of the following conditions:

    • NoNodeException if the node does not exist
    • BadVersionException if version is specified and does not match the node version
  13. abstract def sync: SynchronousZookeeper

    Returns a view of this client in which operations are performed synchronously.

    Returns a view of this client in which operations are performed synchronously.

    returns

    a synchronous view of this client

    Definition Classes
    Zookeeper
  14. abstract def watch(fn: PartialFunction[Event, Unit]): AsynchronousWatchableZookeeper

    Returns an asynchronous client in which operations implicitly attach the specified watch function.

    Returns an asynchronous client in which operations implicitly attach the specified watch function.

    The partial function fn is invoked when a watch is triggered or the session state changes. This method is typically used in a transient manner to introduce a watch function prior to performing a watchable ZooKeeper operation.

    Example:

    val zk = AsynchronousZookeeper(config)
    val future = zk watch {
      case e: NodeEvent => ...
      case e: StateEvent => ...
    } get "/foo"
    ...
    future onSuccess {
      case (data, node) => ...
    }
    future onFailure {
      case e: NoNodeException => ...
    }

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  14. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Zookeeper

Inherited from AnyRef

Inherited from Any

Ungrouped