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/09/04 14:52:33 UTC

[ignite] 03/03: minor updates

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

commit 53308706b89799e910ac1a5fb44fbec51778cd25
Author: abudnikov <ab...@gridgain.com>
AuthorDate: Fri Sep 4 17:52:13 2020 +0300

    minor updates
---
 .../apache/ignite/snippets/ClusteringOverview.java | 40 ++++++++++------------
 .../ignite/snippets/CollocatedComputations.java    |  2 +-
 .../apache/ignite/snippets/ComputeTaskExample.java |  2 +-
 .../java/org/apache/ignite/snippets/Events.java    | 14 ++++----
 .../apache/ignite/snippets/JDBCClientDriver.java   |  3 --
 .../java/org/apache/ignite/snippets/Tracing.java   |  2 --
 docs/_docs/monitoring-metrics/cluster-id.adoc      |  2 +-
 docs/_docs/peer-class-loading.adoc                 |  4 +--
 docs/_docs/read-repair.adoc                        |  6 ++--
 9 files changed, 35 insertions(+), 40 deletions(-)

diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusteringOverview.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusteringOverview.java
index 5096d77..92d5228 100644
--- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusteringOverview.java
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ClusteringOverview.java
@@ -9,33 +9,33 @@ import org.junit.jupiter.api.Test;
 public class ClusteringOverview {
 
     @Test
-     void clientModeCfg() {
-        Ignite serverNode = Ignition.start(new IgniteConfiguration().setIgniteInstanceName("server-node"));
-        // tag::clientCfg[]
-        IgniteConfiguration cfg = new IgniteConfiguration();
+    void clientModeCfg() {
+        try (Ignite serverNode = Ignition
+                .start(new IgniteConfiguration().setIgniteInstanceName("server-node"))) {
+            // tag::clientCfg[]
+            IgniteConfiguration cfg = new IgniteConfiguration();
 
-        // Enable client mode.
-        cfg.setClientMode(true);
+            // Enable client mode.
+            cfg.setClientMode(true);
 
-        // Start the node in client mode.
-        Ignite ignite = Ignition.start(cfg);
-        // end::clientCfg[]
+            // Start the node in client mode.
+            Ignite ignite = Ignition.start(cfg);
+            // end::clientCfg[]
 
-        ignite.close();
-        serverNode.close();
+            ignite.close();
+        }
     }
 
-    @Test
-     void setClientModeEnabledByIgnition() {
+    void setClientModeEnabledByIgnition() {
 
-        Ignite serverNode = Ignition.start(new IgniteConfiguration().setIgniteInstanceName("server-node"));
+        Ignite serverNode = Ignition
+                .start(new IgniteConfiguration().setIgniteInstanceName("server-node"));
         // tag::clientModeIgnition[]
         Ignition.setClientMode(true);
 
         // Start the node in client mode.
         Ignite ignite = Ignition.start();
         // end::clientModeIgnition[]
-        
 
         ignite.close();
         serverNode.close();
@@ -44,7 +44,8 @@ public class ClusteringOverview {
     @Test
     void communicationSpiDemo() {
 
-        Ignite serverNode = Ignition.start(new IgniteConfiguration().setIgniteInstanceName("server-node"));
+        Ignite serverNode = Ignition
+                .start(new IgniteConfiguration().setIgniteInstanceName("server-node"));
         // tag::commSpi[]
         TcpCommunicationSpi commSpi = new TcpCommunicationSpi();
 
@@ -52,15 +53,12 @@ public class ClusteringOverview {
         commSpi.setLocalPort(4321);
 
         IgniteConfiguration cfg = new IgniteConfiguration();
-        // end::commSpi[]
-        // tag::commSpi[]
-
         cfg.setCommunicationSpi(commSpi);
 
         // Start the node.
-        Ignition.start(cfg);
+        Ignite ignite = Ignition.start(cfg);
         // end::commSpi[]
+        ignite.close();
         serverNode.close();
-        Ignition.ignite().close();
     }
 }
diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/CollocatedComputations.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/CollocatedComputations.java
index f0bec76..9783efb 100644
--- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/CollocatedComputations.java
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/CollocatedComputations.java
@@ -118,7 +118,7 @@ public class CollocatedComputations {
     // tag::sum-by-partition[]
     // this task sums up the value of the 'salary' field for all objects stored in
     // the given partition
-    private static class SumByPartitionTask implements IgniteCallable<BigDecimal> {
+    public static class SumByPartitionTask implements IgniteCallable<BigDecimal> {
         private int partId;
 
         public SumByPartitionTask(int partId) {
diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ComputeTaskExample.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ComputeTaskExample.java
index cbcc943..4d17155 100644
--- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ComputeTaskExample.java
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/ComputeTaskExample.java
@@ -13,7 +13,7 @@ import org.apache.ignite.compute.ComputeTaskSplitAdapter;
 
 //tag::compute-task-example[]
 public class ComputeTaskExample {
-    private static class CharacterCountTask extends ComputeTaskSplitAdapter<String, Integer> {
+    public static class CharacterCountTask extends ComputeTaskSplitAdapter<String, Integer> {
         // 1. Splits the received string into words
         // 2. Creates a child job for each word
         // 3. Sends the jobs to other nodes for processing.
diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Events.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Events.java
index f28b1f4..8dd8c5e 100644
--- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Events.java
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Events.java
@@ -29,7 +29,7 @@ public class Events {
         cfg.setIncludeEventTypes(EventType.EVT_CACHE_OBJECT_PUT, EventType.EVT_CACHE_OBJECT_READ,
                 EventType.EVT_CACHE_OBJECT_REMOVED, EventType.EVT_NODE_JOINED, EventType.EVT_NODE_LEFT);
 
-        // Start a node.
+        // Start the node.
         Ignite ignite = Ignition.start(cfg);
         // end::enabling-events[]
 
@@ -75,7 +75,7 @@ public class Events {
             return true; // Continue listening.
         };
 
-        // Subscribe to specified cache events occurring on the local node.
+        // Subscribe to the cache events that are triggered on the local node.
         events.localListen(localListener, EventType.EVT_CACHE_OBJECT_PUT, EventType.EVT_CACHE_OBJECT_READ,
                 EventType.EVT_CACHE_OBJECT_REMOVED);
         // end::local[]
@@ -90,7 +90,7 @@ public class Events {
             return true;
         };
 
-        // Subscribe to specified cache events on all nodes that have cache running.
+        // Subscribe to the cache events on all nodes where the cache is hosted.
         UUID uuid = events.remoteListen(new IgniteBiPredicate<UUID, CacheEvent>() {
 
             @Override
@@ -108,10 +108,10 @@ public class Events {
         // tag::batching[]
         Ignite ignite = Ignition.ignite();
 
-        // Get an instance of named cache.
+        // Get an instance of the cache.
         final IgniteCache<Integer, String> cache = ignite.cache("cacheName");
 
-        // Sample remote filter which only accepts events for keys
+        // Sample remote filter which only accepts events for the keys
         // that are greater than or equal to 10.
         IgnitePredicate<CacheEvent> rmtLsnr = new IgnitePredicate<CacheEvent>() {
             @Override
@@ -124,8 +124,8 @@ public class Events {
             }
         };
 
-        // Subscribe to cache events occurring on all nodes
-        // that have the specified cache running.
+        // Subscribe to the cache events that are triggered on all nodes
+        // that host the cache.
         // Send notifications in batches of 10.
         ignite.events(ignite.cluster().forCacheNodes("cacheName")).remoteListen(10 /* batch size */,
                 0 /* time intervals */, false, null, rmtLsnr, EventType.EVTS_CACHE);
diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JDBCClientDriver.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JDBCClientDriver.java
index 42da3da..ae4deac 100644
--- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JDBCClientDriver.java
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/JDBCClientDriver.java
@@ -10,7 +10,6 @@ import org.junit.jupiter.api.Test;
 
 public class JDBCClientDriver {
 
-    @Test
     void registerDriver() throws ClassNotFoundException, SQLException {
         //tag::register[]
         // Registering the JDBC driver.
@@ -23,7 +22,6 @@ public class JDBCClientDriver {
         conn.close();
     }
 
-    @Test
     void streaming() throws ClassNotFoundException, SQLException {
         // Register JDBC driver.
         Class.forName("org.apache.ignite.IgniteJdbcDriver");
@@ -35,7 +33,6 @@ public class JDBCClientDriver {
         conn.close();
     }
     
-    @Test
     void timeBasedFlushing() throws ClassNotFoundException, SQLException {
         //tag::time-based-flushing[]
      // Register JDBC driver.
diff --git a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java
index e52efe0..bd18cfe 100644
--- a/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java
+++ b/docs/_docs/code-snippets/java/src/main/java/org/apache/ignite/snippets/Tracing.java
@@ -44,10 +44,8 @@ public class Tracing {
         ignite.close();
     }
 
-    @Test
     void exportToZipkin() {
         //tag::export-to-zipkin[]
-
         //register Zipkin exporter
         ZipkinTraceExporter.createAndRegister(
                 ZipkinExporterConfiguration.builder().setV2Url("http://localhost:9411/api/v2/spans")
diff --git a/docs/_docs/monitoring-metrics/cluster-id.adoc b/docs/_docs/monitoring-metrics/cluster-id.adoc
index 0d2ec31..1a8cb56 100644
--- a/docs/_docs/monitoring-metrics/cluster-id.adoc
+++ b/docs/_docs/monitoring-metrics/cluster-id.adoc
@@ -20,7 +20,7 @@ group=IgniteCluster,name=IgniteClusterMXBeanImpl
 |===
 | Attribute | Type | Description
 |Id| String | The cluster ID.
-|Tag | long | The cluster tag.
+|Tag | String | The cluster tag.
 |===
 
 [cols="4,9", opts="header"]
diff --git a/docs/_docs/peer-class-loading.adoc b/docs/_docs/peer-class-loading.adoc
index e9f5953..3dc446f 100644
--- a/docs/_docs/peer-class-loading.adoc
+++ b/docs/_docs/peer-class-loading.adoc
@@ -4,7 +4,7 @@
 
 Peer class loading refers to loading classes from a local node where they are defined to remote nodes.
 With peer class loading enabled, you don't have to manually deploy your Java code on each node in the cluster and re-deploy it each time it changes.
-Ignite automatically loads the classes from the node where they are defined to the nodes where they are required.
+Ignite automatically loads the classes from the node where they are defined to the nodes where they are used.
 
 For example, when link:key-value-api/using-scan-queries[querying data] with a custom transformer, you only need to define your tasks on the client node that initiates the computation, and Ignite loads the classes to the server nodes.
 
@@ -30,7 +30,7 @@ The peer class loading functionality allows any client to deploy custom code to
 
 This is what happens when a class is required on remote nodes:
 
-* Ignite checks if the class is available in the local classpath, i.e. if it has been loaded at system initialization, and if it has, it is returned. No class loading from a peer node takes place in this case.
+* Ignite checks if the class is available in the local classpath, i.e. if it was loaded during system initialization, and if it was, it is returned. No class loading from a peer node takes place in this case.
 * If the class is not available locally, then a request for the class definition is sent to the originating node. The originating node sends the class's byte-code and the class is loaded on the worker node. This happens once per class. When the class definition is loaded on a node, it does not have to be loaded again.
 
 [NOTE]
diff --git a/docs/_docs/read-repair.adoc b/docs/_docs/read-repair.adoc
index c558664..1de27c6 100644
--- a/docs/_docs/read-repair.adoc
+++ b/docs/_docs/read-repair.adoc
@@ -23,7 +23,7 @@ A consistency check is incompatible with the following cache configurations:
 
 == Transactional Caches
 
-Values across the topology will be replaced by the latest versioned value.
+All values across the topology are replaced with the latest version.
 
 *  Automatically for transactions that have `TransactionConcurrency.OPTIMISTIC` concurrency mode or `TransactionIsolation.READ_COMMITTED` isolation level
 *  at the commit() phase for transactions that have `TransactionConcurrency.PESSIMISTIC` concurrency mode and isolation level other than `TransactionIsolation.READ_COMMITTED`
@@ -37,4 +37,6 @@ For example, in case you use !TransactionIsolation.READ_COMMITTED isolation mode
 
 The consistency violation exception is thrown if differences are found.
 
-Due to the nature of the atomic cache, false-positive results can be observed. For example, an attempt to check consistency under cache loading may lead to consistency violation exception. By default, the implementation tries to check the given key three times. The number of attempts can be changed by setting `IGNITE_NEAR_GET_MAX_REMAPS` system property.
+Due to the nature of the atomic cache, false-positive results can be observed. For example, an attempt to check consistency under load may lead to consistency violation exception. By default, the implementation tries to check the given key three times. The number of attempts can be changed by setting `IGNITE_NEAR_GET_MAX_REMAPS` system property.
+
+Be aware that the consistency violation event will not be fired for atomic caches.