@Test public void testGetZooCacheWatcher() { String zks1 = "zk1"; int timeout1 = 1000; Watcher watcher = createMock(Watcher.class); ZooCache zc1 = zcf.getZooCache(zks1, timeout1, watcher); assertNotNull(zc1); }
public ZooCache getZooCache(String zooKeepers, int sessionTimeout) { String key = zooKeepers + ":" + sessionTimeout; synchronized (instances) { if (!isEnabled()) { throw new IllegalStateException("\"The Accumulo singleton for zookeeper caching is " + "disabled. This is likely caused by all AccumuloClients being closed"); } ZooCache zc = instances.get(key); if (zc == null) { zc = new ZooCache(zooKeepers, sessionTimeout); instances.put(key, zc); } return zc; } }
ZooCacheFactory { public ZooCache getZooCache(String zooKeepers, int sessionTimeout) { String key = zooKeepers + ":" + sessionTimeout; synchronized (instances) { if (!isEnabled()) { throw new IllegalStateException("\"The Accumulo singleton for zookeeper caching is " + "disabled. This is likely caused by all AccumuloClients being closed"); } ZooCache zc = instances.get(key); if (zc == null) { zc = new ZooCache(zooKeepers, sessionTimeout); instances.put(key, zc); } return zc; } } }
ZooCacheFactory { public ZooCache getZooCache(String zooKeepers, int sessionTimeout) { String key = zooKeepers + ":" + sessionTimeout; synchronized (instances) { if (!isEnabled()) { throw new IllegalStateException("\"The Accumulo singleton for zookeeper caching is " + "disabled. This is likely caused by all AccumuloClients being closed"); } ZooCache zc = instances.get(key); if (zc == null) { zc = new ZooCache(zooKeepers, sessionTimeout); instances.put(key, zc); } return zc; } }  }
ZooCacheFactory { public ZooCache getZooCache(String zooKeepers, int sessionTimeout) { String key = zooKeepers + ":" + sessionTimeout; synchronized (instances) { if (!isEnabled()) { throw new IllegalStateException("\"The Accumulo singleton for zookeeper caching is " + "disabled. This is likely caused by all AccumuloClients being closed"); } ZooCache zc = instances.get(key); if (zc == null) { zc = new ZooCache(zooKeepers, sessionTimeout); instances.put(key, zc); } return zc; } }  ZooCache getZooCache(String zooKeepers, int sessionTimeout); ZooCache getZooCache(String zooKeepers, int sessionTimeout, Watcher watcher); }
ZooCacheFactory { public ZooCache getZooCache(String zooKeepers, int sessionTimeout) { String key = zooKeepers + ":" + sessionTimeout; synchronized (instances) { if (!isEnabled()) { throw new IllegalStateException("\"The Accumulo singleton for zookeeper caching is " + "disabled. This is likely caused by all AccumuloClients being closed"); } ZooCache zc = instances.get(key); if (zc == null) { zc = new ZooCache(zooKeepers, sessionTimeout); instances.put(key, zc); } return zc; } }  ZooCache getZooCache(String zooKeepers, int sessionTimeout); ZooCache getZooCache(String zooKeepers, int sessionTimeout, Watcher watcher);  }