Search in sources :

Example 1 with IndicesAdapter

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

the class IndicesIT method indicesAdapter.

protected IndicesAdapter indicesAdapter() {
    if (elasticsearch().searchServer().equals(SearchServer.ES6)) {
        return new IndicesAdapterES6(jestClient(elasticsearch()), new ObjectMapperProvider().get(), new IndexingHelper());
    } else {
        final ObjectMapper objectMapper = new ObjectMapperProvider().get();
        final ElasticsearchClient client = elasticsearchClient();
        return new IndicesAdapterES7(client, new StatsApi(objectMapper, client), new CatApi(objectMapper, client), new ClusterStateApi(objectMapper, client));
    }
}
Also used : IndexingHelper(org.graylog.storage.elasticsearch6.IndexingHelper) CatApi(org.graylog.storage.elasticsearch7.cat.CatApi) StatsApi(org.graylog.storage.elasticsearch7.stats.StatsApi) IndicesAdapterES6(org.graylog.storage.elasticsearch6.IndicesAdapterES6) ElasticsearchClient(org.graylog.storage.elasticsearch7.ElasticsearchClient) IndicesAdapterES7(org.graylog.storage.elasticsearch7.IndicesAdapterES7) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) ClusterStateApi(org.graylog.storage.elasticsearch7.cluster.ClusterStateApi) ObjectMapperProvider(org.graylog2.shared.bindings.providers.ObjectMapperProvider)

Example 2 with IndicesAdapter

use of org.graylog2.indexer.indices.IndicesAdapter 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 IndicesAdapter

use of org.graylog2.indexer.indices.IndicesAdapter 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

EventBus (com.google.common.eventbus.EventBus)2 NullAuditEventSender (org.graylog2.audit.NullAuditEventSender)2 IndexMappingFactory (org.graylog2.indexer.IndexMappingFactory)2 MessageIndexTemplateProvider (org.graylog2.indexer.MessageIndexTemplateProvider)2 Node (org.graylog2.indexer.cluster.Node)2 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 IndexingHelper (org.graylog.storage.elasticsearch6.IndexingHelper)1 IndicesAdapterES6 (org.graylog.storage.elasticsearch6.IndicesAdapterES6)1 ElasticsearchClient (org.graylog.storage.elasticsearch7.ElasticsearchClient)1 IndicesAdapterES7 (org.graylog.storage.elasticsearch7.IndicesAdapterES7)1 CatApi (org.graylog.storage.elasticsearch7.cat.CatApi)1 ClusterStateApi (org.graylog.storage.elasticsearch7.cluster.ClusterStateApi)1 StatsApi (org.graylog.storage.elasticsearch7.stats.StatsApi)1 NodeAdapter (org.graylog2.indexer.cluster.NodeAdapter)1 ObjectMapperProvider (org.graylog2.shared.bindings.providers.ObjectMapperProvider)1 Before (org.junit.Before)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1