SMILA (incubation) API documentation

org.eclipse.smila.zookeeper
Interface ZooKeeperService

All Known Implementing Classes:
ZooKeeperServiceImpl

public interface ZooKeeperService

Interface of ZooKeeper management service.


Field Summary
static java.lang.String BUNDLE_ID
          name of bundle.
 
Method Summary
 void closeClient()
          close the client quietly.
 ZooKeeper getClient()
          get zookeeper client, create if it doesn't exist.
 long getFailSafetyLevel()
           
 AnyMap getServerState()
           
 void registerWatcher(Watcher watcher)
          register a watcher for ZooKeeper events.
 void unregisterWatcher(Watcher watcher)
          unregister a watcher for ZooKeeper events.
 void waitForClientConnected()
          wait until the zookeeper client is (re)connected.
 

Field Detail

BUNDLE_ID

static final java.lang.String BUNDLE_ID
name of bundle.

See Also:
Constant Field Values
Method Detail

getClient

ZooKeeper getClient()
                    throws java.io.IOException,
                           ClusterConfigException
get zookeeper client, create if it doesn't exist.

Returns:
client
Throws:
java.io.IOException - error creating client
ClusterConfigException - if the cluster configuration cannot be read

closeClient

void closeClient()
close the client quietly.


getFailSafetyLevel

long getFailSafetyLevel()
Returns:
number of nodes that may fail without ZooKeeper service stopping to work.

getServerState

AnyMap getServerState()
Returns:
zookeeper server/cluster state for monitoring.

waitForClientConnected

void waitForClientConnected()
wait until the zookeeper client is (re)connected.


registerWatcher

void registerWatcher(Watcher watcher)
register a watcher for ZooKeeper events.


unregisterWatcher

void unregisterWatcher(Watcher watcher)
unregister a watcher for ZooKeeper events.


SMILA (incubation) API documentation