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

Companion changes for moving ExtensionRequest to Protobuf #647

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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