@Test public void testGetClusterNoTable() { LOG.warn("testGetCluster"); assertNull(clusterStatus.getCluster(false, TEST)); assertNull(clusterStatus.getCluster(true, TEST)); }
@Override public String getCluster(boolean useCache, String table) { if (useCache) { for (Entry<String, Set<String>> entry : _tablesPerCluster.entrySet()) { if (entry.getValue().contains(table)) { return entry.getKey(); } } } List<String> clusterList = getClusterList(useCache); for (String cluster : clusterList) { long s = System.nanoTime(); try { checkIfOpen(); Stat stat = _zk.exists(ZookeeperPathConstants.getTablePath(cluster, table), false); if (stat != null) { return cluster; } } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { long e = System.nanoTime(); LOG.debug("trace getCluster took [" + (e - s) / 1000000.0 + " ms]"); } } return null; }
ZookeeperClusterStatus extends ClusterStatus { @Override public String getCluster(boolean useCache, String table) { if (useCache) { for (Entry<String, Set<String>> entry : _tablesPerCluster.entrySet()) { if (entry.getValue().contains(table)) { return entry.getKey(); } } } List<String> clusterList = getClusterList(useCache); for (String cluster : clusterList) { long s = System.nanoTime(); try { checkIfOpen(); Stat stat = _zk.exists(ZookeeperPathConstants.getTablePath(cluster, table), false); if (stat != null) { return cluster; } } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { long e = System.nanoTime(); LOG.debug("trace getCluster took [" + (e - s) / 1000000.0 + " ms]"); } } return null; } }
ZookeeperClusterStatus extends ClusterStatus { @Override public String getCluster(boolean useCache, String table) { if (useCache) { for (Entry<String, Set<String>> entry : _tablesPerCluster.entrySet()) { if (entry.getValue().contains(table)) { return entry.getKey(); } } } List<String> clusterList = getClusterList(useCache); for (String cluster : clusterList) { long s = System.nanoTime(); try { checkIfOpen(); Stat stat = _zk.exists(ZookeeperPathConstants.getTablePath(cluster, table), false); if (stat != null) { return cluster; } } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { long e = System.nanoTime(); LOG.debug("trace getCluster took [" + (e - s) / 1000000.0 + " ms]"); } } return null; } ZookeeperClusterStatus(ZooKeeper zooKeeper);  ZookeeperClusterStatus(String connectionStr); }
ZookeeperClusterStatus extends ClusterStatus { @Override public String getCluster(boolean useCache, String table) { if (useCache) { for (Entry<String, Set<String>> entry : _tablesPerCluster.entrySet()) { if (entry.getValue().contains(table)) { return entry.getKey(); } } } List<String> clusterList = getClusterList(useCache); for (String cluster : clusterList) { long s = System.nanoTime(); try { checkIfOpen(); Stat stat = _zk.exists(ZookeeperPathConstants.getTablePath(cluster, table), false); if (stat != null) { return cluster; } } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { long e = System.nanoTime(); LOG.debug("trace getCluster took [" + (e - s) / 1000000.0 + " ms]"); } } return null; } ZookeeperClusterStatus(ZooKeeper zooKeeper);  ZookeeperClusterStatus(String connectionStr); @Override List<String> getClusterList(boolean useCache); @Override List<String> getControllerServerList(); @Override List<String> getOnlineShardServers(boolean useCache, String cluster); @Override List<String> getShardServerList(String cluster); @Override boolean exists(boolean useCache, String cluster, String table); @Override boolean isEnabled(boolean useCache, String cluster, String table); @Override TableDescriptor getTableDescriptor(boolean useCache, String cluster, String table); @Override List<String> getTableList(boolean useCache, String cluster); void close(); @Override String getCluster(boolean useCache, String table); @Override boolean isInSafeMode(boolean useCache, String cluster); @Override int getShardCount(boolean useCache, String cluster, String table); @Override Set<String> getBlockCacheFileTypes(String cluster, String table); @Override boolean isBlockCacheEnabled(String cluster, String table); @Override boolean isReadOnly(boolean useCache, String cluster, String table); @Override void createTable(TableDescriptor tableDescriptor); @Override void disableTable(String cluster, String table); @Override void enableTable(String cluster, String table); @Override void removeTable(String cluster, String table, boolean deleteIndexFiles); @Override boolean isOpen(); }
ZookeeperClusterStatus extends ClusterStatus { @Override public String getCluster(boolean useCache, String table) { if (useCache) { for (Entry<String, Set<String>> entry : _tablesPerCluster.entrySet()) { if (entry.getValue().contains(table)) { return entry.getKey(); } } } List<String> clusterList = getClusterList(useCache); for (String cluster : clusterList) { long s = System.nanoTime(); try { checkIfOpen(); Stat stat = _zk.exists(ZookeeperPathConstants.getTablePath(cluster, table), false); if (stat != null) { return cluster; } } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } finally { long e = System.nanoTime(); LOG.debug("trace getCluster took [" + (e - s) / 1000000.0 + " ms]"); } } return null; } ZookeeperClusterStatus(ZooKeeper zooKeeper);  ZookeeperClusterStatus(String connectionStr); @Override List<String> getClusterList(boolean useCache); @Override List<String> getControllerServerList(); @Override List<String> getOnlineShardServers(boolean useCache, String cluster); @Override List<String> getShardServerList(String cluster); @Override boolean exists(boolean useCache, String cluster, String table); @Override boolean isEnabled(boolean useCache, String cluster, String table); @Override TableDescriptor getTableDescriptor(boolean useCache, String cluster, String table); @Override List<String> getTableList(boolean useCache, String cluster); void close(); @Override String getCluster(boolean useCache, String table); @Override boolean isInSafeMode(boolean useCache, String cluster); @Override int getShardCount(boolean useCache, String cluster, String table); @Override Set<String> getBlockCacheFileTypes(String cluster, String table); @Override boolean isBlockCacheEnabled(String cluster, String table); @Override boolean isReadOnly(boolean useCache, String cluster, String table); @Override void createTable(TableDescriptor tableDescriptor); @Override void disableTable(String cluster, String table); @Override void enableTable(String cluster, String table); @Override void removeTable(String cluster, String table, boolean deleteIndexFiles); @Override boolean isOpen();  }