Skip to content

Commit

Permalink
Companion changes for moving ExtensionRequest to Protobuf (#647)
Browse files Browse the repository at this point in the history
* Companion changes for moving ExtensionRequest to Protobuf

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Fixing companion changes

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

* Companion changes for moving ExtensionRequest to Protobuf

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>

---------

Signed-off-by: Sarat Vemulapalli <vemulapallisarat@gmail.com>
  • Loading branch information
saratvemulapalli authored Apr 21, 2023
1 parent 51c321c commit d122039
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/opensearch/sdk/ExtensionsRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.cluster.node.DiscoveryNode;
import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.opensearch.extensions.proto.ExtensionRequestProto;
import org.opensearch.extensions.rest.ExtensionRestRequest;
import org.opensearch.extensions.rest.RegisterRestActionsRequest;
import org.opensearch.extensions.settings.RegisterCustomSettingsRequest;
Expand All @@ -28,7 +29,6 @@
import org.opensearch.extensions.AddSettingsUpdateConsumerRequest;
import org.opensearch.extensions.UpdateSettingsRequest;
import org.opensearch.extensions.action.ExtensionActionRequest;
import org.opensearch.extensions.ExtensionsManager.RequestType;
import org.opensearch.extensions.ExtensionRequest;
import org.opensearch.extensions.ExtensionsManager;
import org.opensearch.index.IndicesModuleRequest;
Expand Down Expand Up @@ -545,7 +545,7 @@ public void sendRegisterCustomSettingsRequest(TransportService transportService)

private void sendGenericRequestWithExceptionHandling(
TransportService transportService,
RequestType requestType,
ExtensionRequestProto.RequestType requestType,
String orchestratorNameString,
TransportResponseHandler<? extends TransportResponse> responseHandler
) {
Expand All @@ -571,7 +571,7 @@ public ClusterState sendClusterStateRequest(TransportService transportService) {
transportService.sendRequest(
opensearchNode,
ExtensionsManager.REQUEST_EXTENSION_CLUSTER_STATE,
new ExtensionRequest(ExtensionsManager.RequestType.REQUEST_EXTENSION_CLUSTER_STATE),
new ExtensionRequest(ExtensionRequestProto.RequestType.REQUEST_EXTENSION_CLUSTER_STATE),
clusterStateResponseHandler
);
// Wait on cluster state response
Expand Down Expand Up @@ -599,7 +599,7 @@ public List<DiscoveryExtensionNode> sendExtensionDependencyRequest(TransportServ
transportService.sendRequest(
opensearchNode,
ExtensionsManager.REQUEST_EXTENSION_DEPENDENCY_INFORMATION,
new ExtensionRequest(ExtensionsManager.RequestType.REQUEST_EXTENSION_DEPENDENCY_INFORMATION, uniqueId),
new ExtensionRequest(ExtensionRequestProto.RequestType.REQUEST_EXTENSION_DEPENDENCY_INFORMATION, uniqueId),
extensionDependencyResponseHandler
);
// Wait on Extension Dependency response
Expand All @@ -622,7 +622,7 @@ public List<DiscoveryExtensionNode> sendExtensionDependencyRequest(TransportServ
public void sendClusterSettingsRequest(TransportService transportService) {
sendGenericRequestWithExceptionHandling(
transportService,
ExtensionsManager.RequestType.REQUEST_EXTENSION_CLUSTER_SETTINGS,
ExtensionRequestProto.RequestType.REQUEST_EXTENSION_CLUSTER_SETTINGS,
ExtensionsManager.REQUEST_EXTENSION_CLUSTER_SETTINGS,
new ClusterSettingsResponseHandler()
);
Expand All @@ -641,7 +641,7 @@ public Settings sendEnvironmentSettingsRequest(TransportService transportService
transportService.sendRequest(
opensearchNode,
ExtensionsManager.REQUEST_EXTENSION_ENVIRONMENT_SETTINGS,
new ExtensionRequest(ExtensionsManager.RequestType.REQUEST_EXTENSION_ENVIRONMENT_SETTINGS),
new ExtensionRequest(ExtensionRequestProto.RequestType.REQUEST_EXTENSION_ENVIRONMENT_SETTINGS),
environmentSettingsResponseHandler
);
// Wait on environment settings response
Expand Down

0 comments on commit d122039

Please sign in to comment.