ptupitsyn commented on code in PR #857:
URL: https://github.com/apache/ignite-3/pull/857#discussion_r891082496
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,80 @@
+= Distributed Computing
+
+Apache Ignite 3 provides an API for distributing computations across cluster
nodes in a balanced and fault-tolerant manner. You can submit individual tasks
for execution from Java and .NET clients.
+
+You can use Java or .NET client to execute compute jobs. Make sure the
required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+
+[tabs]
+--
+tab:Java[]
+[source, java]
+----
+private void example() {
+ IgniteClient client = client();
+ IgniteCompute compute = client.compute();
+ Set<ClusterNode> nodes = new HashSet<>(client.clusterNodes());
+
+ compute.execute(nodes, NodeNameJob.class, "Hello");
+}
+
+private static class NodeNameJob implements ComputeJob<String> {
+ @Override
+ public String execute(JobExecutionContext context, Object... args) {
+ return context.ignite().name() + "_" + args[0];
+ }
+}
+----
+
+
+NOTE: Unlike Ignite 2, jobs are not serialized. Only the class name and
arguments are sent to the node.
+
+tab:.NET[]
+[source, csharp]
+----
+IIgniteClient client = Client;
+ICompute compute = client.Compute;
+IList<IClusterNode> nodes = await Client.GetClusterNodesAsync();
+string res = await compute.ExecuteAsync<string>(nodes, jobClassName:
"org.foo.bar.NodeNameJob", "Hello!");
+----
+--
+
+
+== Colocated Computations
+
+In Apache Ignite 3 you can execute colocated computation with
`executeColocated` method. When you do it, the data set required for the
compute task is guaranteed to be on the nodes that execute the task. This can
significantly reduce execution time if your tasks require data.
Review Comment:
```suggestion
In Apache Ignite 3 you can execute colocated computation with
`executeColocated` method. When you do it, the compute task is guaranteed to be
executed on the nodes that hold the specified key. This can significantly
reduce execution time if your tasks require data.
```
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,80 @@
+= Distributed Computing
+
+Apache Ignite 3 provides an API for distributing computations across cluster
nodes in a balanced and fault-tolerant manner. You can submit individual tasks
for execution from Java and .NET clients.
+
+You can use Java or .NET client to execute compute jobs. Make sure the
required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+
+[tabs]
+--
+tab:Java[]
+[source, java]
+----
+private void example() {
+ IgniteClient client = client();
+ IgniteCompute compute = client.compute();
+ Set<ClusterNode> nodes = new HashSet<>(client.clusterNodes());
+
+ compute.execute(nodes, NodeNameJob.class, "Hello");
+}
+
+private static class NodeNameJob implements ComputeJob<String> {
+ @Override
+ public String execute(JobExecutionContext context, Object... args) {
+ return context.ignite().name() + "_" + args[0];
+ }
+}
+----
+
+
+NOTE: Unlike Ignite 2, jobs are not serialized. Only the class name and
arguments are sent to the node.
+
+tab:.NET[]
+[source, csharp]
+----
+IIgniteClient client = Client;
+ICompute compute = client.Compute;
+IList<IClusterNode> nodes = await Client.GetClusterNodesAsync();
+string res = await compute.ExecuteAsync<string>(nodes, jobClassName:
"org.foo.bar.NodeNameJob", "Hello!");
+----
+--
+
+
+== Colocated Computations
+
+In Apache Ignite 3 you can execute colocated computation with
`executeColocated` method. When you do it, the data set required for the
compute task is guaranteed to be on the nodes that execute the task. This can
significantly reduce execution time if your tasks require data.
Review Comment:
Let's turn this around since we don't send the data to code, we send code to
the data.
--
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]