From commits-return-127258-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Fri Oct 2 20:22:23 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id D3604180630 for ; Fri, 2 Oct 2020 22:22:23 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 24C5B62CF5 for ; Fri, 2 Oct 2020 20:22:23 +0000 (UTC) Received: (qmail 4723 invoked by uid 500); 2 Oct 2020 20:22:22 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 4714 invoked by uid 99); 2 Oct 2020 20:22:22 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2020 20:22:22 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 4BA1C811B2; Fri, 2 Oct 2020 20:22:22 +0000 (UTC) Date: Fri, 02 Oct 2020 20:22:21 +0000 To: "commits@ignite.apache.org" Subject: [ignite] branch IGNITE-7595 updated: Improving documentation of the compute, cluster and services APIs for the Java and .NET thin clients MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <160167014072.23888.7510726066286310954@gitbox.apache.org> From: dmagda@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: ignite X-Git-Refname: refs/heads/IGNITE-7595 X-Git-Reftype: branch X-Git-Oldrev: c5592322b705be65fa49ce8e323b2463f23442a9 X-Git-Newrev: a66ea1d8cab0a34ca62a84ff52f4231dc70dda31 X-Git-Rev: a66ea1d8cab0a34ca62a84ff52f4231dc70dda31 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. dmagda pushed a commit to branch IGNITE-7595 in repository https://gitbox.apache.org/repos/asf/ignite.git The following commit(s) were added to refs/heads/IGNITE-7595 by this push: new a66ea1d Improving documentation of the compute, cluster and services APIs for the Java and .NET thin clients a66ea1d is described below commit a66ea1d8cab0a34ca62a84ff52f4231dc70dda31 Author: Denis Magda AuthorDate: Fri Oct 2 13:21:57 2020 -0700 Improving documentation of the compute, cluster and services APIs for the Java and .NET thin clients --- .../org/apache/ignite/snippets/JavaThinClient.java | 11 ++-- docs/_docs/thin-clients/dotnet-thin-client.adoc | 50 +++++++++--------- docs/_docs/thin-clients/java-thin-client.adoc | 60 ++++++++++------------ 3 files changed, 61 insertions(+), 60 deletions(-) diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java index 2b60262..8cdab57 100644 --- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java +++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JavaThinClient.java @@ -383,8 +383,9 @@ public class JavaThinClient { ClientConfiguration clientCfg = new ClientConfiguration().setAddresses("127.0.0.1:10800"); //tag::client-compute-task[] try (IgniteClient client = Ignition.startClient(clientCfg)) { - // Suppose MyTask class is already deployed to the cluster - client.compute().execute(MyTask.class.getName(), "argument"); + // Suppose that the MyTask class is already deployed in the cluster + client.compute().execute( + MyTask.class.getName(), "argument"); } //end::client-compute-task[] } @@ -393,8 +394,10 @@ public class JavaThinClient { ClientConfiguration clientCfg = new ClientConfiguration().setAddresses("127.0.0.1:10800"); //tag::client-services[] try (IgniteClient client = Ignition.startClient(clientCfg)) { - // Suppose implementation of MyService interface is already deployed to the cluster as a service with name "MyService" - client.services().serviceProxy("MyService", MyService.class).myServiceMethod(); + // Executing the service named MyService + // that is already deployed in the cluster. + client.services().serviceProxy( + "MyService", MyService.class).myServiceMethod(); } //end::client-services[] } diff --git a/docs/_docs/thin-clients/dotnet-thin-client.adoc b/docs/_docs/thin-clients/dotnet-thin-client.adoc index 1acc02c..b227e37 100644 --- a/docs/_docs/thin-clients/dotnet-thin-client.adoc +++ b/docs/_docs/thin-clients/dotnet-thin-client.adoc @@ -148,41 +148,47 @@ include::{sourceCodeFile}[tag=executingSql,indent=0] ---- -== Cluster API +== Using Cluster API -Cluster functionality (APIs for accessing cluster and nodes) is provided via the `IClientCluster` interface. -You can get an instance of `IClientCluster` from `IIgniteClient` as follows: +The cluster APIs let you create a group of cluster nodes and run various operations against the group. The `IClientCluster` +interface is the entry-point to the APIs that can be used as follows: + +* Get or change the state of a cluster +* Get a list of all cluster nodes +* Create logical groups our of cluster nodes and use other Ignite APIs to perform certain operations on the group + +Use the instance of `IClientCluster` to obtain a reference to the `IClientCluster` that comprises all cluster nodes, and +activate the whole cluster as well as write-ahead-logging for the `my-cache` cache: [source, csharp] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-cluster,indent=0] ------------------------------------------------------------------------------- -Through the `IClientCluster` interface you can: - -* Get or set cluster state -* Get a list of all cluster members -* Create logical groups of nodes - === Logical nodes grouping -API to create logical groups of nodes within your cluster is provided by `IClientClusterGroup` interface. -Instance of this interface can be obtained from a parent `IClientClusterGroup` instance using node-filtering methods. - -The `IClientCluster` instance implements `IClientClusterGroup` and is a root cluster group, which includes all nodes in the cluster. +You can use the `IClientClusterGroup` interface of the cluster APIs to create various groups of cluster nodes. For instance, +one group can comprise all servers nodes, while the other group can include only those nodes that match a specific +TCP/IP address format. The example below shows how to create a group of server nodes located in the `dc1` data center: -Here is how you can use this API to get all server nodes in certain data-center (assuming node attribute "dc" is set to bind node and data-center): [source, csharp] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-cluster-groups,indent=0] ------------------------------------------------------------------------------- -Refer to link:distributed-computing/cluster-groups[Cluster groups] to get more information about logical nodes grouping. +Note, the `IClientCluster` instance implements `IClientClusterGroup` which is the root cluster group that includes all +nodes of the cluster. +Refer to the main link:distributed-computing/cluster-groups[cluster groups] documentation page for more details on the capability. -== Executing compute tasks +== Executing Compute Tasks -Thin client has basic functionality to execute compute tasks. This feature is disabled by default on the server side. -Set `ThinClientConfiguration.MaxActiveComputeTasksPerConnection` to a non-zero value to enable: +Presently, the Java thin client supports basic link:distributed-computing/distributed-computing[compute capabilities] +by letting you execute those compute tasks that are *already deployed* in the cluster. You can either run a task across all +cluster nodes or a specific link:thin-clients/dotnet-thin-client#logical-nodes-grouping[cluster group]. + +By default, the execution of tasks, triggered by the thin client, is disabled on the cluster side. You need to set the +`ThinClientConfiguration.MaxActiveComputeTasksPerConnection` parameter to a non-zero value in the configuration of your +server nodes and thick clients: [tabs] -- @@ -208,17 +214,13 @@ include::{sourceCodeFile}[tag=client-compute-setup,indent=0] ---- -- -Compute functionality is provided by `IComputeClient` interface, which can be obtained from `IIgniteClient` instance. - -Currently, thin clients can run already deployed tasks by class name. Task classes should be depoyed in advance to the server nodes. +The example below shows how to get access to the compute APIs via the `IComputeClient` interface and execute the compute +task named `org.foo.bar.AddOneTask` passing `1` as an input parameter: [source, java] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-compute-task,indent=0] ------------------------------------------------------------------------------- -See link:distributed-computing/distributed-computing[distributed computing] for more information about compute grid functionality. - - == Security === SSL/TLS diff --git a/docs/_docs/thin-clients/java-thin-client.adoc b/docs/_docs/thin-clients/java-thin-client.adoc index 3dde17b..af3282c 100644 --- a/docs/_docs/thin-clients/java-thin-client.adoc +++ b/docs/_docs/thin-clients/java-thin-client.adoc @@ -181,38 +181,44 @@ NOTE: The `getAll()` method retrieves the results from the cursor and closes it. Read more about using `SqlFieldsQuery` and SQL API in the link:SQL/sql-api[Using SQL API] section. -== Cluster API +== Using Cluster APIs -Cluster functionality (APIs for accessing cluster and nodes) is provided via the `ClientCluster` interface. You can get an instance of `ClientCluster` from `IgniteClient` as follows: +The cluster APIs let you create a group of cluster nodes and run various operations against the group. The `ClientCluster` +interface is the entry-point to the APIs that can be used as follows: + +* Get or change the state of a cluster +* Get a list of all cluster nodes +* Create logical groups our of cluster nodes and use other Ignite APIs to perform certain operations on the group + +Use the instance of `IgniteClient` to obtain a reference to the `ClientCluster` interface: [source, java] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-cluster,indent=0] ------------------------------------------------------------------------------- -Through the `ClientCluster` interface you can: - -* Get or set cluster state -* Get a list of all cluster members -* Create logical groups of nodes - -=== Logical nodes grouping - -API to create logical groups of nodes within your cluster is provided by `ClientClusterGroup` interface. Instance of this interface can be obtained from a parent `ClientClusterGroup` instance using node-filtering methods. +=== Logical Nodes Grouping -The `ClientCluster` instance it's a root cluster nodes group, which includes all nodes in the cluster. +You can use the `ClientClusterGroup` interface of the cluster APIs to create various groups of cluster nodes. For instance, +one group can comprise all servers nodes, while the other group can include only those nodes that match a specific +TCP/IP address format. The example below shows how to create a group of server nodes located in the `dc1` data center: -Here is how you can use this API to get all server nodes in certain data-center (assuming node attribute "dc" is set to bind node and data-center): [source, java] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-cluster-groups,indent=0] ------------------------------------------------------------------------------- -Refer to link:distributed-computing/cluster-groups[Cluster groups] to get more information about logical nodes grouping. +Refer to the main link:distributed-computing/cluster-groups[cluster groups] documentation page for more details on the capability. -== Executing compute tasks +== Executing Compute Tasks -The Java thin client has basic functionality to execute compute tasks. By default this feature is disabled on server-side. To enable this functionality server-side configuration property `maxActiveComputeTasksPerConnection` should be set explicitly to value more than 0: +Presently, the Java thin client supports basic link:distributed-computing/distributed-computing[compute capabilities] +by letting you execute those compute tasks that are *already deployed* in the cluster. You can either run a task across all +cluster nodes or a specific link:thin-clients/java-thin-client#logical-nodes-grouping[cluster group]. The deployment +assumes that you create a JAR file with the compute tasks and add the JAR to the cluster nodes' classpath. +By default, the execution of tasks, triggered by the thin client, is disabled on the cluster side. You need to set the +`ThinClientConfiguration.maxActiveComputeTasksPerConnection` parameter to a non-zero value in the configuration of your +server nodes and thick clients: [tabs] -- tab:XML[] @@ -237,34 +243,24 @@ include::{sourceCodeFile}[tag=client-compute-setup,indent=0] ---- -- -Compute tasks execution functionality provided by `ClientCompute` interface, which can be obtained from `IgniteClient` instance. - -Currently, thin client only have an ability to run already deployed tasks by task name. To run some custom task users should deploy classes related to this task to the server manually. +The example below shows how to get access to the compute APIs via the `ClientCompute` interface and execute the compute +task named `MyTask`: [source, java] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-compute-task,indent=0] ------------------------------------------------------------------------------- -Nodes set to execute compute tasks can be limited using cluster groups and corresponding `IgniteClient.compute(ClientClusterGroup)` method. - -See link:distributed-computing/distributed-computing[distributed computing] for more information about compute grid functionality. - -== Service invocation +== Executing Ignite Services -The Java thin client is able to invoke grid-managed services. API for this functionality is provided by `ClientServices` interface, which can be obtained from `IgniteClient` instance. +You can use the `ClientServices` APIs of the Java thin client to invoke an link:services/services[Ignite Service] that +is *already deployed* in the cluster. -Only already deployed to cluster services can be invoked, there is no functionality to deploy services by thin clients. +The example below shows how to invoke the service named `MyService`: [source, java] ------------------------------------------------------------------------------- include::{sourceCodeFile}[tag=client-services,indent=0] ------------------------------------------------------------------------------- -//// -*TODO: fix link* -//// - -See link:services/services[Services] for more information about Ignite services. - == Handling Exceptions === Handling Node Failures