ptupitsyn commented on code in PR #857:
URL: https://github.com/apache/ignite-3/pull/857#discussion_r890368606
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
Review Comment:
* There is no "thin client" concept in Ignite 3. All clients are "thin", so
we drop the thin/thick part.
* There is no "embedded mode".
* The only way to start interacting with the API is by using the client.
* Client and server APIs are the same (interfaces are the same,
implementations are different).
* Server-side implementation is used within compute jobs.
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
+
+You can use Java thin client to execute compute jobs on the server. Make sure
the required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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 currently not serialized.
+
+== .NET: Thin
Review Comment:
```suggestion
== .NET
```
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
+
+You can use Java thin client to execute compute jobs on the server. Make sure
the required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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 currently not serialized.
+
+== .NET: Thin
+
+You can use .NET thin client to execute Java compute tasks. Make sure the
required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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!");
+----
+
+NOTE: Unlike Ignite 2, jobs are currently not serialized.
Review Comment:
The API only accepts the Java job class name, so there is no possibility of
job serialization. I'm not sure if this remark makes sense here.
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
+
+You can use Java thin client to execute compute jobs on the server. Make sure
the required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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 currently not serialized.
+
+== .NET: Thin
+
+You can use .NET thin client to execute Java compute tasks. Make sure the
required classes are deployed to the cluster before executing code.
Review Comment:
```suggestion
You can use .NET client to execute Java compute tasks. Make sure the
required classes are deployed to the cluster before executing code.
```
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
+
+You can use Java thin client to execute compute jobs on the server. Make sure
the required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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 currently not serialized.
Review Comment:
```suggestion
NOTE: Unlike Ignite 2, jobs are not serialized. Only the class name and
arguments are sent over the wire.
```
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
Review Comment:
MapReduce is not yet supported, should we remove this section for now?
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
+
+You can use Java thin client to execute compute jobs on the server. Make sure
the required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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 currently not serialized.
Review Comment:
There are no plans to serialize jobs for now, so let's drop "currently".
##########
docs/_docs/compute/compute.adoc:
##########
@@ -0,0 +1,63 @@
+= 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 as well as implement the `MapReduce(?)` pattern with automatic
task splitting.
+
+Here is how you can execute a remote job by using the `ignite-api` module:
+
+[source, java]
+----
+public interface IgniteCompute {
+// Executes a job represented by the given class on one node from the nodes
set.
+<R> CompletableFuture<R> execute(Set<ClusterNode> nodes, Class<? Extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on one node where the given
key is located.
+<R> CompletableFuture<R> executeColocated(String table, K key, Class<? extends
ComputeJob<R>> cls, Object … args);
+
+// Executes a job represented by the given class on all nodes from the given
nodes set.
+<R> Map<ClusterNode,CompletableFuture<R>> broadcast(Set<ClusterNode> nodes,
Class<? extends ComputeJob<R>> cls, Object … args);
+}
+----
+
+NOTE: Currently, this interface supports only basic operations. Broadcasting
and operations requiring code deployment are currently not supported.
+
+== Java: Thin
+
+You can use Java thin client to execute compute jobs on the server. Make sure
the required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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 currently not serialized.
+
+== .NET: Thin
+
+You can use .NET thin client to execute Java compute tasks. Make sure the
required classes are deployed to the cluster before executing code.
+
+Here is how you can execute a simple compute job:
+
+[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!");
+----
+
+NOTE: Unlike Ignite 2, jobs are currently not serialized.
Review Comment:
```suggestion
```
--
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]