public static void updateSensorIndexingConfigsFromZookeeper(IndexingConfigurations configurations, CuratorFramework client) throws Exception { updateConfigsFromZookeeper( configurations , INDEXING , sensorType -> configurations.updateSensorIndexingConfig(sensorType, readSensorIndexingConfigBytesFromZookeeper(sensorType, client)) , client ); }
private void waitForIndex(String zookeeperQuorum) throws Exception { try(CuratorFramework client = getClient(zookeeperQuorum)) { client.start(); System.out.println("Waiting for zookeeper..."); byte[] bytes = null; do { try { bytes = ConfigurationsUtils.readSensorIndexingConfigBytesFromZookeeper(testSensorType, client); Thread.sleep(1000); } catch(KeeperException.NoNodeException nne) { //kindly ignore because the path might not exist just yet. } } while(bytes == null || bytes.length == 0); System.out.println("Found index config in zookeeper..."); } }