From e3feafc1e95a6cb349a9f2afff80ef78ae547e2d Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Thu, 10 Sep 2020 11:06:29 +0200 Subject: [PATCH] Enable searchable snapshots in release builds (#62201) Enables searchable snapshot functionality not only in snapshot, but also release builds. --- docs/build.gradle | 1 - x-pack/plugin/build.gradle | 3 - .../SearchableSnapshotsConstants.java | 21 +- .../data-streams/qa/multi-node/build.gradle | 5 - .../plugin/data-streams/qa/rest/build.gradle | 5 - x-pack/plugin/ilm/qa/multi-node/build.gradle | 6 - .../plugin/searchable-snapshots/build.gradle | 9 - .../qa/azure/build.gradle | 4 - .../searchable-snapshots/qa/gcs/build.gradle | 4 - .../qa/minio/build.gradle | 5 - .../searchable-snapshots/qa/rest/build.gradle | 5 - .../searchable-snapshots/qa/s3/build.gradle | 4 - .../SearchableSnapshots.java | 181 +++++++----------- 13 files changed, 68 insertions(+), 185 deletions(-) diff --git a/docs/build.gradle b/docs/build.gradle index 281efdc2316..9f1a967c44e 100644 --- a/docs/build.gradle +++ b/docs/build.gradle @@ -54,7 +54,6 @@ testClusters.integTest { setting 'indices.lifecycle.history_index_enabled', 'false' if (BuildParams.isSnapshotBuild() == false) { systemProperty 'es.autoscaling_feature_flag_registered', 'true' - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' } setting 'xpack.autoscaling.enabled', 'true' setting 'xpack.eql.enabled', 'true' diff --git a/x-pack/plugin/build.gradle b/x-pack/plugin/build.gradle index 9b1cc8f105a..07ed45bf254 100644 --- a/x-pack/plugin/build.gradle +++ b/x-pack/plugin/build.gradle @@ -172,9 +172,6 @@ testClusters.all { extraConfigFile nodeKey.name, nodeKey extraConfigFile nodeCert.name, nodeCert extraConfigFile 'roles.yml', file('src/test/resources/roles.yml') - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsConstants.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsConstants.java index 53bfac59e28..211f870dc2a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsConstants.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsConstants.java @@ -5,37 +5,18 @@ */ package org.elasticsearch.xpack.searchablesnapshots; -import org.elasticsearch.Build; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import static org.elasticsearch.index.IndexModule.INDEX_STORE_TYPE_SETTING; public class SearchableSnapshotsConstants { - public static final boolean SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED; - - static { - final String property = System.getProperty("es.searchable_snapshots_feature_enabled"); - if ("true".equals(property)) { - SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED = true; - } else if ("false".equals(property)) { - SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED = false; - } else if (property == null) { - SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED = Build.CURRENT.isSnapshot(); - } else { - throw new IllegalArgumentException( - "expected es.searchable_snapshots_feature_enabled to be unset or [true|false] but was [" + property + "]" - ); - } - } - public static final String SNAPSHOT_DIRECTORY_FACTORY_KEY = "snapshot"; public static final String SNAPSHOT_RECOVERY_STATE_FACTORY_KEY = "snapshot_prewarm"; public static boolean isSearchableSnapshotStore(Settings indexSettings) { - return SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED - && SNAPSHOT_DIRECTORY_FACTORY_KEY.equals(INDEX_STORE_TYPE_SETTING.get(indexSettings)); + return SNAPSHOT_DIRECTORY_FACTORY_KEY.equals(INDEX_STORE_TYPE_SETTING.get(indexSettings)); } public static final String CACHE_FETCH_ASYNC_THREAD_POOL_NAME = "searchable_snapshots_cache_fetch_async"; diff --git a/x-pack/plugin/data-streams/qa/multi-node/build.gradle b/x-pack/plugin/data-streams/qa/multi-node/build.gradle index d8ca1d93e88..78e72a29a56 100644 --- a/x-pack/plugin/data-streams/qa/multi-node/build.gradle +++ b/x-pack/plugin/data-streams/qa/multi-node/build.gradle @@ -1,5 +1,3 @@ -import org.elasticsearch.gradle.info.BuildParams - apply plugin: 'elasticsearch.java-rest-test' File repoDir = file("$buildDir/testclusters/repo") @@ -11,9 +9,6 @@ javaRestTest { testClusters.javaRestTest { testDistribution = 'DEFAULT' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } numberOfNodes = 4 setting 'path.repo', repoDir.absolutePath diff --git a/x-pack/plugin/data-streams/qa/rest/build.gradle b/x-pack/plugin/data-streams/qa/rest/build.gradle index b9e4e48644b..8bc751a3a4c 100644 --- a/x-pack/plugin/data-streams/qa/rest/build.gradle +++ b/x-pack/plugin/data-streams/qa/rest/build.gradle @@ -1,5 +1,3 @@ -import org.elasticsearch.gradle.info.BuildParams - apply plugin: 'elasticsearch.yaml-rest-test' restResources { @@ -14,9 +12,6 @@ restResources { testClusters.all { testDistribution = 'DEFAULT' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } // Data streams is basic, but a few tests test data streams in combination with paid features setting 'xpack.license.self_generated.type', 'trial' // disable ILM history, since it disturbs tests using _all diff --git a/x-pack/plugin/ilm/qa/multi-node/build.gradle b/x-pack/plugin/ilm/qa/multi-node/build.gradle index 489a26069bc..f6ab8949307 100644 --- a/x-pack/plugin/ilm/qa/multi-node/build.gradle +++ b/x-pack/plugin/ilm/qa/multi-node/build.gradle @@ -1,6 +1,3 @@ -import org.elasticsearch.gradle.test.RestIntegTestTask -import org.elasticsearch.gradle.info.BuildParams - apply plugin: 'elasticsearch.java-rest-test' dependencies { @@ -16,9 +13,6 @@ javaRestTest { testClusters.all { testDistribution = 'DEFAULT' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } numberOfNodes = 4 setting 'path.repo', repoDir.absolutePath diff --git a/x-pack/plugin/searchable-snapshots/build.gradle b/x-pack/plugin/searchable-snapshots/build.gradle index 55f04fe3f52..a6eeefcac9e 100644 --- a/x-pack/plugin/searchable-snapshots/build.gradle +++ b/x-pack/plugin/searchable-snapshots/build.gradle @@ -1,5 +1,3 @@ -import org.elasticsearch.gradle.info.BuildParams - apply plugin: 'elasticsearch.internal-cluster-test' apply plugin: 'elasticsearch.esplugin' esplugin { @@ -39,10 +37,3 @@ def testJar = tasks.register("testJar", Jar) { artifacts { testArtifacts testJar } - -internalClusterTest { - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } -} - diff --git a/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle b/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle index 39cef6aef7e..e7918009a9f 100644 --- a/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/azure/build.gradle @@ -51,10 +51,6 @@ testClusters.integTest { testDistribution = 'DEFAULT' plugin repositoryPlugin.path - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } - keystore 'azure.client.searchable_snapshots.account', azureAccount if (azureKey != null && azureKey.isEmpty() == false) { keystore 'azure.client.searchable_snapshots.key', azureKey diff --git a/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle b/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle index 8326ceef6fc..8faee373d92 100644 --- a/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/gcs/build.gradle @@ -95,10 +95,6 @@ testClusters.integTest { testDistribution = 'DEFAULT' plugin repositoryPlugin.path - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } - keystore 'gcs.client.searchable_snapshots.credentials_file', serviceAccountFile, IGNORE_VALUE if (useFixture) { tasks.integTest.dependsOn createServiceAccountFile diff --git a/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle b/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle index 88674127824..b19ef31c970 100644 --- a/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/minio/build.gradle @@ -1,4 +1,3 @@ -import org.elasticsearch.gradle.info.BuildParams import static org.elasticsearch.gradle.PropertyNormalization.IGNORE_VALUE apply plugin: 'elasticsearch.standalone-rest-test' @@ -37,10 +36,6 @@ testClusters.integTest { testDistribution = 'DEFAULT' plugin repositoryPlugin.path - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } - keystore 's3.client.searchable_snapshots.access_key', 'access_key' keystore 's3.client.searchable_snapshots.secret_key', 'secret_key' setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle index ac83c049a8a..fc741f9728d 100644 --- a/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/rest/build.gradle @@ -1,5 +1,3 @@ -import org.elasticsearch.gradle.info.BuildParams - apply plugin: 'elasticsearch.testclusters' apply plugin: 'elasticsearch.standalone-rest-test' apply plugin: 'elasticsearch.rest-test' @@ -17,9 +15,6 @@ integTest { testClusters.integTest { testDistribution = 'DEFAULT' - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } setting 'path.repo', repoDir.absolutePath setting 'xpack.license.self_generated.type', 'trial' } diff --git a/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle b/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle index 003e272e971..db27a341e04 100644 --- a/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle +++ b/x-pack/plugin/searchable-snapshots/qa/s3/build.gradle @@ -51,10 +51,6 @@ testClusters.integTest { testDistribution = 'DEFAULT' plugin repositoryPlugin.path - if (BuildParams.isSnapshotBuild() == false) { - systemProperty 'es.searchable_snapshots_feature_enabled', 'true' - } - keystore 's3.client.searchable_snapshots.access_key', s3AccessKey keystore 's3.client.searchable_snapshots.secret_key', s3SecretKey setting 'xpack.license.self_generated.type', 'trial' diff --git a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java index 757e924d29c..e92e320740b 100644 --- a/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java +++ b/x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshots.java @@ -82,7 +82,6 @@ import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsCon import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.CACHE_FETCH_ASYNC_THREAD_POOL_SETTING; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.CACHE_PREWARMING_THREAD_POOL_NAME; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.CACHE_PREWARMING_THREAD_POOL_SETTING; -import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_BLOB_CACHE_INDEX; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_DIRECTORY_FACTORY_KEY; import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsConstants.SNAPSHOT_RECOVERY_STATE_FACTORY_KEY; @@ -173,23 +172,19 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng @Override public List> getSettings() { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return org.elasticsearch.common.collect.List.of( - SNAPSHOT_REPOSITORY_SETTING, - SNAPSHOT_SNAPSHOT_NAME_SETTING, - SNAPSHOT_SNAPSHOT_ID_SETTING, - SNAPSHOT_INDEX_NAME_SETTING, - SNAPSHOT_INDEX_ID_SETTING, - SNAPSHOT_CACHE_ENABLED_SETTING, - SNAPSHOT_CACHE_PREWARM_ENABLED_SETTING, - SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING, - SNAPSHOT_UNCACHED_CHUNK_SIZE_SETTING, - CacheService.SNAPSHOT_CACHE_SIZE_SETTING, - CacheService.SNAPSHOT_CACHE_RANGE_SIZE_SETTING - ); - } else { - return org.elasticsearch.common.collect.List.of(); - } + return org.elasticsearch.common.collect.List.of( + SNAPSHOT_REPOSITORY_SETTING, + SNAPSHOT_SNAPSHOT_NAME_SETTING, + SNAPSHOT_SNAPSHOT_ID_SETTING, + SNAPSHOT_INDEX_NAME_SETTING, + SNAPSHOT_INDEX_ID_SETTING, + SNAPSHOT_CACHE_ENABLED_SETTING, + SNAPSHOT_CACHE_PREWARM_ENABLED_SETTING, + SNAPSHOT_CACHE_EXCLUDED_FILE_TYPES_SETTING, + SNAPSHOT_UNCACHED_CHUNK_SIZE_SETTING, + CacheService.SNAPSHOT_CACHE_SIZE_SETTING, + CacheService.SNAPSHOT_CACHE_RANGE_SIZE_SETTING + ); } @Override @@ -206,42 +201,28 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng final IndexNameExpressionResolver resolver, final Supplier repositoriesServiceSupplier ) { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - final CacheService cacheService = new CacheService(new NodeEnvironmentCacheCleaner(nodeEnvironment), settings); - this.cacheService.set(cacheService); - this.repositoriesServiceSupplier = repositoriesServiceSupplier; - this.threadPool.set(threadPool); - final BlobStoreCacheService blobStoreCacheService = new BlobStoreCacheService( - clusterService, - threadPool, - client, - SNAPSHOT_BLOB_CACHE_INDEX - ); - this.blobStoreCacheService.set(blobStoreCacheService); - this.failShardsListener.set( - new FailShardsOnInvalidLicenseClusterListener(getLicenseState(), clusterService.getRerouteService()) - ); - return org.elasticsearch.common.collect.List.of(cacheService, blobStoreCacheService); - } else { - this.repositoriesServiceSupplier = () -> { - assert false : "searchable snapshots are disabled"; - return null; - }; - return org.elasticsearch.common.collect.List.of(); - } + final CacheService cacheService = new CacheService(new NodeEnvironmentCacheCleaner(nodeEnvironment), settings); + this.cacheService.set(cacheService); + this.repositoriesServiceSupplier = repositoriesServiceSupplier; + this.threadPool.set(threadPool); + final BlobStoreCacheService blobStoreCacheService = new BlobStoreCacheService( + clusterService, + threadPool, + client, + SNAPSHOT_BLOB_CACHE_INDEX + ); + this.blobStoreCacheService.set(blobStoreCacheService); + this.failShardsListener.set(new FailShardsOnInvalidLicenseClusterListener(getLicenseState(), clusterService.getRerouteService())); + return org.elasticsearch.common.collect.List.of(cacheService, blobStoreCacheService); } @Override public Collection createGuiceModules() { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - if (transportClientMode) { - return Collections.emptyList(); - } - - return Collections.singleton(b -> XPackPlugin.bindFeatureSet(b, SearchableSnapshotsFeatureSet.class)); - } else { - return org.elasticsearch.common.collect.List.of(); + if (transportClientMode) { + return Collections.emptyList(); } + + return Collections.singleton(b -> XPackPlugin.bindFeatureSet(b, SearchableSnapshotsFeatureSet.class)); } @Override @@ -261,29 +242,25 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng @Override public Map getDirectoryFactories() { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return org.elasticsearch.common.collect.Map.of(SNAPSHOT_DIRECTORY_FACTORY_KEY, (indexSettings, shardPath) -> { - final RepositoriesService repositories = repositoriesServiceSupplier.get(); - assert repositories != null; - final CacheService cache = cacheService.get(); - assert cache != null; - final ThreadPool threadPool = this.threadPool.get(); - assert threadPool != null; - final BlobStoreCacheService blobCache = blobStoreCacheService.get(); - assert blobCache != null; - return SearchableSnapshotDirectory.create( - repositories, - cache, - indexSettings, - shardPath, - System::nanoTime, - threadPool, - blobCache - ); - }); - } else { - return org.elasticsearch.common.collect.Map.of(); - } + return org.elasticsearch.common.collect.Map.of(SNAPSHOT_DIRECTORY_FACTORY_KEY, (indexSettings, shardPath) -> { + final RepositoriesService repositories = repositoriesServiceSupplier.get(); + assert repositories != null; + final CacheService cache = cacheService.get(); + assert cache != null; + final ThreadPool threadPool = this.threadPool.get(); + assert threadPool != null; + final BlobStoreCacheService blobCache = blobStoreCacheService.get(); + assert blobCache != null; + return SearchableSnapshotDirectory.create( + repositories, + cache, + indexSettings, + shardPath, + System::nanoTime, + threadPool, + blobCache + ); + }); } @Override @@ -299,16 +276,12 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng @Override public List> getActions() { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return org.elasticsearch.common.collect.List.of( - new ActionHandler<>(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class), - new ActionHandler<>(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class), - new ActionHandler<>(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class), - new ActionHandler<>(RepositoryStatsAction.INSTANCE, TransportRepositoryStatsAction.class) - ); - } else { - return org.elasticsearch.common.collect.List.of(); - } + return org.elasticsearch.common.collect.List.of( + new ActionHandler<>(SearchableSnapshotsStatsAction.INSTANCE, TransportSearchableSnapshotsStatsAction.class), + new ActionHandler<>(ClearSearchableSnapshotsCacheAction.INSTANCE, TransportClearSearchableSnapshotsCacheAction.class), + new ActionHandler<>(MountSearchableSnapshotAction.INSTANCE, TransportMountSearchableSnapshotAction.class), + new ActionHandler<>(RepositoryStatsAction.INSTANCE, TransportRepositoryStatsAction.class) + ); } public List getRestHandlers( @@ -320,25 +293,17 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng IndexNameExpressionResolver indexNameExpressionResolver, Supplier nodesInCluster ) { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return org.elasticsearch.common.collect.List.of( - new RestSearchableSnapshotsStatsAction(), - new RestClearSearchableSnapshotsCacheAction(), - new RestMountSearchableSnapshotAction(), - new RestRepositoryStatsAction() - ); - } else { - return org.elasticsearch.common.collect.List.of(); - } + return org.elasticsearch.common.collect.List.of( + new RestSearchableSnapshotsStatsAction(), + new RestClearSearchableSnapshotsCacheAction(), + new RestMountSearchableSnapshotAction(), + new RestRepositoryStatsAction() + ); } @Override public Map getExistingShardsAllocators() { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return Collections.singletonMap(SearchableSnapshotAllocator.ALLOCATOR_NAME, new SearchableSnapshotAllocator()); - } else { - return Collections.emptyMap(); - } + return org.elasticsearch.common.collect.Map.of(SearchableSnapshotAllocator.ALLOCATOR_NAME, new SearchableSnapshotAllocator()); } // overridable by tests @@ -348,30 +313,18 @@ public class SearchableSnapshots extends Plugin implements IndexStorePlugin, Eng @Override public Collection createAllocationDeciders(Settings settings, ClusterSettings clusterSettings) { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return org.elasticsearch.common.collect.List.of( - new SearchableSnapshotAllocationDecider(() -> getLicenseState().isAllowed(XPackLicenseState.Feature.SEARCHABLE_SNAPSHOTS)) - ); - } else { - return Collections.emptyList(); - } + return org.elasticsearch.common.collect.List.of( + new SearchableSnapshotAllocationDecider(() -> getLicenseState().isAllowed(XPackLicenseState.Feature.SEARCHABLE_SNAPSHOTS)) + ); } public List> getExecutorBuilders(Settings settings) { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return org.elasticsearch.common.collect.List.of(executorBuilders()); - } else { - return org.elasticsearch.common.collect.List.of(); - } + return org.elasticsearch.common.collect.List.of(executorBuilders()); } @Override public Map getRecoveryStateFactories() { - if (SEARCHABLE_SNAPSHOTS_FEATURE_ENABLED) { - return Collections.singletonMap(SNAPSHOT_RECOVERY_STATE_FACTORY_KEY, SearchableSnapshotRecoveryState::new); - } else { - return Collections.emptyMap(); - } + return Collections.singletonMap(SNAPSHOT_RECOVERY_STATE_FACTORY_KEY, SearchableSnapshotRecoveryState::new); } public static ScalingExecutorBuilder[] executorBuilders() {