Search in sources :

Example 1 with IndexingConfigurations

use of org.apache.metron.common.configuration.IndexingConfigurations in project metron by apache.

the class IndexingWriterConfigurationTest method testGetAllConfiguredTimeouts.

@Test
public void testGetAllConfiguredTimeouts() throws FileNotFoundException, IOException {
    // default
    IndexingWriterConfiguration config = new IndexingWriterConfiguration("hdfs", new IndexingConfigurations());
    Assert.assertEquals(0, config.getAllConfiguredTimeouts().size());
    // non-default
    IndexingConfigurations iconfigs = new IndexingConfigurations();
    iconfigs.updateSensorIndexingConfig(sensorType, new FileInputStream(sampleSensorIndexingConfigPath));
    config = new IndexingWriterConfiguration("elasticsearch", iconfigs);
    Assert.assertEquals(1, config.getAllConfiguredTimeouts().size());
    Assert.assertEquals(7, (long) config.getAllConfiguredTimeouts().get(0));
}
Also used : IndexingWriterConfiguration(org.apache.metron.common.configuration.writer.IndexingWriterConfiguration) IndexingConfigurations(org.apache.metron.common.configuration.IndexingConfigurations) FileInputStream(java.io.FileInputStream) Test(org.junit.Test)

Example 2 with IndexingConfigurations

use of org.apache.metron.common.configuration.IndexingConfigurations in project metron by apache.

the class IndexingWriterConfigurationTest method testDefaultIndex.

@Test
public void testDefaultIndex() {
    IndexingWriterConfiguration config = new IndexingWriterConfiguration("hdfs", new IndexingConfigurations());
    Assert.assertEquals("foo", config.getIndex("foo"));
}
Also used : IndexingWriterConfiguration(org.apache.metron.common.configuration.writer.IndexingWriterConfiguration) IndexingConfigurations(org.apache.metron.common.configuration.IndexingConfigurations) Test(org.junit.Test)

Example 3 with IndexingConfigurations

use of org.apache.metron.common.configuration.IndexingConfigurations in project metron by apache.

the class IndexingWriterConfigurationTest method testDefaultBatchTimeout.

@Test
public void testDefaultBatchTimeout() {
    IndexingWriterConfiguration config = new IndexingWriterConfiguration("hdfs", new IndexingConfigurations());
    Assert.assertEquals(0, config.getBatchTimeout("foo"));
}
Also used : IndexingWriterConfiguration(org.apache.metron.common.configuration.writer.IndexingWriterConfiguration) IndexingConfigurations(org.apache.metron.common.configuration.IndexingConfigurations) Test(org.junit.Test)

Example 4 with IndexingConfigurations

use of org.apache.metron.common.configuration.IndexingConfigurations in project metron by apache.

the class IndexingWriterConfigurationTest method testDefaultIndex.

@Test
public void testDefaultIndex() {
    IndexingWriterConfiguration config = new IndexingWriterConfiguration("hdfs", new IndexingConfigurations());
    assertEquals("foo", config.getIndex("foo"));
}
Also used : IndexingConfigurations(org.apache.metron.common.configuration.IndexingConfigurations) Test(org.junit.jupiter.api.Test)

Example 5 with IndexingConfigurations

use of org.apache.metron.common.configuration.IndexingConfigurations in project metron by apache.

the class IndexingWriterConfigurationTest method testDefaultBatchTimeout.

@Test
public void testDefaultBatchTimeout() {
    IndexingWriterConfiguration config = new IndexingWriterConfiguration("hdfs", new IndexingConfigurations());
    assertEquals(0, config.getBatchTimeout("foo"));
}
Also used : IndexingConfigurations(org.apache.metron.common.configuration.IndexingConfigurations) Test(org.junit.jupiter.api.Test)

Aggregations

IndexingConfigurations (org.apache.metron.common.configuration.IndexingConfigurations)38 Test (org.junit.jupiter.api.Test)29 IndexingWriterConfiguration (org.apache.metron.common.configuration.writer.IndexingWriterConfiguration)20 JSONObject (org.json.simple.JSONObject)14 WriterConfiguration (org.apache.metron.common.configuration.writer.WriterConfiguration)13 ParserConfigurations (org.apache.metron.common.configuration.ParserConfigurations)5 FileInputStream (java.io.FileInputStream)4 HashMap (java.util.HashMap)4 Test (org.junit.Test)4 ConfigurationsCache (org.apache.metron.common.zookeeper.ConfigurationsCache)3 Map (java.util.Map)2 BulkMessage (org.apache.metron.common.writer.BulkMessage)2 BaseEnrichmentBoltTest (org.apache.metron.test.bolt.BaseEnrichmentBoltTest)2 JSONParser (org.json.simple.parser.JSONParser)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 FakeClock (org.apache.metron.common.system.FakeClock)1 MessageId (org.apache.metron.common.writer.MessageId)1 DefaultFileNameFormat (org.apache.storm.hdfs.bolt.format.DefaultFileNameFormat)1