Skip to content
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

Merged
merged 5 commits into from
Aug 11, 2022
Merged

Rename to Extensions #72

merged 5 commits into from
Aug 11, 2022

Conversation

mloufra
Copy link
Contributor

@mloufra mloufra commented Aug 1, 2022

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.

@mloufra mloufra requested a review from a team August 1, 2022 07:18
Copy link
Member

@dbwiddis dbwiddis left a 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.
Copy link
Member

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) {
Copy link
Member

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");
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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.

Suggested change
InitializeExtensionsResponse response = extensionsRunner.handlePluginsRequest(pluginRequest);
InitializeExtensionsResponse response = extensionsRunner.handleExtensionInitRequest(extensionInitRequest);

@@ -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.
Copy link
Member

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");
Copy link
Member

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())

Copy link
Member

@saratvemulapalli saratvemulapalli left a 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!!

@saratvemulapalli
Copy link
Member

Looks like @dbwiddis requested changes, so we cannot merge this in without Dan's approval.

@owaiskazi19
Copy link
Member

owaiskazi19 commented Aug 11, 2022

As build will fail for the other PRs. Dismissing @dbwiddis changes and merging this PR.

@owaiskazi19 owaiskazi19 dismissed dbwiddis’s stale review August 11, 2022 16:52

As build will fail for the other PRs

@owaiskazi19 owaiskazi19 merged commit fd0f070 into opensearch-project:main Aug 11, 2022
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants