public static byte[] readConfigBytesFromZookeeper(String name, CuratorFramework client) throws Exception { return readFromZookeeper(Constants.ZOOKEEPER_TOPOLOGY_ROOT + "/" + name, client); }
/** * Read raw bytes from Zookeeper. * * @param path The path to the Zookeeper node to read. * @param client The Zookeeper client. * @return The bytes read from Zookeeper, if node exists. Otherwise, null. * @throws Exception */ public static Optional<byte[]> readFromZookeeperSafely(String path, CuratorFramework client) throws Exception { Optional<byte[]> result = Optional.empty(); try { byte[] bytes = readFromZookeeper(path, client); result = Optional.of(bytes); } catch(KeeperException.NoNodeException e) { LOG.debug("Zookeeper node missing; path={}", e); } return result; }
public static byte[] readConfigBytesFromZookeeper(ConfigurationType configType, Optional<String> configName, CuratorFramework client) throws Exception { return readFromZookeeper(getConfigZKPath(configType, configName), client); }
public static byte[] readFromZookeeper(String path, String zookeeperUrl) throws Exception { try (CuratorFramework client = getClient(zookeeperUrl)) { client.start(); return readFromZookeeper(path, client); } }
public static byte[] readSensorEnrichmentConfigBytesFromZookeeper(String sensorType, CuratorFramework client) throws Exception { return readFromZookeeper(ENRICHMENT.getZookeeperRoot() + "/" + sensorType, client); }
public static byte[] readProfilerConfigBytesFromZookeeper(CuratorFramework client) throws Exception { return readFromZookeeper(PROFILER.getZookeeperRoot(), client); }
public static byte[] readSensorParserConfigBytesFromZookeeper(String sensorType, CuratorFramework client) throws Exception { return readFromZookeeper(PARSER.getZookeeperRoot() + "/" + sensorType, client); }
public static byte[] readSensorIndexingConfigBytesFromZookeeper(String sensorType, CuratorFramework client) throws Exception { return readFromZookeeper(INDEXING.getZookeeperRoot() + "/" + sensorType, client); }
public static byte[] readConfigBytesFromZookeeper(ConfigurationType configType, Optional<String> configName, String zookeeperUrl) throws Exception { return readFromZookeeper(getConfigZKPath(configType, configName), zookeeperUrl); }
public static byte[] readGlobalConfigBytesFromZookeeper(CuratorFramework client) throws Exception { return readFromZookeeper(GLOBAL.getZookeeperRoot(), client); }