Skip to content

Commit

Permalink
05.09.2024 Merge 'apache/main' into feature branch
Browse files Browse the repository at this point in the history
  • Loading branch information
vldpyatkov committed May 8, 2024
2 parents e5d2dbe + 49e0cc5 commit c947675
Show file tree
Hide file tree
Showing 356 changed files with 10,426 additions and 3,322 deletions.
2 changes: 1 addition & 1 deletion check-rules/spotbugs-excludes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
<Match>
<!-- TODO: https://issues.apache.org/jira/browse/IGNITE-21692 -->
<Bug pattern="UPM_UNCALLED_PRIVATE_METHOD"/>
<Class name="org.apache.ignite.internal.pagememory.freelist.AbstractFreeList"/>
<Class name="org.apache.ignite.internal.pagememory.freelist.FreeListImpl"/>
<Method name="initReusedPage"/>
</Match>
<Match>
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ micronautSecurity="3.11.1"
micronautReactor="2.6.0"
mockito = "5.11.0"
picocli = "4.7.5"
slf4j = "2.0.12"
slf4j = "2.0.13"
log4j = "2.23.0"
spoon = "10.4.3-beta-20"
swagger = "2.2.20"
Expand Down Expand Up @@ -80,7 +80,7 @@ awaitility = "4.2.1"
progressBar = "0.9.4"
guava = "33.1.0-jre"
jna = "5.14.0"
tree-sitter = "0.22.2"
tree-sitter = "0.22.5"
tree-sitter-json = "0.21.0"
tree-sitter-sql = "gh-pages"

Expand All @@ -95,13 +95,13 @@ openapiGenerator = "org.openapi.generator:7.5.0"
javacc = "com.intershop.gradle.javacc:4.1.3"
shadow = "com.github.johnrengelman.shadow:8.1.1"
cmake = "net.freudasoft.gradle-cmake-plugin:0.0.4"
nebula = "com.netflix.nebula.ospackage:11.8.1"
nebula = "com.netflix.nebula.ospackage:11.9.0"
docker = "com.palantir.docker:0.36.0"
checksum = "org.gradle.crypto.checksum:1.4.0"
setupbuilder = "de.inetsoftware.setupbuilder:7.2.21"
aggregateJavadoc = "io.freefair.aggregate-javadoc:6.6.3"
ideaext = "org.jetbrains.gradle.plugin.idea-ext:1.1.8"
spotbugs = "com.github.spotbugs:6.0.12"
spotbugs = "com.github.spotbugs:6.0.14"


[libraries]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
*
* @param <R> Job result type.
*/

public interface ComputeJob<R> {
/**
* Executes the job on an Ignite node.
*
* @param context The execution context.
* @param args Job arguments.
* @param context The execution context.
* @param args Job arguments.
* @return Job result.
*/
R execute(JobExecutionContext context, Object... args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
import org.apache.ignite.compute.task.MapReduceTask;
import org.apache.ignite.network.ClusterNode;
import org.apache.ignite.table.Tuple;
import org.apache.ignite.table.mapper.Mapper;
Expand All @@ -46,7 +47,7 @@ public interface IgniteCompute {
* @param nodes Candidate nodes; the job will be executed on one of them.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Job execution object.
*/
Expand Down Expand Up @@ -86,7 +87,7 @@ default <R> JobExecution<R> submit(
* @param nodes Candidate nodes; the job will be executed on one of them.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Job result future.
*/
Expand Down Expand Up @@ -127,7 +128,7 @@ default <R> CompletableFuture<R> executeAsync(
* @param nodes Candidate nodes; the job will be executed on one of them.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Job result.
* @throws ComputeException If there is any problem executing the job.
Expand Down Expand Up @@ -169,7 +170,7 @@ default <R> R execute(
* @param key Key that identifies the node to execute the job on.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @param <R> Job result type.
* @return Job execution object.
Expand Down Expand Up @@ -215,7 +216,7 @@ default <R> JobExecution<R> submitColocated(
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param args Arguments of the job.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param <R> Job result type.
* @return Job execution object.
*/
Expand Down Expand Up @@ -261,7 +262,7 @@ default <K, R> JobExecution<R> submitColocated(
* @param key Key that identifies the node to execute the job on.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @param <R> Job result type.
* @return Job result future.
Expand Down Expand Up @@ -310,7 +311,7 @@ default <R> CompletableFuture<R> executeColocatedAsync(
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param args Arguments of the job.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param <R> Job result type.
* @return Job result future.
*/
Expand Down Expand Up @@ -359,7 +360,7 @@ default <K, R> CompletableFuture<R> executeColocatedAsync(
* @param key Key that identifies the node to execute the job on.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Job result.
* @throws ComputeException If there is any problem executing the job.
Expand Down Expand Up @@ -405,7 +406,7 @@ default <R> R executeColocated(
* @param keyMapper Mapper used to map the key to a binary representation.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Job result.
* @throws ComputeException If there is any problem executing the job.
Expand Down Expand Up @@ -451,7 +452,7 @@ default <K, R> R executeColocated(
* @param nodes Nodes to execute the job on.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Map from node to job execution object.
*/
Expand Down Expand Up @@ -490,7 +491,7 @@ default <R> Map<ClusterNode, JobExecution<R>> submitBroadcast(
* @param nodes Nodes to execute the job on.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Map from node to job result.
*/
Expand Down Expand Up @@ -544,7 +545,7 @@ default <R> CompletableFuture<Map<ClusterNode, R>> executeBroadcastAsync(
* @param nodes Nodes to execute the job on.
* @param units Deployment units. Can be empty.
* @param jobClassName Name of the job class to execute.
* @param options job execution options (priority, max retries).
* @param options Job execution options (priority, max retries).
* @param args Arguments of the job.
* @return Map from node to job result.
* @throws ComputeException If there is any problem executing the job.
Expand Down Expand Up @@ -585,4 +586,40 @@ default <R> Map<ClusterNode, R> executeBroadcast(
) {
return executeBroadcast(nodes, units, jobClassName, DEFAULT, args);
}

/**
* Submits a {@link MapReduceTask} of the given class for an execution.
*
* @param units Deployment units.
* @param taskClassName Map reduce task class name.
* @param args Task arguments.
* @param <R> Task result type.
* @return Task execution interface.
*/
<R> TaskExecution<R> submitMapReduce(List<DeploymentUnit> units, String taskClassName, Object... args);

/**
* Submits a {@link MapReduceTask} of the given class for an execution. A shortcut for {@code submitMapReduce(...).resultAsync()}.
*
* @param units Deployment units.
* @param taskClassName Map reduce task class name.
* @param args Task arguments.
* @param <R> Task result type.
* @return Task result future.
*/
default <R> CompletableFuture<R> executeMapReduceAsync(List<DeploymentUnit> units, String taskClassName, Object... args) {
return this.<R>submitMapReduce(units, taskClassName, args).resultAsync();
}

/**
* Executes a {@link MapReduceTask} of the given class.
*
* @param units Deployment units.
* @param taskClassName Map reduce task class name.
* @param args Task arguments.
* @param <R> Task result type.
* @return Task result.
* @throws ComputeException If there is any problem executing the task.
*/
<R> R executeMapReduce(List<DeploymentUnit> units, String taskClassName, Object... args);
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
* Context of the {@link ComputeJob} execution.
*/
public interface JobExecutionContext {
/**
* Ignite API entry point.
*
* @return Ignite instance.
*/
Ignite ignite();

/**
Expand Down
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()));
}
}

0 comments on commit c947675

Please sign in to comment.