Search in sources :

Example 1 with IngestService

use of org.opensearch.ingest.IngestService in project OpenSearch by opensearch-project.

the class GeoIpProcessorNonIngestNodeIT method assertDatabaseLoadStatus.

private void assertDatabaseLoadStatus(final String node, final boolean loaded) {
    final IngestService ingestService = internalCluster().getInstance(IngestService.class, node);
    final GeoIpProcessor.Factory factory = (GeoIpProcessor.Factory) ingestService.getProcessorFactories().get("geoip");
    for (final DatabaseReaderLazyLoader loader : factory.databaseReaders().values()) {
        if (loaded) {
            assertNotNull(loader.databaseReader.get());
        } else {
            assertNull(loader.databaseReader.get());
        }
    }
}
Also used : IngestService(org.opensearch.ingest.IngestService)

Example 2 with IngestService

use of org.opensearch.ingest.IngestService in project OpenSearch by opensearch-project.

the class TransportBulkActionIngestTests method testFindDefaultPipelineFromTemplateMatch.

public void testFindDefaultPipelineFromTemplateMatch() {
    Exception exception = new Exception("fake exception");
    ClusterState state = clusterService.state();
    ImmutableOpenMap.Builder<String, IndexTemplateMetadata> templateMetadataBuilder = ImmutableOpenMap.builder();
    templateMetadataBuilder.put("template1", IndexTemplateMetadata.builder("template1").patterns(Arrays.asList("missing_index")).order(1).settings(Settings.builder().put(IndexSettings.DEFAULT_PIPELINE.getKey(), "pipeline1").build()).build());
    templateMetadataBuilder.put("template2", IndexTemplateMetadata.builder("template2").patterns(Arrays.asList("missing_*")).order(2).settings(Settings.builder().put(IndexSettings.DEFAULT_PIPELINE.getKey(), "pipeline2").build()).build());
    templateMetadataBuilder.put("template3", IndexTemplateMetadata.builder("template3").patterns(Arrays.asList("missing*")).order(3).build());
    templateMetadataBuilder.put("template4", IndexTemplateMetadata.builder("template4").patterns(Arrays.asList("nope")).order(4).settings(Settings.builder().put(IndexSettings.DEFAULT_PIPELINE.getKey(), "pipeline4").build()).build());
    Metadata metadata = mock(Metadata.class);
    when(state.metadata()).thenReturn(metadata);
    when(state.getMetadata()).thenReturn(metadata);
    when(metadata.templates()).thenReturn(templateMetadataBuilder.build());
    when(metadata.getTemplates()).thenReturn(templateMetadataBuilder.build());
    when(metadata.indices()).thenReturn(ImmutableOpenMap.of());
    IndexRequest indexRequest = new IndexRequest("missing_index").id("id");
    indexRequest.source(emptyMap());
    AtomicBoolean responseCalled = new AtomicBoolean(false);
    AtomicBoolean failureCalled = new AtomicBoolean(false);
    singleItemBulkWriteAction.execute(null, indexRequest, ActionListener.wrap(response -> responseCalled.set(true), e -> {
        assertThat(e, sameInstance(exception));
        failureCalled.set(true);
    }));
    assertEquals("pipeline2", indexRequest.getPipeline());
    verify(ingestService).executeBulkRequest(eq(1), bulkDocsItr.capture(), failureHandler.capture(), completionHandler.capture(), any(), eq(Names.WRITE));
}
Also used : ImmutableOpenMap(org.opensearch.common.collect.ImmutableOpenMap) Arrays(java.util.Arrays) Metadata(org.opensearch.cluster.metadata.Metadata) IndexResponse(org.opensearch.action.index.IndexResponse) Version(org.opensearch.Version) ThreadContext(org.opensearch.common.util.concurrent.ThreadContext) ClusterStateApplier(org.opensearch.cluster.ClusterStateApplier) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) ComposableIndexTemplate(org.opensearch.cluster.metadata.ComposableIndexTemplate) Map(java.util.Map) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ActionListener(org.opensearch.action.ActionListener) TimeValue(org.opensearch.common.unit.TimeValue) IndexingPressureService(org.opensearch.index.IndexingPressureService) OpenSearchTestCase(org.opensearch.test.OpenSearchTestCase) Settings(org.opensearch.common.settings.Settings) Task(org.opensearch.tasks.Task) TransportService(org.opensearch.transport.TransportService) Nullable(org.opensearch.common.Nullable) ActionFilters(org.opensearch.action.support.ActionFilters) ActionTestUtils(org.opensearch.action.support.ActionTestUtils) IndexSettings(org.opensearch.index.IndexSettings) IndexAction(org.opensearch.action.index.IndexAction) UpdateRequest(org.opensearch.action.update.UpdateRequest) Mockito.any(org.mockito.Mockito.any) Matchers.containsString(org.hamcrest.Matchers.containsString) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) Names(org.opensearch.threadpool.ThreadPool.Names) Mockito.eq(org.mockito.Mockito.eq) Mockito.mock(org.mockito.Mockito.mock) MapBuilder(org.opensearch.common.collect.MapBuilder) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ThreadPool(org.opensearch.threadpool.ThreadPool) DocWriteRequest(org.opensearch.action.DocWriteRequest) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Template(org.opensearch.cluster.metadata.Template) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) OpenSearchExecutors(org.opensearch.common.util.concurrent.OpenSearchExecutors) AutoCreateIndex(org.opensearch.action.support.AutoCreateIndex) ClusterState(org.opensearch.cluster.ClusterState) ArgumentCaptor(org.mockito.ArgumentCaptor) VersionUtils(org.opensearch.test.VersionUtils) BiConsumer(java.util.function.BiConsumer) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Mockito.anyString(org.mockito.Mockito.anyString) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) Collections.emptyMap(java.util.Collections.emptyMap) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) IngestService(org.opensearch.ingest.IngestService) Iterator(java.util.Iterator) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) TransportResponseHandler(org.opensearch.transport.TransportResponseHandler) CreateIndexResponse(org.opensearch.action.admin.indices.create.CreateIndexResponse) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) SystemIndices(org.opensearch.indices.SystemIndices) Mockito.never(org.mockito.Mockito.never) AtomicArray(org.opensearch.common.util.concurrent.AtomicArray) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) ClusterService(org.opensearch.cluster.service.ClusterService) Mockito.anyInt(org.mockito.Mockito.anyInt) IndexRequest(org.opensearch.action.index.IndexRequest) Collections(java.util.Collections) Mockito.reset(org.mockito.Mockito.reset) ClusterChangedEvent(org.opensearch.cluster.ClusterChangedEvent) ClusterState(org.opensearch.cluster.ClusterState) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) Metadata(org.opensearch.cluster.metadata.Metadata) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) Matchers.containsString(org.hamcrest.Matchers.containsString) Mockito.anyString(org.mockito.Mockito.anyString) ImmutableOpenMap(org.opensearch.common.collect.ImmutableOpenMap) IndexRequest(org.opensearch.action.index.IndexRequest) IndexNotFoundException(org.opensearch.index.IndexNotFoundException)

Example 3 with IngestService

use of org.opensearch.ingest.IngestService in project OpenSearch by opensearch-project.

the class TransportBulkActionIngestTests method testSingleItemBulkActionIngestLocal.

public void testSingleItemBulkActionIngestLocal() throws Exception {
    Exception exception = new Exception("fake exception");
    IndexRequest indexRequest = new IndexRequest("index").id("id");
    indexRequest.source(emptyMap());
    indexRequest.setPipeline("testpipeline");
    AtomicBoolean responseCalled = new AtomicBoolean(false);
    AtomicBoolean failureCalled = new AtomicBoolean(false);
    singleItemBulkWriteAction.execute(null, indexRequest, ActionListener.wrap(response -> {
        responseCalled.set(true);
    }, e -> {
        assertThat(e, sameInstance(exception));
        failureCalled.set(true);
    }));
    // check failure works, and passes through to the listener
    // haven't executed yet
    assertFalse(action.isExecuted);
    assertFalse(responseCalled.get());
    assertFalse(failureCalled.get());
    verify(ingestService).executeBulkRequest(eq(1), bulkDocsItr.capture(), failureHandler.capture(), completionHandler.capture(), any(), eq(Names.WRITE));
    completionHandler.getValue().accept(null, exception);
    assertTrue(failureCalled.get());
    // now check success
    // this is done by the real pipeline execution service when processing
    indexRequest.setPipeline(IngestService.NOOP_PIPELINE_NAME);
    completionHandler.getValue().accept(DUMMY_WRITE_THREAD, null);
    assertTrue(action.isExecuted);
    // listener would only be called by real index action, not our mocked one
    assertFalse(responseCalled.get());
    verifyNoInteractions(transportService);
}
Also used : ImmutableOpenMap(org.opensearch.common.collect.ImmutableOpenMap) Arrays(java.util.Arrays) Metadata(org.opensearch.cluster.metadata.Metadata) IndexResponse(org.opensearch.action.index.IndexResponse) Version(org.opensearch.Version) ThreadContext(org.opensearch.common.util.concurrent.ThreadContext) ClusterStateApplier(org.opensearch.cluster.ClusterStateApplier) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) ComposableIndexTemplate(org.opensearch.cluster.metadata.ComposableIndexTemplate) Map(java.util.Map) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ActionListener(org.opensearch.action.ActionListener) TimeValue(org.opensearch.common.unit.TimeValue) IndexingPressureService(org.opensearch.index.IndexingPressureService) OpenSearchTestCase(org.opensearch.test.OpenSearchTestCase) Settings(org.opensearch.common.settings.Settings) Task(org.opensearch.tasks.Task) TransportService(org.opensearch.transport.TransportService) Nullable(org.opensearch.common.Nullable) ActionFilters(org.opensearch.action.support.ActionFilters) ActionTestUtils(org.opensearch.action.support.ActionTestUtils) IndexSettings(org.opensearch.index.IndexSettings) IndexAction(org.opensearch.action.index.IndexAction) UpdateRequest(org.opensearch.action.update.UpdateRequest) Mockito.any(org.mockito.Mockito.any) Matchers.containsString(org.hamcrest.Matchers.containsString) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) Names(org.opensearch.threadpool.ThreadPool.Names) Mockito.eq(org.mockito.Mockito.eq) Mockito.mock(org.mockito.Mockito.mock) MapBuilder(org.opensearch.common.collect.MapBuilder) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ThreadPool(org.opensearch.threadpool.ThreadPool) DocWriteRequest(org.opensearch.action.DocWriteRequest) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Template(org.opensearch.cluster.metadata.Template) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) OpenSearchExecutors(org.opensearch.common.util.concurrent.OpenSearchExecutors) AutoCreateIndex(org.opensearch.action.support.AutoCreateIndex) ClusterState(org.opensearch.cluster.ClusterState) ArgumentCaptor(org.mockito.ArgumentCaptor) VersionUtils(org.opensearch.test.VersionUtils) BiConsumer(java.util.function.BiConsumer) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Mockito.anyString(org.mockito.Mockito.anyString) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) Collections.emptyMap(java.util.Collections.emptyMap) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) IngestService(org.opensearch.ingest.IngestService) Iterator(java.util.Iterator) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) TransportResponseHandler(org.opensearch.transport.TransportResponseHandler) CreateIndexResponse(org.opensearch.action.admin.indices.create.CreateIndexResponse) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) SystemIndices(org.opensearch.indices.SystemIndices) Mockito.never(org.mockito.Mockito.never) AtomicArray(org.opensearch.common.util.concurrent.AtomicArray) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) ClusterService(org.opensearch.cluster.service.ClusterService) Mockito.anyInt(org.mockito.Mockito.anyInt) IndexRequest(org.opensearch.action.index.IndexRequest) Collections(java.util.Collections) Mockito.reset(org.mockito.Mockito.reset) ClusterChangedEvent(org.opensearch.cluster.ClusterChangedEvent) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IndexRequest(org.opensearch.action.index.IndexRequest) IndexNotFoundException(org.opensearch.index.IndexNotFoundException)

Example 4 with IngestService

use of org.opensearch.ingest.IngestService in project OpenSearch by opensearch-project.

the class TransportBulkActionIngestTests method testFindDefaultPipelineFromV2TemplateMatch.

public void testFindDefaultPipelineFromV2TemplateMatch() {
    Exception exception = new Exception("fake exception");
    ComposableIndexTemplate t1 = new ComposableIndexTemplate(Collections.singletonList("missing_*"), new Template(Settings.builder().put(IndexSettings.DEFAULT_PIPELINE.getKey(), "pipeline2").build(), null, null), null, null, null, null, null);
    ClusterState state = clusterService.state();
    Metadata metadata = Metadata.builder().put("my-template", t1).build();
    when(state.metadata()).thenReturn(metadata);
    when(state.getMetadata()).thenReturn(metadata);
    IndexRequest indexRequest = new IndexRequest("missing_index").id("id");
    indexRequest.source(emptyMap());
    AtomicBoolean responseCalled = new AtomicBoolean(false);
    AtomicBoolean failureCalled = new AtomicBoolean(false);
    singleItemBulkWriteAction.execute(null, indexRequest, ActionListener.wrap(response -> responseCalled.set(true), e -> {
        assertThat(e, sameInstance(exception));
        failureCalled.set(true);
    }));
    assertEquals("pipeline2", indexRequest.getPipeline());
    verify(ingestService).executeBulkRequest(eq(1), bulkDocsItr.capture(), failureHandler.capture(), completionHandler.capture(), any(), eq(Names.WRITE));
}
Also used : ImmutableOpenMap(org.opensearch.common.collect.ImmutableOpenMap) Arrays(java.util.Arrays) Metadata(org.opensearch.cluster.metadata.Metadata) IndexResponse(org.opensearch.action.index.IndexResponse) Version(org.opensearch.Version) ThreadContext(org.opensearch.common.util.concurrent.ThreadContext) ClusterStateApplier(org.opensearch.cluster.ClusterStateApplier) Mockito.verifyNoInteractions(org.mockito.Mockito.verifyNoInteractions) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) ComposableIndexTemplate(org.opensearch.cluster.metadata.ComposableIndexTemplate) Map(java.util.Map) Mockito.doAnswer(org.mockito.Mockito.doAnswer) ActionListener(org.opensearch.action.ActionListener) TimeValue(org.opensearch.common.unit.TimeValue) IndexingPressureService(org.opensearch.index.IndexingPressureService) OpenSearchTestCase(org.opensearch.test.OpenSearchTestCase) Settings(org.opensearch.common.settings.Settings) Task(org.opensearch.tasks.Task) TransportService(org.opensearch.transport.TransportService) Nullable(org.opensearch.common.Nullable) ActionFilters(org.opensearch.action.support.ActionFilters) ActionTestUtils(org.opensearch.action.support.ActionTestUtils) IndexSettings(org.opensearch.index.IndexSettings) IndexAction(org.opensearch.action.index.IndexAction) UpdateRequest(org.opensearch.action.update.UpdateRequest) Mockito.any(org.mockito.Mockito.any) Matchers.containsString(org.hamcrest.Matchers.containsString) IndexNameExpressionResolver(org.opensearch.cluster.metadata.IndexNameExpressionResolver) Names(org.opensearch.threadpool.ThreadPool.Names) Mockito.eq(org.mockito.Mockito.eq) Mockito.mock(org.mockito.Mockito.mock) MapBuilder(org.opensearch.common.collect.MapBuilder) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ThreadPool(org.opensearch.threadpool.ThreadPool) DocWriteRequest(org.opensearch.action.DocWriteRequest) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Template(org.opensearch.cluster.metadata.Template) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) OpenSearchExecutors(org.opensearch.common.util.concurrent.OpenSearchExecutors) AutoCreateIndex(org.opensearch.action.support.AutoCreateIndex) ClusterState(org.opensearch.cluster.ClusterState) ArgumentCaptor(org.mockito.ArgumentCaptor) VersionUtils(org.opensearch.test.VersionUtils) BiConsumer(java.util.function.BiConsumer) ClusterSettings(org.opensearch.common.settings.ClusterSettings) Mockito.anyString(org.mockito.Mockito.anyString) ExecutorService(java.util.concurrent.ExecutorService) Before(org.junit.Before) Collections.emptyMap(java.util.Collections.emptyMap) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) IngestService(org.opensearch.ingest.IngestService) Iterator(java.util.Iterator) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) TransportResponseHandler(org.opensearch.transport.TransportResponseHandler) CreateIndexResponse(org.opensearch.action.admin.indices.create.CreateIndexResponse) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) SystemIndices(org.opensearch.indices.SystemIndices) Mockito.never(org.mockito.Mockito.never) AtomicArray(org.opensearch.common.util.concurrent.AtomicArray) Matchers.sameInstance(org.hamcrest.Matchers.sameInstance) ClusterService(org.opensearch.cluster.service.ClusterService) Mockito.anyInt(org.mockito.Mockito.anyInt) IndexRequest(org.opensearch.action.index.IndexRequest) Collections(java.util.Collections) Mockito.reset(org.mockito.Mockito.reset) ClusterChangedEvent(org.opensearch.cluster.ClusterChangedEvent) ComposableIndexTemplate(org.opensearch.cluster.metadata.ComposableIndexTemplate) ClusterState(org.opensearch.cluster.ClusterState) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Metadata(org.opensearch.cluster.metadata.Metadata) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) IndexRequest(org.opensearch.action.index.IndexRequest) IndexNotFoundException(org.opensearch.index.IndexNotFoundException) ComposableIndexTemplate(org.opensearch.cluster.metadata.ComposableIndexTemplate) Template(org.opensearch.cluster.metadata.Template)

Example 5 with IngestService

use of org.opensearch.ingest.IngestService in project OpenSearch by opensearch-project.

the class TransportBulkActionIngestTests method setupAction.

@Before
public void setupAction() {
    // initialize captors, which must be members to use @Capture because of generics
    threadPool = mock(ThreadPool.class);
    final ExecutorService direct = OpenSearchExecutors.newDirectExecutorService();
    when(threadPool.executor(anyString())).thenReturn(direct);
    bulkDocsItr = ArgumentCaptor.forClass(Iterable.class);
    failureHandler = ArgumentCaptor.forClass(BiConsumer.class);
    completionHandler = ArgumentCaptor.forClass(BiConsumer.class);
    remoteResponseHandler = ArgumentCaptor.forClass(TransportResponseHandler.class);
    // setup services that will be called by action
    transportService = mock(TransportService.class);
    clusterService = mock(ClusterService.class);
    localIngest = true;
    // setup nodes for local and remote
    DiscoveryNode localNode = mock(DiscoveryNode.class);
    when(localNode.isIngestNode()).thenAnswer(stub -> localIngest);
    when(clusterService.localNode()).thenReturn(localNode);
    remoteNode1 = mock(DiscoveryNode.class);
    remoteNode2 = mock(DiscoveryNode.class);
    nodes = mock(DiscoveryNodes.class);
    ImmutableOpenMap<String, DiscoveryNode> ingestNodes = ImmutableOpenMap.<String, DiscoveryNode>builder(2).fPut("node1", remoteNode1).fPut("node2", remoteNode2).build();
    when(nodes.getIngestNodes()).thenReturn(ingestNodes);
    when(nodes.getMinNodeVersion()).thenReturn(VersionUtils.randomCompatibleVersion(random(), Version.CURRENT));
    ClusterState state = mock(ClusterState.class);
    when(state.getNodes()).thenReturn(nodes);
    Metadata metadata = Metadata.builder().indices(ImmutableOpenMap.<String, IndexMetadata>builder().putAll(MapBuilder.<String, IndexMetadata>newMapBuilder().put(WITH_DEFAULT_PIPELINE, IndexMetadata.builder(WITH_DEFAULT_PIPELINE).settings(settings(Version.CURRENT).put(IndexSettings.DEFAULT_PIPELINE.getKey(), "default_pipeline").build()).putAlias(AliasMetadata.builder(WITH_DEFAULT_PIPELINE_ALIAS).build()).numberOfShards(1).numberOfReplicas(1).build()).put(".system", IndexMetadata.builder(".system").settings(settings(Version.CURRENT)).system(true).numberOfShards(1).numberOfReplicas(0).build()).map()).build()).build();
    when(state.getMetadata()).thenReturn(metadata);
    when(state.metadata()).thenReturn(metadata);
    when(clusterService.state()).thenReturn(state);
    doAnswer(invocation -> {
        ClusterChangedEvent event = mock(ClusterChangedEvent.class);
        when(event.state()).thenReturn(state);
        ((ClusterStateApplier) invocation.getArguments()[0]).applyClusterState(event);
        return null;
    }).when(clusterService).addStateApplier(any(ClusterStateApplier.class));
    // setup the mocked ingest service for capturing calls
    ingestService = mock(IngestService.class);
    action = new TestTransportBulkAction();
    singleItemBulkWriteAction = new TestSingleItemBulkWriteAction(action);
    // call on construction of action
    reset(transportService);
}
Also used : ClusterState(org.opensearch.cluster.ClusterState) DiscoveryNode(org.opensearch.cluster.node.DiscoveryNode) IngestService(org.opensearch.ingest.IngestService) ThreadPool(org.opensearch.threadpool.ThreadPool) TransportResponseHandler(org.opensearch.transport.TransportResponseHandler) Metadata(org.opensearch.cluster.metadata.Metadata) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) AliasMetadata(org.opensearch.cluster.metadata.AliasMetadata) IndexTemplateMetadata(org.opensearch.cluster.metadata.IndexTemplateMetadata) ClusterChangedEvent(org.opensearch.cluster.ClusterChangedEvent) Matchers.containsString(org.hamcrest.Matchers.containsString) Mockito.anyString(org.mockito.Mockito.anyString) ClusterService(org.opensearch.cluster.service.ClusterService) TransportService(org.opensearch.transport.TransportService) ExecutorService(java.util.concurrent.ExecutorService) IndexMetadata(org.opensearch.cluster.metadata.IndexMetadata) ClusterStateApplier(org.opensearch.cluster.ClusterStateApplier) BiConsumer(java.util.function.BiConsumer) DiscoveryNodes(org.opensearch.cluster.node.DiscoveryNodes) Before(org.junit.Before)

Aggregations

IngestService (org.opensearch.ingest.IngestService)14 Matchers.containsString (org.hamcrest.Matchers.containsString)13 Before (org.junit.Before)13 ExecutorService (java.util.concurrent.ExecutorService)12 BiConsumer (java.util.function.BiConsumer)12 Mockito.anyString (org.mockito.Mockito.anyString)12 ClusterChangedEvent (org.opensearch.cluster.ClusterChangedEvent)12 ClusterState (org.opensearch.cluster.ClusterState)12 ClusterStateApplier (org.opensearch.cluster.ClusterStateApplier)12 AliasMetadata (org.opensearch.cluster.metadata.AliasMetadata)12 Arrays (java.util.Arrays)11 Collections (java.util.Collections)11 Collections.emptyMap (java.util.Collections.emptyMap)11 Iterator (java.util.Iterator)11 Map (java.util.Map)11 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)11 Matchers.sameInstance (org.hamcrest.Matchers.sameInstance)11 ArgumentCaptor (org.mockito.ArgumentCaptor)11 Mockito.any (org.mockito.Mockito.any)11 Mockito.anyInt (org.mockito.Mockito.anyInt)11