use of org.apache.curator.framework.CuratorFramework in project metron by apache.
the class ConfigurationsUtils method writeGlobalConfigToZookeeper.
public static void writeGlobalConfigToZookeeper(byte[] globalConfig, String zookeeperUrl) throws Exception {
try (CuratorFramework client = getClient(zookeeperUrl)) {
client.start();
writeGlobalConfigToZookeeper(globalConfig, client);
}
}
use of org.apache.curator.framework.CuratorFramework in project metron by apache.
the class ConfigurationsUtils method writeSensorEnrichmentConfigToZookeeper.
public static void writeSensorEnrichmentConfigToZookeeper(String sensorType, byte[] configData, String zookeeperUrl) throws Exception {
try (CuratorFramework client = getClient(zookeeperUrl)) {
client.start();
writeSensorEnrichmentConfigToZookeeper(sensorType, configData, client);
}
}
use of org.apache.curator.framework.CuratorFramework in project metron by apache.
the class ConfigurationsUtils method applyConfigPatchToZookeeper.
/**
* Reads Json data for the specified config type and config name (if applicable) from zookeeper,
* applies the patch from patchData, and writes it back to Zookeeper in a pretty print format.
* Patching JSON flattens existing formatting, so this will keep configs readable.
* Starts up curatorclient based on zookeeperUrl.
*
* @param configurationType GLOBAL, PARSER, etc.
* @param configName e.g. bro, yaf, snort
* @param patchData a JSON patch in the format specified by RFC 6902
* @param zookeeperUrl configs are here
*/
public static void applyConfigPatchToZookeeper(ConfigurationType configurationType, Optional<String> configName, byte[] patchData, String zookeeperUrl) throws Exception {
try (CuratorFramework client = getClient(zookeeperUrl)) {
client.start();
applyConfigPatchToZookeeper(configurationType, configName, patchData, client);
}
}
use of org.apache.curator.framework.CuratorFramework in project metron by apache.
the class ConfigurationsUtils method writeGlobalConfigToZookeeper.
public static void writeGlobalConfigToZookeeper(Map<String, Object> globalConfig, String zookeeperUrl) throws Exception {
try (CuratorFramework client = getClient(zookeeperUrl)) {
client.start();
writeGlobalConfigToZookeeper(globalConfig, client);
}
}
use of org.apache.curator.framework.CuratorFramework in project metron by apache.
the class SensorEnrichmentUpdateConfig method updateSensorConfigs.
public void updateSensorConfigs() throws Exception {
CuratorFramework client = ConfigurationsUtils.getClient(getZkQuorum());
try {
client.start();
updateSensorConfigs(new ZKSourceConfigHandler(client), sensorToFieldList);
} finally {
client.close();
}
}
Aggregations