mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Add enable checks to missing enrich plugin methods (#47187)
Some of the server side objects that do not need to be created unless enrich is enabled were still being created. This commit fixes that.
This commit is contained in:
parent
fe937ea4b8
commit
0e1b77568a
@ -63,6 +63,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static org.elasticsearch.xpack.core.XPackSettings.ENRICH_ENABLED_SETTING;
|
||||
|
||||
public class EnrichPlugin extends Plugin implements ActionPlugin, IngestPlugin {
|
||||
@ -104,6 +105,10 @@ public class EnrichPlugin extends Plugin implements ActionPlugin, IngestPlugin {
|
||||
|
||||
@Override
|
||||
public Map<String, Processor.Factory> getProcessors(Processor.Parameters parameters) {
|
||||
if (enabled == false) {
|
||||
return emptyMap();
|
||||
}
|
||||
|
||||
EnrichProcessorFactory factory = new EnrichProcessorFactory(parameters.client);
|
||||
parameters.ingestService.addIngestClusterStateListener(factory);
|
||||
return Collections.singletonMap(EnrichProcessorFactory.TYPE, factory);
|
||||
@ -153,6 +158,7 @@ public class EnrichPlugin extends Plugin implements ActionPlugin, IngestPlugin {
|
||||
if (enabled == false || transportClientMode) {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
EnrichPolicyLocks enrichPolicyLocks = new EnrichPolicyLocks();
|
||||
EnrichPolicyExecutor enrichPolicyExecutor = new EnrichPolicyExecutor(settings, clusterService, client, threadPool,
|
||||
new IndexNameExpressionResolver(), enrichPolicyLocks, System::currentTimeMillis);
|
||||
|
Loading…
x
Reference in New Issue
Block a user