com.twitter.common.zookeeper
Interface ServerSet

All Superinterfaces:
DynamicHostSet<ServiceInstance>
All Known Implementing Classes:
ServerSetImpl

public interface ServerSet
extends DynamicHostSet<ServiceInstance>

A logical set of servers registered in ZooKeeper. Intended to be used by both servers in a common service and their clients. TODO(William Farner): Explore decoupling this from thrift.


Nested Class Summary
static interface ServerSet.EndpointStatus
          A handle to a service endpoint's status data that allows updating it to track current events.
static class ServerSet.UpdateException
          Indicates an error updating a service's status information.
 
Nested classes/interfaces inherited from interface com.twitter.common.net.pool.DynamicHostSet
DynamicHostSet.HostChangeMonitor<T>, DynamicHostSet.MonitorException
 
Method Summary
 ServerSet.EndpointStatus join(InetSocketAddress endpoint, Map<String,InetSocketAddress> additionalEndpoints, Status status)
          Attempts to join a server set for this logical service group.
 
Methods inherited from interface com.twitter.common.net.pool.DynamicHostSet
monitor
 

Method Detail

join

ServerSet.EndpointStatus join(InetSocketAddress endpoint,
                              Map<String,InetSocketAddress> additionalEndpoints,
                              Status status)
                              throws Group.JoinException,
                                     InterruptedException
Attempts to join a server set for this logical service group.

Parameters:
endpoint - the primary service endpoint
additionalEndpoints - and additional endpoints keyed by their logical name
status - the current service status
Returns:
an EndpointStatus object that allows the endpoint to adjust its status
Throws:
Group.JoinException - if there was a problem joining the server set
InterruptedException - if interrupted while waiting to join the server set