-
Notifications
You must be signed in to change notification settings - Fork 58
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
Rename to Extensions #72
Conversation
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.
I think changing half of the instances of plugin to extension but leaving plugin around elsewhere is confusing. Can we change the method names as well?
@@ -97,16 +97,16 @@ public DiscoveryNode getOpensearchNode() { | |||
* @param pluginRequest The request to handle. |
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 still naming the parameter "plugin"?
@@ -97,16 +97,16 @@ public DiscoveryNode getOpensearchNode() { | |||
* @param pluginRequest The request to handle. | |||
* @return A response to OpenSearch validating that this is an extension. | |||
*/ | |||
PluginResponse handlePluginsRequest(PluginRequest pluginRequest) { | |||
InitializeExtensionsResponse handlePluginsRequest(InitializeExtensionsRequest pluginRequest) { |
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 is the method still handling "Plugins" request?
@@ -97,16 +97,16 @@ public DiscoveryNode getOpensearchNode() { | |||
* @param pluginRequest The request to handle. | |||
* @return A response to OpenSearch validating that this is an extension. | |||
*/ | |||
PluginResponse handlePluginsRequest(PluginRequest pluginRequest) { | |||
InitializeExtensionsResponse handlePluginsRequest(InitializeExtensionsRequest pluginRequest) { | |||
logger.info("Registering Plugin Request received from OpenSearch"); |
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.
The javadocs and log messages should be renamed consistently.
@@ -100,8 +100,8 @@ public void testHandlePluginsRequest() throws UnknownHostException { | |||
emptySet(), | |||
Version.CURRENT | |||
); | |||
PluginRequest pluginRequest = new PluginRequest(sourceNode, null); | |||
PluginResponse response = extensionsRunner.handlePluginsRequest(pluginRequest); | |||
InitializeExtensionsRequest pluginRequest = new InitializeExtensionsRequest(sourceNode, null); |
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.
similar renaming here.
PluginRequest pluginRequest = new PluginRequest(sourceNode, null); | ||
PluginResponse response = extensionsRunner.handlePluginsRequest(pluginRequest); | ||
InitializeExtensionsRequest pluginRequest = new InitializeExtensionsRequest(sourceNode, null); | ||
InitializeExtensionsResponse response = extensionsRunner.handlePluginsRequest(pluginRequest); |
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.
Same as Dan suggested.
Rename everything Plugin to Extension.
InitializeExtensionsResponse response = extensionsRunner.handlePluginsRequest(pluginRequest); | |
InitializeExtensionsResponse response = extensionsRunner.handleExtensionInitRequest(extensionInitRequest); |
Signed-off-by: mloufra <[email protected]>
Signed-off-by: mloufra <[email protected]>
Signed-off-by: mloufra <[email protected]>
Signed-off-by: mloufra <[email protected]>
@@ -99,17 +99,17 @@ public DiscoveryNode getOpensearchNode() { | |||
} | |||
|
|||
/** | |||
* Handles a plugin request from OpenSearch. This is the first request for the transport communication and will initialize the extension and will be a part of OpenSearch bootstrap. | |||
* Handles a extensions request from OpenSearch. This is the first request for the transport communication and will initialize the extension and will be a part of OpenSearch bootstrap. |
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.
extensions
-> extension
opensearchNode = pluginRequest.getSourceNode(); | ||
InitializeExtensionsResponse handleExtensionInitRequest(InitializeExtensionsRequest extensionInitRequest) { | ||
logger.info("Registering Extension Request received from OpenSearch"); | ||
InitializeExtensionsResponse initializeExtensionsResponse = new InitializeExtensionsResponse("RealExtension"); |
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.
new InitializeExtensionsResponse("RealExtension")
-> new InitializeExtensionsResponse(extensionSettings.getExtensionName())
Signed-off-by: mloufra <[email protected]>
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.
Thanks @mloufra for the changes!!
Looks like @dbwiddis requested changes, so we cannot merge this in without Dan's approval. |
As build will fail for the other PRs. Dismissing @dbwiddis changes and merging this PR. |
As build will fail for the other PRs
* issue opensearch-project#28 Signed-off-by: mloufra <[email protected]> * issue opensearch-project#28 Signed-off-by: mloufra <[email protected]> * Rename to javadoc, log message and method to extensions Signed-off-by: mloufra <[email protected]> * Rename the remaining to extensions Signed-off-by: mloufra <[email protected]> * fix bug on ExtensionsRunner.java Signed-off-by: mloufra <[email protected]> Signed-off-by: mloufra <[email protected]>
Signed-off-by: mloufra [email protected]
Description
Change the class (PluginRequest, PluginResponse) to (InitializeExtensionsRequest, InitializeExtensionsResponse), and the variable name related to class (PluginRequest, PluginResponse).
Equivalent PR on OpenSearch : opensearch-project/OpenSearch#4063
Issues Resolved
#28
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.