Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Suraj Singh <[email protected]>
  • Loading branch information
dreamer-89 committed Aug 19, 2022
1 parent 839d1ae commit 197a35e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,9 @@ internal class ReplicationPlugin : Plugin(), ActionPlugin, PersistentTaskPlugin,
override fun getEngineFactory(indexSettings: IndexSettings): Optional<EngineFactory> {
return if (indexSettings.settings.get(REPLICATED_INDEX_SETTING.key) != null) {
Optional.of(EngineFactory { config ->
if (indexSettings.settings.get(INDEX_REPLICATION_TYPE_SETTING.key).equals("SEGMENT")) {
if (config.isReadOnlyReplica) NRTReplicationEngine(config) else ReplicationEngine(config)
// Use NRTSegmentReplicationEngine for SEGMENT replication type indices
if (config.isReadOnlyReplica && indexSettings.settings.get(INDEX_REPLICATION_TYPE_SETTING.key) != null && indexSettings.settings.get(INDEX_REPLICATION_TYPE_SETTING.key).equals("SEGMENT")) {
NRTReplicationEngine(config)
} else {
ReplicationEngine(config)
}
Expand Down

0 comments on commit 197a35e

Please sign in to comment.