diff --git a/core/src/main/java/org/elasticsearch/indices/IndicesService.java b/core/src/main/java/org/elasticsearch/indices/IndicesService.java index 35141299796d7..bfe69097b7bac 100644 --- a/core/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/core/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -476,7 +476,7 @@ private EngineFactory getEngineFactory(final IndexSettings idxSettings) { final List>> engineFactories = enginePlugins .stream() - .map(p -> Tuple.tuple(p, p.getMaybeEngineFactory(idxSettings))) + .map(p -> Tuple.tuple(p, p.getEngineFactory(idxSettings))) .filter(t -> Objects.requireNonNull(t.v2()).isPresent()) .collect(Collectors.toList()); if (engineFactories.isEmpty()) { diff --git a/core/src/main/java/org/elasticsearch/plugins/EnginePlugin.java b/core/src/main/java/org/elasticsearch/plugins/EnginePlugin.java index 9dc23bb5b5ee1..593129458717d 100644 --- a/core/src/main/java/org/elasticsearch/plugins/EnginePlugin.java +++ b/core/src/main/java/org/elasticsearch/plugins/EnginePlugin.java @@ -37,6 +37,6 @@ public interface EnginePlugin { * * @return an optional engine factory */ - Optional getMaybeEngineFactory(IndexSettings indexSettings); + Optional getEngineFactory(IndexSettings indexSettings); } diff --git a/core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java b/core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java index 7f41c6c8fd58e..96181e76ba790 100644 --- a/core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java +++ b/core/src/test/java/org/elasticsearch/indices/IndicesServiceTests.java @@ -126,7 +126,7 @@ public List> getSettings() { } @Override - public Optional getMaybeEngineFactory(final IndexSettings indexSettings) { + public Optional getEngineFactory(final IndexSettings indexSettings) { if (FOO_INDEX_SETTING.get(indexSettings.getSettings())) { return Optional.of(new FooEngineFactory()); } else { @@ -156,7 +156,7 @@ public List> getSettings() { } @Override - public Optional getMaybeEngineFactory(final IndexSettings indexSettings) { + public Optional getEngineFactory(final IndexSettings indexSettings) { if (BAR_INDEX_SETTING.get(indexSettings.getSettings())) { return Optional.of(new BarEngineFactory()); } else { diff --git a/test/framework/src/main/java/org/elasticsearch/index/MockEngineFactoryPlugin.java b/test/framework/src/main/java/org/elasticsearch/index/MockEngineFactoryPlugin.java index 5bce022a8d31e..be00d9f5ada2d 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/MockEngineFactoryPlugin.java +++ b/test/framework/src/main/java/org/elasticsearch/index/MockEngineFactoryPlugin.java @@ -44,7 +44,7 @@ public List> getSettings() { } @Override - public Optional getMaybeEngineFactory(final IndexSettings indexSettings) { + public Optional getEngineFactory(final IndexSettings indexSettings) { return Optional.of(new MockEngineFactory(getReaderWrapperClass())); }