From 4ba2d80313043364e4b5e384a94e6439170e9be3 Mon Sep 17 00:00:00 2001 From: Suraj Singh Date: Sun, 28 Aug 2022 21:03:58 -0700 Subject: [PATCH] Address review comments Signed-off-by: Suraj Singh --- .../kotlin/org/opensearch/replication/ReplicationPlugin.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt b/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt index 1736d275..53c77866 100644 --- a/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt +++ b/src/main/kotlin/org/opensearch/replication/ReplicationPlugin.kt @@ -76,7 +76,6 @@ import org.opensearch.action.ActionRequest import org.opensearch.action.ActionResponse import org.opensearch.client.Client import org.opensearch.cluster.NamedDiff -import org.opensearch.cluster.metadata.IndexMetadata.INDEX_REPLICATION_TYPE_SETTING import org.opensearch.cluster.metadata.IndexNameExpressionResolver import org.opensearch.cluster.metadata.Metadata import org.opensearch.cluster.metadata.RepositoryMetadata @@ -365,7 +364,7 @@ internal class ReplicationPlugin : Plugin(), ActionPlugin, PersistentTaskPlugin, return if (indexSettings.settings.get(REPLICATED_INDEX_SETTING.key) != null) { Optional.of(EngineFactory { config -> // Use NRTSegmentReplicationEngine for SEGMENT replication type indices replica shards - if (config.isReadOnlyReplica && indexSettings.settings.get(INDEX_REPLICATION_TYPE_SETTING.key) != null && indexSettings.settings.get(INDEX_REPLICATION_TYPE_SETTING.key).equals("SEGMENT")) { + if (config.isReadOnlyReplica) { NRTReplicationEngine(config) } else { ReplicationEngine(config)