use of org.apache.metron.common.configuration.SensorParserConfig in project metron by apache.
the class ParserTopologyCLITest method testSecurityProtocol_fromCLI.
@Test
public void testSecurityProtocol_fromCLI() throws Exception {
testConfigOption(ParserTopologyCLI.ParserOptions.SECURITY_PROTOCOL, "PLAINTEXT", input -> input.getSecurityProtocol().equals("PLAINTEXT"), () -> {
SensorParserConfig config = getBaseConfig();
config.setSecurityProtocol("KERBEROS");
return config;
}, input -> input.getSecurityProtocol().equals("KERBEROS"));
}
use of org.apache.metron.common.configuration.SensorParserConfig in project metron by apache.
the class ParserTopologyCLITest method testErrorNumTasks.
@Test
public void testErrorNumTasks() throws Exception {
testConfigOption(ParserTopologyCLI.ParserOptions.ERROR_WRITER_NUM_TASKS, "10", input -> input.getErrorNumTasks().equals(10), () -> {
SensorParserConfig config = getBaseConfig();
config.setErrorWriterNumTasks(20);
return config;
}, input -> input.getErrorNumTasks().equals(20));
}
use of org.apache.metron.common.configuration.SensorParserConfig in project metron by apache.
the class ConfigUploadComponent method getSensorParserConfig.
public SensorParserConfig getSensorParserConfig(String sensorType) {
SensorParserConfig sensorParserConfig = new SensorParserConfig();
CuratorFramework client = getClient(topologyProperties.getProperty(ZKServerComponent.ZOOKEEPER_PROPERTY));
client.start();
try {
sensorParserConfig = readSensorParserConfigFromZookeeper(sensorType, client);
} catch (Exception e) {
e.printStackTrace();
} finally {
client.close();
}
return sensorParserConfig;
}
use of org.apache.metron.common.configuration.SensorParserConfig in project metron by apache.
the class KafkaWriterTest method createConfiguration.
public WriterConfiguration createConfiguration(final Map<String, Object> parserConfig) {
ParserConfigurations configurations = new ParserConfigurations();
configurations.updateSensorParserConfig(SENSOR_TYPE, new SensorParserConfig() {
{
setParserConfig(parserConfig);
}
});
return new ParserWriterConfiguration(configurations);
}
Aggregations