Search in sources :

Example 1 with INDEXING

use of org.apache.metron.common.configuration.ConfigurationType.INDEXING in project metron by apache.

the class ConfigurationManagerIntegrationTest method setup.

@BeforeEach
public void setup() throws Exception {
    testZkServer = new TestingServer(true);
    zookeeperUrl = testZkServer.getConnectString();
    client = ConfigurationsUtils.getClient(zookeeperUrl);
    client.start();
    File sensorDir = new File(new File(TestConstants.SAMPLE_CONFIG_PATH), ENRICHMENT.getDirectory());
    sensors.addAll(Collections2.transform(Arrays.asList(sensorDir.list()), s -> Iterables.getFirst(Splitter.on('.').split(s), "null")));
    tmpDir = TestUtils.createTempDir(this.getClass().getName());
    configDir = TestUtils.createDir(tmpDir, "config");
    parsersDir = TestUtils.createDir(configDir, "parsers");
    enrichmentsDir = TestUtils.createDir(configDir, "enrichments");
    indexingDir = TestUtils.createDir(configDir, "indexing");
    pushAllConfigs();
}
Also used : TestingServer(org.apache.curator.test.TestingServer) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) BeforeEach(org.junit.jupiter.api.BeforeEach) Iterables(com.google.common.collect.Iterables) Arrays(java.util.Arrays) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ENRICHMENT(org.apache.metron.common.configuration.ConfigurationType.ENRICHMENT) CoreMatchers.equalTo(org.hamcrest.CoreMatchers.equalTo) ArrayUtils(org.apache.commons.lang3.ArrayUtils) Collections2(com.google.common.collect.Collections2) HashSet(java.util.HashSet) PatchMode(org.apache.metron.common.cli.ConfigurationManager.PatchMode) StringUtils.stripLines(org.apache.metron.common.utils.StringUtils.stripLines) TestingServer(org.apache.curator.test.TestingServer) ConfigurationType(org.apache.metron.common.configuration.ConfigurationType) ConfigurationsUtils(org.apache.metron.common.configuration.ConfigurationsUtils) JSONUtils(org.apache.metron.common.utils.JSONUtils) MatcherAssert.assertThat(org.hamcrest.MatcherAssert.assertThat) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) PosixParser(org.apache.commons.cli.PosixParser) Splitter(com.google.common.base.Splitter) ADD(org.apache.metron.common.cli.ConfigurationManager.PatchMode.ADD) OutputStream(java.io.OutputStream) PrintStream(java.io.PrintStream) GLOBAL(org.apache.metron.common.configuration.ConfigurationType.GLOBAL) Files(java.nio.file.Files) TestConstants(org.apache.metron.TestConstants) PROFILER(org.apache.metron.common.configuration.ConfigurationType.PROFILER) DirectoryNotEmptyException(java.nio.file.DirectoryNotEmptyException) Set(java.util.Set) TestUtils(org.apache.metron.integration.utils.TestUtils) IOException(java.io.IOException) INDEXING(org.apache.metron.common.configuration.ConfigurationType.INDEXING) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) PARSER(org.apache.metron.common.configuration.ConfigurationType.PARSER) Test(org.junit.jupiter.api.Test) AfterEach(org.junit.jupiter.api.AfterEach) CuratorFramework(org.apache.curator.framework.CuratorFramework) BooleanWritable(org.apache.hadoop.io.BooleanWritable) Paths(java.nio.file.Paths) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Multiline(org.adrianwalker.multilinestring.Multiline) Optional(java.util.Optional) Assertions.assertDoesNotThrow(org.junit.jupiter.api.Assertions.assertDoesNotThrow) File(java.io.File) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Splitter (com.google.common.base.Splitter)1 Collections2 (com.google.common.collect.Collections2)1 Iterables (com.google.common.collect.Iterables)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 PrintStream (java.io.PrintStream)1 StandardCharsets (java.nio.charset.StandardCharsets)1 DirectoryNotEmptyException (java.nio.file.DirectoryNotEmptyException)1 Files (java.nio.file.Files)1 Paths (java.nio.file.Paths)1 Arrays (java.util.Arrays)1 HashSet (java.util.HashSet)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Multiline (org.adrianwalker.multilinestring.Multiline)1 PosixParser (org.apache.commons.cli.PosixParser)1 ArrayUtils (org.apache.commons.lang3.ArrayUtils)1 CuratorFramework (org.apache.curator.framework.CuratorFramework)1