@Override public boolean isBlockCacheEnabled(String cluster, String table) { LOG.debug("trace isBlockCacheEnabled"); try { if (_zk.exists( ZookeeperPathConstants.getTableBlockCachingFileTypesPath(cluster, table), false) == null) { return false; } } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } return true; }
@Override public Set<String> getBlockCacheFileTypes(String cluster, String table) { LOG.debug("trace getBlockCacheFileTypes"); try { byte[] data = getData(ZookeeperPathConstants.getTableBlockCachingFileTypesPath(cluster, table)); if (data == null) { return null; } String str = new String(data); if (str.isEmpty()) { return null; } Set<String> types = new HashSet<String>(Arrays.asList(str.split(","))); if (types.isEmpty()) { return null; } return types; } catch (KeeperException e) { throw new RuntimeException(e); } catch (InterruptedException e) { throw new RuntimeException(e); } }