-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
05.09.2024 Merge 'apache/main' into feature branch
- Loading branch information
Showing
356 changed files
with
10,426 additions
and
3,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
modules/api/src/main/java/org/apache/ignite/compute/TaskExecution.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.ignite.compute; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.stream.Collectors; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* Compute task control object. Methods inherited from the {@link JobExecution} allows control of the task coordination job. | ||
* | ||
* @param <R> Task result type. | ||
*/ | ||
public interface TaskExecution<R> extends JobExecution<R> { | ||
/** | ||
* Returns a collection of statuses of the jobs which are executing under this task. The resulting future is completed only after the | ||
* jobs are submitted for execution. The list could contain {@code null} values if the time for retaining job status has been exceeded. | ||
* | ||
* @return A list of current statuses of the jobs. | ||
*/ | ||
CompletableFuture<List<@Nullable JobStatus>> statusesAsync(); | ||
|
||
/** | ||
* Returns a collection of ids of the jobs which are executing under this task. The resulting future is completed only after the | ||
* jobs are submitted for execution. The list could contain {@code null} values if the time for retaining job status has been exceeded. | ||
* | ||
* @return A list of ids of the jobs. | ||
*/ | ||
default CompletableFuture<List<@Nullable UUID>> idsAsync() { | ||
return statusesAsync().thenApply(statuses -> statuses.stream() | ||
.map(jobStatus -> jobStatus != null ? jobStatus.id() : null) | ||
.collect(Collectors.toList())); | ||
} | ||
} |
Oops, something went wrong.