@Override public void writeSensorConfigToZookeeper(String sensorType, byte[] configData, CuratorFramework client) throws Exception { ConfigurationsUtils.writeSensorIndexingConfigToZookeeper(sensorType, configData, client); }
@Override public Map<String, Object> save(String name, Map<String, Object> sensorIndexingConfig) throws RestException { try { ConfigurationsUtils.writeSensorIndexingConfigToZookeeper(name, objectMapper.writeValueAsString(sensorIndexingConfig).getBytes(), client); } catch (Exception e) { throw new RestException(e); } return sensorIndexingConfig; }
public static void writeSensorIndexingConfigToZookeeper(String sensorType, byte[] configData, String zookeeperUrl) throws Exception { try(CuratorFramework client = getClient(zookeeperUrl)) { client.start(); writeSensorIndexingConfigToZookeeper(sensorType, configData, client); } }
public static void writeSensorIndexingConfigToZookeeper(String sensorType, Map<String, Object> sensorIndexingConfig, String zookeeperUrl) throws Exception { writeSensorIndexingConfigToZookeeper(sensorType, JSONUtils.INSTANCE.toJSONPretty(sensorIndexingConfig), zookeeperUrl); }
writeSensorIndexingConfigToZookeeper(sensor, value.getBytes(), client);
Map<String, byte[]> sensorIndexingConfigs = readSensorIndexingConfigsFromFile(indexingConfigPath); for (String sensorType : sensorIndexingConfigs.keySet()) { ConfigurationsUtils.writeSensorIndexingConfigToZookeeper(sensorType, sensorIndexingConfigs.get(sensorType), client);
ConfigurationsUtils.writeSensorIndexingConfigToZookeeper("test", config, client);
@Test public void validateUpdate() throws Exception { ConfigurationsUtils.writeSensorIndexingConfigToZookeeper("test", testIndexingConfig.getBytes(), client); ConfigurationsUtils.writeGlobalConfigToZookeeper(globalConfig.getBytes(), client); ConfigurationsUtils.writeSensorEnrichmentConfigToZookeeper("test", testEnrichmentConfig.getBytes(), client);