org.apache.accumulo.fate.zookeeper
Class ZooCacheFactory

java.lang.Object
  extended by org.apache.accumulo.fate.zookeeper.ZooCacheFactory

public class ZooCacheFactory
extends Object

A factory for ZooCache instances.


Constructor Summary
ZooCacheFactory()
           
 
Method Summary
 ZooCache getZooCache(String zooKeepers, int sessionTimeout)
          Gets a ZooCache.
 ZooCache getZooCache(String zooKeepers, int sessionTimeout, org.apache.zookeeper.Watcher watcher)
          Gets a watched ZooCache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZooCacheFactory

public ZooCacheFactory()
Method Detail

getZooCache

public ZooCache getZooCache(String zooKeepers,
                            int sessionTimeout)
Gets a ZooCache. The same object may be returned for multiple calls with the same arguments.

Parameters:
zooKeepers - comma-seprated list of ZooKeeper host[:port]s
sessionTimeout - session timeout
Returns:
cache object

getZooCache

public ZooCache getZooCache(String zooKeepers,
                            int sessionTimeout,
                            org.apache.zookeeper.Watcher watcher)
Gets a watched ZooCache. If the watcher is null, then the same (unwatched) object may be returned for multiple calls with the same remaining arguments.

Parameters:
zooKeepers - comma-seprated list of ZooKeeper host[:port]s
sessionTimeout - session timeout
watcher - watcher (optional)
Returns:
cache object


Copyright © 2015 Apache Accumulo Project. All rights reserved.