Skip to content

Commit

Permalink
Updating comments for unfollow action handler
Browse files Browse the repository at this point in the history
Signed-off-by: aggarwalShivani <shivani.aggarwal@nokia.com>
  • Loading branch information
aggarwalShivani committed Jun 27, 2024
1 parent afc7963 commit a807977
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ import org.opensearch.threadpool.ThreadPool
import org.opensearch.transport.TransportService


/**
* This action transforms the request from ActionRequest type to StopIndexReplicationRequest
* and performs the TransportStopIndexReplicationAction on it.
* While TransportStopIndexReplicationAction is used directly by the _stop replication REST API,
* this action is used for inter-plugin communication by ism plugin to unfollow i.e. stop replication.
*/
class TransportUnfollowIndexReplicationAction @Inject constructor (
val name: String,
val transportService: TransportService,
Expand All @@ -50,7 +56,7 @@ class TransportUnfollowIndexReplicationAction @Inject constructor (
try {

var response = client.suspendExecute(STOP_REPLICATION_ACTION_TYPE, transformedRequest, true)
log.info("Stop replication successful for index[${transformedRequest.indexName}], response: " + response.isAcknowledged)
log.info("Stop replication successful for index[${transformedRequest.indexName}] with response: " + response.isAcknowledged)
listener?.onResponse(AcknowledgedResponse(true))
} catch (e: Exception) {
log.error("Stop replication failed for index[${transformedRequest.indexName}] with error ${e.stackTraceToString()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
package org.opensearch.replication

import org.opensearch.commons.replication.action.ReplicationActions.STOP_REPLICATION_ACTION_NAME
import org.opensearch.commons.replication.action.ReplicationActions.UNFOLLOW_REPLICATION_ACTION_NAME
import org.opensearch.replication.MultiClusterAnnotations.ClusterConfiguration
import org.opensearch.replication.MultiClusterAnnotations.ClusterConfigurations
import org.opensearch.replication.MultiClusterAnnotations.getAnnotationsFromClass
Expand Down Expand Up @@ -332,7 +331,6 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.apache.hc.core5.http.io.entity.StringEntity
import org.opensearch.client.Request
import org.junit.BeforeClass
import org.opensearch.commons.replication.action.ReplicationActions.STOP_REPLICATION_ACTION_NAME
import org.opensearch.commons.replication.action.ReplicationActions.UNFOLLOW_REPLICATION_ACTION_NAME

const val INTEG_TEST_PASSWORD = "ccr-integ-test@123"

Expand Down Expand Up @@ -77,7 +76,6 @@ abstract class SecurityBase : MultiClusterRestTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down Expand Up @@ -110,7 +108,6 @@ abstract class SecurityBase : MultiClusterRestTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand All @@ -124,7 +121,6 @@ abstract class SecurityBase : MultiClusterRestTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down Expand Up @@ -157,7 +153,6 @@ abstract class SecurityBase : MultiClusterRestTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down Expand Up @@ -190,7 +185,6 @@ abstract class SecurityBase : MultiClusterRestTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down Expand Up @@ -265,7 +259,6 @@ abstract class SecurityBase : MultiClusterRestTestCase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import java.util.concurrent.TimeUnit
import org.opensearch.replication.task.autofollow.AutoFollowExecutor
import org.opensearch.tasks.TaskInfo
import org.junit.Before
import org.opensearch.commons.replication.action.ReplicationActions.UNFOLLOW_REPLICATION_ACTION_NAME
import org.opensearch.commons.replication.action.ReplicationActions.STOP_REPLICATION_ACTION_NAME

@MultiClusterAnnotations.ClusterConfigurations(
Expand Down Expand Up @@ -416,7 +415,6 @@ class SecurityCustomRolesIT: SecurityBase() {
"indices:admin/plugins/replication/index/pause",
"indices:admin/plugins/replication/index/resume",
"$STOP_REPLICATION_ACTION_NAME",
"$UNFOLLOW_REPLICATION_ACTION_NAME",
"indices:admin/plugins/replication/index/update",
"indices:admin/plugins/replication/index/status_check"
]
Expand Down

0 comments on commit a807977

Please sign in to comment.