Search in sources :

Example 1 with IndexMappingFactory

use of org.graylog2.indexer.IndexMappingFactory in project graylog2-server by Graylog2.

the class IndicesIT method createThrowingIndexMappingFactory.

private IndexMappingFactory createThrowingIndexMappingFactory(IndexSetConfig indexSetConfig) {
    final IndexMappingFactory indexMappingFactory = mock(IndexMappingFactory.class);
    when(indexMappingFactory.createIndexMapping(any())).thenThrow(new IgnoreIndexTemplate(true, "Reason", indexSetConfig.indexPrefix(), indexSetConfig.indexTemplateName(), indexSetConfig.indexTemplateType().orElse(null)));
    return indexMappingFactory;
}
Also used : IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) IgnoreIndexTemplate(org.graylog2.indexer.IgnoreIndexTemplate)

Example 2 with IndexMappingFactory

use of org.graylog2.indexer.IndexMappingFactory in project graylog2-server by Graylog2.

the class IndicesGetAllMessageFieldsIT method setUp.

@Before
public void setUp() throws Exception {
    final Node node = new Node(mock(NodeAdapter.class));
    // noinspection UnstableApiUsage
    indices = new Indices(new IndexMappingFactory(node, ImmutableMap.of(MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider())), mock(NodeId.class), new NullAuditEventSender(), new EventBus(), indicesAdapter());
}
Also used : NodeAdapter(org.graylog2.indexer.cluster.NodeAdapter) NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) Before(org.junit.Before)

Example 3 with IndexMappingFactory

use of org.graylog2.indexer.IndexMappingFactory in project graylog2-server by Graylog2.

the class IndexFieldTypePollerIT method setUp.

@Before
public void setUp() throws Exception {
    final Node node = mock(Node.class);
    @SuppressWarnings("UnstableApiUsage") final Indices indices = new Indices(new IndexMappingFactory(node, ImmutableMap.of(MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider())), mock(NodeId.class), new NullAuditEventSender(), mock(EventBus.class), createIndicesAdapter());
    poller = new IndexFieldTypePoller(indices, new MetricRegistry(), createIndexFieldTypePollerAdapter());
    indexSet = new TestIndexSet(indexSetConfig);
    importFixture("org/graylog2/indexer/fieldtypes/IndexFieldTypePollerIT.json");
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) TestIndexSet(org.graylog2.indexer.TestIndexSet) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MetricRegistry(com.codahale.metrics.MetricRegistry) NodeId(org.graylog2.plugin.system.NodeId) Indices(org.graylog2.indexer.indices.Indices) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) Before(org.junit.Before)

Example 4 with IndexMappingFactory

use of org.graylog2.indexer.IndexMappingFactory in project graylog2-server by Graylog2.

the class IndicesIT method setUp.

@BeforeEach
public void setUp() {
    // noinspection UnstableApiUsage
    eventBus = new EventBus("indices-test");
    final Node node = new Node(createNodeAdapter());
    final IndexMappingFactory indexMappingFactory = new IndexMappingFactory(node, ImmutableMap.of(MessageIndexTemplateProvider.MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider()));
    indices = new Indices(indexMappingFactory, mock(NodeId.class), new NullAuditEventSender(), eventBus, indicesAdapter());
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

IndexMappingFactory (org.graylog2.indexer.IndexMappingFactory)4 EventBus (com.google.common.eventbus.EventBus)3 NullAuditEventSender (org.graylog2.audit.NullAuditEventSender)3 MessageIndexTemplateProvider (org.graylog2.indexer.MessageIndexTemplateProvider)3 Node (org.graylog2.indexer.cluster.Node)3 Before (org.junit.Before)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 IgnoreIndexTemplate (org.graylog2.indexer.IgnoreIndexTemplate)1 TestIndexSet (org.graylog2.indexer.TestIndexSet)1 NodeAdapter (org.graylog2.indexer.cluster.NodeAdapter)1 Indices (org.graylog2.indexer.indices.Indices)1 NodeId (org.graylog2.plugin.system.NodeId)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1