ptupitsyn commented on code in PR #3104:
URL: https://github.com/apache/ignite-3/pull/3104#discussion_r1469749130
##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/compute/ClientComputeExecuteRequest.java:
##########
@@ -50,29 +53,39 @@ public class ClientComputeExecuteRequest {
public static CompletableFuture<Void> process(
ClientMessageUnpacker in,
ClientMessagePacker out,
- IgniteCompute compute,
+ IgniteComputeInternal compute,
ClusterService cluster,
- NotificationSender notificationSender) {
- var nodeName = in.tryUnpackNil() ? null : in.unpackString();
-
- var node = nodeName == null
- ? cluster.topologyService().localMember()
- : cluster.topologyService().getByConsistentId(nodeName);
-
- if (node == null) {
- throw new IgniteException("Specified node is not present in the
cluster: " + nodeName);
- }
+ NotificationSender notificationSender
+ ) {
+ Set<ClusterNode> candidates = unpackCandidateNodes(in, cluster);
List<DeploymentUnit> deploymentUnits = unpackDeploymentUnits(in);
String jobClassName = in.unpackString();
JobExecutionOptions options =
JobExecutionOptions.builder().priority(in.unpackInt()).maxRetries(in.unpackInt()).build();
Object[] args = unpackArgs(in);
- JobExecution<Object> execution = compute.executeAsync(Set.of(node),
deploymentUnits, jobClassName, options, args);
+ JobExecution<Object> execution =
compute.executeAsyncWithFailover(candidates, deploymentUnits, jobClassName,
options, args);
sendResultAndStatus(execution, notificationSender);
return execution.idAsync().thenAccept(out::packUuid);
}
+ private static Set<ClusterNode> unpackCandidateNodes(ClientMessageUnpacker
in, ClusterService cluster) {
+ int size = in.unpackInt();
+ Set<ClusterNode> nodes = new HashSet<>();
Review Comment:
```suggestion
Set<ClusterNode> nodes = new HashSet<>(size);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]