You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ab...@apache.org on 2020/08/21 14:38:55 UTC
[ignite] branch IGNITE-7595 updated: IGNITE-13330 Compilation fix
for java thin client documentation snippets (#8177)
This is an automated email from the ASF dual-hosted git repository.
abudnikov 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 c905589 IGNITE-13330 Compilation fix for java thin client documentation snippets (#8177)
c905589 is described below
commit c905589bc39b89be3f7877b5b11dfc81bfcbe2a7
Author: Aleksey Plekhanov <Pl...@gmail.com>
AuthorDate: Fri Aug 21 17:38:33 2020 +0300
IGNITE-13330 Compilation fix for java thin client documentation snippets (#8177)
Co-authored-by: artem-budnikov <ab...@gridgain.com>
---
.../org/apache/ignite/snippets/JavaThinClient.java | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 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 a0204a4..457f03a 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
@@ -312,7 +312,7 @@ public class JavaThinClient {
UUID nodeId = (UUID) igniteClient.query(new SqlFieldsQuery("SELECT * from NODES").setSchema("IGNITE"))
.getAll().iterator().next().get(0);
- double cpu_load = (double) igniteClient
+ double cpu_load = (Double) igniteClient
.query(new SqlFieldsQuery("select CUR_CPU_LOAD * 100 from NODE_METRICS where NODE_ID = ? ")
.setSchema("IGNITE").setArgs(nodeId.toString()))
.getAll().iterator().next().get(0);
@@ -328,11 +328,11 @@ public class JavaThinClient {
//end::system-views[]
}
- void partitionAwareness() {
+ void partitionAwareness() throws Exception {
//tag::partition-awareness[]
ClientConfiguration cfg = new ClientConfiguration()
.setAddresses("node1_address:10800", "node2_address:10800", "node3_address:10800")
- .setPartitionAwareness(true);
+ .setPartitionAwarenessEnabled(true);
try (IgniteClient client = Ignition.startClient(cfg)) {
ClientCache<Integer, String> cache = client.cache("myCache");
@@ -343,6 +343,7 @@ public class JavaThinClient {
//end::partition-awareness[]
}
+
@Test
void cientCluster() throws Exception {
ClientConfiguration clientCfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");
@@ -354,7 +355,7 @@ public class JavaThinClient {
//end::client-cluster[]
}
- void clientClusterGroups() {
+ void clientClusterGroups() throws Exception {
ClientConfiguration clientCfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");
//tag::client-cluster-groups[]
try (IgniteClient client = Ignition.startClient(clientCfg)) {
@@ -364,7 +365,7 @@ public class JavaThinClient {
//end::client-cluster-groups[]
}
- void clientCompute() {
+ void clientCompute() throws Exception {
//tag::client-compute-setup[]
ThinClientConfiguration thinClientCfg = new ThinClientConfiguration()
.setMaxActiveComputeTasksPerConnection(100);
@@ -387,7 +388,7 @@ public class JavaThinClient {
//end::client-compute-task[]
}
- void clientServices() {
+ void clientServices() throws Exception {
ClientConfiguration clientCfg = new ClientConfiguration().setAddresses("127.0.0.1:10800");
//tag::client-services[]
try (IgniteClient client = Ignition.startClient(clientCfg)) {
@@ -396,4 +397,11 @@ public class JavaThinClient {
}
//end::client-services[]
}
+
+ private static class MyTask {
+ }
+
+ private static interface MyService {
+ public void myServiceMethod();
+ }
}