Codota Logo
ConfigurationType.getZookeeperRoot
Code IndexAdd Codota to your IDE (free)

How to use
getZookeeperRoot
method
in
org.apache.metron.common.configuration.ConfigurationType

Best Java code snippets using org.apache.metron.common.configuration.ConfigurationType.getZookeeperRoot (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: apache/metron

private static String getConfigZKPath(ConfigurationType configType, Optional<String> configName) {
 String pathSuffix = configName.isPresent() && configType != GLOBAL ? "/" + configName.get() : "";
 return configType.getZookeeperRoot() + pathSuffix;
}
origin: apache/metron

public static byte[] readSensorEnrichmentConfigBytesFromZookeeper(String sensorType, CuratorFramework client) throws Exception {
 return readFromZookeeper(ENRICHMENT.getZookeeperRoot() + "/" + sensorType, client);
}
origin: apache/metron

public static byte[] readGlobalConfigBytesFromZookeeper(CuratorFramework client) throws Exception {
 return readFromZookeeper(GLOBAL.getZookeeperRoot(), client);
}
origin: apache/metron

private ProfilerConfig readFromZookeeper(CuratorFramework client) throws Exception {
 byte[] raw = client.getData().forPath(PROFILER.getZookeeperRoot());
 return JSONUtils.INSTANCE.load(new ByteArrayInputStream(raw), ProfilerConfig.class);
}
origin: apache/metron

public static byte[] readSensorIndexingConfigBytesFromZookeeper(String sensorType, CuratorFramework client) throws Exception {
 return readFromZookeeper(INDEXING.getZookeeperRoot() + "/" + sensorType, client);
}
origin: apache/metron

public static byte[] readSensorParserConfigBytesFromZookeeper(String sensorType, CuratorFramework client) throws Exception {
 return readFromZookeeper(PARSER.getZookeeperRoot() + "/" + sensorType, client);
}
origin: apache/metron

public static byte[] readProfilerConfigBytesFromZookeeper(CuratorFramework client) throws Exception {
 return readFromZookeeper(PROFILER.getZookeeperRoot(), client);
}
origin: apache/metron

  @Override
  public boolean delete() throws RestException {
    try {
      client.delete().forPath(ConfigurationType.GLOBAL.getZookeeperRoot());
    } catch (KeeperException.NoNodeException e) {
      return false;
    } catch (Exception e) {
     throw new RestException(e);
    }
    return true;
  }
}
origin: apache/metron

@Override
public boolean delete(String name) throws RestException {
 try {
  client.delete().forPath(ConfigurationType.PARSER.getZookeeperRoot() + "/" + name);
 } catch (KeeperException.NoNodeException e) {
  return false;
 } catch (Exception e) {
  throw new RestException(e);
 }
 return true;
}
origin: apache/metron

@Override
public boolean delete(String name) throws RestException {
 try {
   client.delete().forPath(ConfigurationType.INDEXING.getZookeeperRoot() + "/" + name);
 } catch (KeeperException.NoNodeException e) {
   return false;
 } catch (Exception e) {
  throw new RestException(e);
 }
 return true;
}
origin: apache/metron

@Override
public boolean delete(String name) throws RestException {
  try {
    client.delete().forPath(ConfigurationType.ENRICHMENT.getZookeeperRoot() + "/" + name);
  } catch (KeeperException.NoNodeException e) {
    return false;
  } catch (Exception e) {
   throw new RestException(e);
  }
 return true;
}
origin: apache/metron

public static void writeProfilerConfigToZookeeper(byte[] config, CuratorFramework client) throws Exception {
 PROFILER.deserialize(new String(config));
 writeToZookeeper(PROFILER.getZookeeperRoot(), config, client);
}
origin: apache/metron

public static void writeGlobalConfigToZookeeper(byte[] globalConfig, CuratorFramework client) throws Exception {
 GLOBAL.deserialize(new String(globalConfig));
 writeToZookeeper(GLOBAL.getZookeeperRoot(), globalConfig, client);
}
origin: apache/metron

/**
 * Reads the Profiler configuration from Zookeeper.
 *
 * @param client The Zookeeper client.
 * @return THe Profiler configuration.
 * @throws Exception
 */
public static ProfilerConfig readProfilerConfigFromZookeeper(CuratorFramework client) throws Exception {
 ProfilerConfig config = null;
 Optional<byte[]> bytes = readFromZookeeperSafely(PROFILER.getZookeeperRoot(), client);
 if(bytes.isPresent()) {
  config = ProfilerConfig.fromBytes(bytes.get());
 }
 return config;
}
origin: apache/metron

/**
 * Reads the global configuration stored in Zookeeper.
 *
 * @param client The Zookeeper client.
 * @return The global configuration, if one exists.  Otherwise, null.
 * @throws Exception
 */
public static Map<String, Object> readGlobalConfigFromZookeeper(CuratorFramework client) throws Exception {
 Map<String, Object> config = null;
 Optional<byte[]> bytes = readFromZookeeperSafely(GLOBAL.getZookeeperRoot(), client);
 if(bytes.isPresent()) {
  InputStream in = new ByteArrayInputStream(bytes.get());
  config = JSONUtils.INSTANCE.load(in, JSONUtils.MAP_SUPPLIER);
 }
 return config;
}
origin: apache/metron

public static void writeSensorEnrichmentConfigToZookeeper(String sensorType, byte[] configData, CuratorFramework client) throws Exception {
 ENRICHMENT.deserialize(new String(configData));
 writeToZookeeper(ENRICHMENT.getZookeeperRoot() + "/" + sensorType, configData, client);
}
origin: apache/metron

/**
 * Reads the Indexing configuration from Zookeeper.
 *
 * @param sensorType The type of sensor.
 * @param client The Zookeeper client.
 * @return The indexing configuration for the given sensor type, if one exists.  Otherwise, null.
 * @throws Exception
 */
public static Map<String, Object> readSensorIndexingConfigFromZookeeper(String sensorType, CuratorFramework client) throws Exception {
 Map<String, Object> config = null;
 Optional<byte[]> bytes = readFromZookeeperSafely(INDEXING.getZookeeperRoot() + "/" + sensorType, client);
 if(bytes.isPresent()) {
  InputStream in = new ByteArrayInputStream(bytes.get());
  config = JSONUtils.INSTANCE.load(in, JSONUtils.MAP_SUPPLIER);
 }
 return config;
}
origin: apache/metron

public static void writeSensorIndexingConfigToZookeeper(String sensorType, byte[] configData, CuratorFramework client) throws Exception {
 INDEXING.deserialize(new String(configData));
 writeToZookeeper(INDEXING.getZookeeperRoot() + "/" + sensorType, configData, client);
}
origin: apache/metron

/**
 * Reads the Parser configuration from Zookeeper.
 *
 * @param sensorType The type of sensor.
 * @param client The Zookeeper client.
 * @return The Parser configuration for the given sensor type, if one exists. Otherwise, null.
 * @throws Exception
 */
public static SensorParserConfig readSensorParserConfigFromZookeeper(String sensorType, CuratorFramework client) throws Exception {
 SensorParserConfig config = null;
 Optional<byte[]> bytes = readFromZookeeperSafely(PARSER.getZookeeperRoot() + "/" + sensorType, client);
 if(bytes.isPresent()) {
  config = SensorParserConfig.fromBytes(bytes.get());
 }
 return config;
}
origin: apache/metron

public static void writeSensorParserConfigToZookeeper(String sensorType, byte[] configData, CuratorFramework client) throws Exception {
 SensorParserConfig c = (SensorParserConfig) PARSER.deserialize(new String(configData));
 c.init();
 writeToZookeeper(PARSER.getZookeeperRoot() + "/" + sensorType, configData, client);
}
org.apache.metron.common.configurationConfigurationTypegetZookeeperRoot

Popular methods of ConfigurationType

  • deserialize
  • getDirectory
  • getTypeName
  • valueOf
  • equals
  • name
  • toString
  • writeSensorConfigToZookeeper

Popular in Java

  • Updating database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • Color (java.awt)
    The Color class is used encapsulate colors in the default sRGB color space or colors in arbitrary co
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • Reference (javax.naming)
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now