This change is required for a new feature being added in ism plugin - unfollow-action #726 - integrating ccr and ism plugins.
For this feature, ism plugin needs to invoke stop-replication action from ccr. As both ccr and ism need to invoke some common code, the common code can be moved to common-utils, as done previously for other plugins too. For ex. notifications plugin
As sharing of libraries also leads to a type-cast and class-loading issue - previously seen with notification plugin - the request object needs to be of a higher-level class from opensearch-core like ActionRequest and later be recreated into required type i.e. StopIndexReplicationRequest.
Proposed Solution:
Common-utils: Move common code of stop-replication from ccr project to common-utils.
CCR: Modify ccr plugin to consume classes from common-utils. Also, create a new TransportAction that transforms the request into required type and invokes TransportStopIndexReplicationAction.
ISM: Add new action in ism
(FYI - This is an alternative approach for this feature. I had also raised a draft PR with a different approach, but we didnt go ahead with it as it required changes in opensearch-core as well.)
Change description:
Code for StopIndexReplicationRequest and StopIndexReplicationAction are moved to common-utils. Added UTs for both the new classes added.
This PR caters to point 1 of the proposed solution.
[x] Commits are signed per the DCO using --signoff
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Description
Background:
Proposed Solution:
Change description: Code for StopIndexReplicationRequest and StopIndexReplicationAction are moved to common-utils. Added UTs for both the new classes added. This PR caters to point 1 of the proposed solution.
Issues Resolved
Related Issues unfollow-action #726
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.