com.twitter.common.zookeeper
Interface Group.Membership

All Known Implementing Classes:
Partitioner.Partition
Enclosing class:
Group

public static interface Group.Membership

Represents membership in a distributed group.


Method Summary
 void cancel()
          Cancels group membership by deleting the associated ZooKeeper member node.
 String getGroupPath()
          Returns the persistent ZooKeeper path that represents this group.
 String getMemberId()
          Returns the id (ZooKeeper node name) of this group member.
 String getMemberPath()
          Returns the full ZooKeeper path to this group member.
 byte[] updateMemberData()
          Updates the membership data synchronously using the Supplier<byte[]> passed to Group.join().
 

Method Detail

getGroupPath

String getGroupPath()
Returns the persistent ZooKeeper path that represents this group.


getMemberId

String getMemberId()
Returns the id (ZooKeeper node name) of this group member. May change over time if the ZooKeeper session expires.


getMemberPath

String getMemberPath()
Returns the full ZooKeeper path to this group member. May change over time if the ZooKeeper session expires.


updateMemberData

byte[] updateMemberData()
                        throws Group.UpdateException
Updates the membership data synchronously using the Supplier<byte[]> passed to Group.join().

Returns:
the new membership data
Throws:
Group.UpdateException - if there was a problem updating the membership data

cancel

void cancel()
            throws Group.JoinException
Cancels group membership by deleting the associated ZooKeeper member node.

Throws:
Group.JoinException - if there is a problem deleting the node