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

[Feature/extensions] Rename to extensions #3951

Closed
1 change: 1 addition & 0 deletions git-secrets
Submodule git-secrets added at b9e96b
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
*
* @opensearch.internal
*/
public class PluginRequest extends TransportRequest {
public class InitializeExtensionsRequest extends TransportRequest {
private final DiscoveryNode sourceNode;
/*
* TODO change DiscoveryNode to Extension information
*/
private final List<DiscoveryExtension> extensions;

public PluginRequest(DiscoveryNode sourceNode, List<DiscoveryExtension> extensions) {
public InitializeExtensionsRequest(DiscoveryNode sourceNode, List<DiscoveryExtension> extensions) {
this.sourceNode = sourceNode;
this.extensions = extensions;
}

public PluginRequest(StreamInput in) throws IOException {
public InitializeExtensionsRequest(StreamInput in) throws IOException {
super(in);
sourceNode = new DiscoveryNode(in);
extensions = in.readList(DiscoveryExtension::new);
Expand Down Expand Up @@ -65,7 +65,7 @@ public String toString() {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PluginRequest that = (PluginRequest) o;
InitializeExtensionsRequest that = (InitializeExtensionsRequest) o;
return Objects.equals(sourceNode, that.sourceNode) && Objects.equals(extensions, that.extensions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
*
* @opensearch.internal
*/
public class PluginResponse extends TransportResponse {
public class InitializeExtensionsResponse extends TransportResponse {
private String name;

public PluginResponse(String name) {
public InitializeExtensionsResponse(String name) {
this.name = name;
}

public PluginResponse(StreamInput in) throws IOException {
public InitializeExtensionsResponse(StreamInput in) throws IOException {
name = in.readString();
}

Expand All @@ -77,7 +77,7 @@ public String toString() {
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PluginResponse that = (PluginResponse) o;
InitializeExtensionsResponse that = (InitializeExtensionsResponse) o;
return Objects.equals(name, that.name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
import org.opensearch.common.io.stream.StreamInput;
import org.opensearch.common.settings.Settings;
import org.opensearch.common.transport.TransportAddress;
import org.opensearch.discovery.PluginRequest;
import org.opensearch.discovery.PluginResponse;
import org.opensearch.discovery.InitializeExtensionsRequest;
import org.opensearch.discovery.InitializeExtensionsResponse;
import org.opensearch.extensions.ExtensionsSettings.Extension;
import org.opensearch.index.IndexModule;
import org.opensearch.index.IndexService;
Expand Down Expand Up @@ -208,15 +208,16 @@ public void extensionsInitialize() {

private void extensionInitialize(DiscoveryNode extensionNode) {

final TransportResponseHandler<PluginResponse> pluginResponseHandler = new TransportResponseHandler<PluginResponse>() {
final TransportResponseHandler<InitializeExtensionsResponse> pluginResponseHandler = new TransportResponseHandler<
InitializeExtensionsResponse>() {

@Override
public PluginResponse read(StreamInput in) throws IOException {
return new PluginResponse(in);
public InitializeExtensionsResponse read(StreamInput in) throws IOException {
return new InitializeExtensionsResponse(in);
}

@Override
public void handleResponse(PluginResponse response) {
public void handleResponse(InitializeExtensionsResponse response) {
for (DiscoveryExtension extension : extensionsList) {
if (extension.getName().equals(response.getName())) {
extensionsInitializedList.add(extension);
Expand All @@ -240,7 +241,7 @@ public String executor() {
transportService.sendRequest(
extensionNode,
REQUEST_EXTENSION_ACTION_NAME,
new PluginRequest(transportService.getLocalNode(), new ArrayList<DiscoveryExtension>(extensionsList)),
new InitializeExtensionsRequest(transportService.getLocalNode(), new ArrayList<DiscoveryExtension>(extensionsList)),
pluginResponseHandler
);
} catch (Exception e) {
Expand Down