-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Remote Reindex SPI extension #547
Add Remote Reindex SPI extension #547
Conversation
✅ DCO Check Passed c7a33e8ad58caf4e320e640494607541f1de458b |
✅ Gradle Wrapper Validation success c7a33e8ad58caf4e320e640494607541f1de458b |
✅ Gradle Precommit success c7a33e8ad58caf4e320e640494607541f1de458b |
start gradle check |
✅ Gradle Check success c7a33e8ad58caf4e320e640494607541f1de458b |
start dco check |
✅ Gradle Wrapper Validation success c7a33e8ad58caf4e320e640494607541f1de458b |
✅ DCO Check Passed c7a33e8ad58caf4e320e640494607541f1de458b |
✅ Gradle Precommit success c7a33e8ad58caf4e320e640494607541f1de458b |
import org.opensearch.index.reindex.BulkByScrollResponse; | ||
import org.opensearch.index.reindex.ReindexRequest; | ||
|
||
public interface RemoteReindexExtension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we add additional tests using this extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no implementation that is added here. Only new interface has been added. Some of the methods have new parameters added to them which should be covered by the existing unit tests.
import org.opensearch.index.reindex.BulkByScrollResponse; | ||
import org.opensearch.index.reindex.ReindexRequest; | ||
|
||
public interface RemoteReindexExtension { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add some java doc here to clarify the intent of this extension point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added javadoc
if (remoteExtension.isPresent()) { | ||
return remoteExtension.get().getRemoteReindexActionListener(listener, reindexRequest); | ||
} | ||
logger.error("Not able to load remote reindex metrics listener"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message seems confusing, in case there are no actual extensions present to the Reindexer plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the message
* Get a wrapper of ActionListener which is used to collect remote reindex metrics | ||
* @return ActionListener wrapper implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we keep the comment more generic, as action listeners could serve more purpose than just the metrics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the comment generic
c7a33e8
to
df5e901
Compare
✅ Gradle Wrapper Validation success df5e90161387b43bc4644ec24740c0d90c4cf3ee |
✅ DCO Check Passed df5e90161387b43bc4644ec24740c0d90c4cf3ee |
✅ Gradle Precommit success df5e90161387b43bc4644ec24740c0d90c4cf3ee |
start gradle check |
❌ Gradle Check failure df5e90161387b43bc4644ec24740c0d90c4cf3ee |
df5e901
to
c083694
Compare
✅ DCO Check Passed c0836948b02743ee598b7af0c5173a127f9634f8 |
✅ Gradle Wrapper Validation success c0836948b02743ee598b7af0c5173a127f9634f8 |
✅ Gradle Precommit success c0836948b02743ee598b7af0c5173a127f9634f8 |
start gradle check |
✅ Gradle Check success c0836948b02743ee598b7af0c5173a127f9634f8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
List<RemoteReindexExtension> remoteReindexExtensionList = new ArrayList<>(); | ||
iterable.forEach(remoteReindexExtensionList::add); | ||
if (remoteReindexExtensionList.isEmpty()) { | ||
logger.error("Unable to find any implementation for RemoteReindexExtension"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we logging an error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to info log.
This change extends the remote reindex SPI to allow adding a custom interceptor. This interceptor can be plugged in to perform any processing on the request or response. Signed-off-by: Sooraj Sinha <soosinha@amazon.com>
c083694
to
094e16e
Compare
✅ Gradle Wrapper Validation success 094e16e |
✅ DCO Check Passed 094e16e |
✅ Gradle Precommit success 094e16e |
start gradle check |
What version are you targeting? Do we want this in 1.0.0? If so you'll need to open a separate backport PR. |
@nknize This is targetted for 1.0.0. Can you let me know the process for a backport PR ? What version would it be backported to as 1.0.0 is not yet released ? |
This change extends the remote reindex SPI to allow adding a custom interceptor. This interceptor can be plugged in to perform any processing on the request or response. Signed-off-by: Sooraj Sinha <soosinha@amazon.com> Co-authored-by: Sooraj Sinha <81695996+soosinha@users.noreply.github.com>
Description
This change extends the remote reindex SPI to allow adding a custom interceptor.
This interceptor can be plugged in to perform any processing on the request or response like signing the request using IAM.
Issues Resolved
closes: #511
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.