#IGNITE-106: Remove word GridGain from examples.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/a234cdda Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/a234cdda Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/a234cdda Branch: refs/heads/ignite-32 Commit: a234cdda168bdc9f8d4ededf360131da8ab6b3ec Parents: b4a4f1b Author: ivasilinets <[email protected]> Authored: Mon Feb 2 15:13:36 2015 +0300 Committer: ivasilinets <[email protected]> Committed: Mon Feb 2 15:13:36 2015 +0300 ---------------------------------------------------------------------- examples/config/example-cache.xml | 10 ++--- examples/config/example-compute.xml | 2 +- examples/config/example-streamer.xml | 16 ++++---- examples/config/filesystem/core-site.xml | 2 +- examples/config/filesystem/example-ggfs.xml | 12 +++--- .../hibernate/example-hibernate-L2-cache.xml | 2 +- examples/config/servlet/WEB-INF/web.xml | 2 +- examples/rest/http-rest-example.php | 6 +-- examples/rest/memcache-rest-example.php | 4 +- .../apache/ignite/examples/ExamplesUtils.java | 2 +- .../compute/ComputeBroadcastExample.java | 24 ++++++------ .../compute/ComputeCallableExample.java | 6 +-- .../examples/compute/ComputeClosureExample.java | 10 ++--- .../compute/ComputeContinuousMapperExample.java | 8 ++-- .../compute/ComputeExecutorServiceExample.java | 8 ++-- .../ComputeFibonacciContinuationExample.java | 22 +++++------ .../compute/ComputeProjectionExample.java | 9 ++--- .../examples/compute/ComputeReducerExample.java | 12 +++--- .../compute/ComputeRunnableExample.java | 6 +-- .../compute/ComputeScheduleExample.java | 8 ++-- .../examples/compute/ComputeTaskMapExample.java | 8 ++-- .../compute/ComputeTaskSplitExample.java | 8 ++-- .../failover/ComputeFailoverExample.java | 10 ++--- .../failover/ComputeFailoverNodeStartup.java | 4 +- .../compute/montecarlo/CreditRiskExample.java | 8 ++-- .../examples/datagrid/CacheAffinityExample.java | 23 +++++------ .../examples/datagrid/CacheApiExample.java | 6 +-- .../datagrid/CacheContinuousQueryExample.java | 6 +-- .../datagrid/CacheDataLoaderExample.java | 8 ++-- .../examples/datagrid/CacheEventsExample.java | 10 ++--- .../datagrid/CachePopularNumbersExample.java | 24 ++++++------ .../examples/datagrid/CachePutGetExample.java | 14 +++---- .../examples/datagrid/CacheQueryExample.java | 20 +++++----- .../datagrid/CacheTransactionExample.java | 8 ++-- .../datastructures/CacheAtomicLongExample.java | 11 +++--- .../CacheAtomicReferenceExample.java | 12 +++--- .../CacheAtomicSequenceExample.java | 8 ++-- .../CacheAtomicStampedExample.java | 12 +++--- .../CacheCountDownLatchExample.java | 8 ++-- .../datastructures/CacheQueueExample.java | 40 ++++++++++---------- .../datastructures/CacheSetExample.java | 30 +++++++-------- .../hibernate/HibernateL2CacheExample.java | 14 +++---- .../starschema/CacheStarSchemaExample.java | 10 ++--- .../datagrid/store/CacheStoreExample.java | 6 +-- .../store/CacheStoreLoadDataExample.java | 9 +++-- .../store/dummy/CacheDummyPersonStore.java | 2 +- .../ignite/examples/events/EventsExample.java | 16 ++++---- .../ignite/examples/ggfs/GgfsExample.java | 10 ++--- .../examples/ggfs/GgfsMapReduceExample.java | 14 +++---- .../ignite/examples/ggfs/GgfsNodeStartup.java | 2 +- .../apache/ignite/examples/ggfs/package.html | 2 +- .../examples/messaging/MessagingExample.java | 24 ++++++------ .../messaging/MessagingPingPongExample.java | 18 ++++----- .../MessagingPingPongListenActorExample.java | 16 ++++---- .../client/memcache/MemcacheRestExample.java | 22 +++++------ .../misc/deployment/DeploymentExample.java | 12 +++--- .../misc/lifecycle/LifecycleExample.java | 4 +- .../misc/springbean/SpringBeanExample.java | 8 ++-- .../examples/services/ServicesExample.java | 8 ++-- .../streaming/StreamingCheckInExample.java | 12 +++--- .../StreamingPopularNumbersExample.java | 26 ++++++------- .../streaming/StreamingPriceBarsExample.java | 30 +++++++-------- .../StreamingRunningAverageExample.java | 6 +-- .../ignite/examples/MessagingExample.java | 10 ++--- .../examples/ScalarCacheAffinityExample1.scala | 2 +- .../ScalarCachePopularNumbersExample.scala | 2 +- .../examples/ScalarCacheQueryExample.scala | 8 ++-- .../scalar/examples/ScalarJvmCloudExample.scala | 4 +- .../examples/ScalarSnowflakeSchemaExample.scala | 2 +- .../scalar/examples/ScalarTaskExample.scala | 2 +- .../GridMonteCarloExamplesSelfTest.java | 2 +- 71 files changed, 377 insertions(+), 375 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/example-cache.xml ---------------------------------------------------------------------- diff --git a/examples/config/example-cache.xml b/examples/config/example-cache.xml index 9ec2ef2..70ffa80 100644 --- a/examples/config/example-cache.xml +++ b/examples/config/example-cache.xml @@ -18,13 +18,13 @@ --> <!-- - GridGain Spring configuration file to startup grid cache. + Ignite Spring configuration file to startup grid cache. - When starting a standalone GridGain node, you need to execute the following command: + When starting a standalone node, you need to execute the following command: {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-cache.xml - When starting GridGain from Java IDE, pass path to this file to GridGain: - GridGain.start("examples/config/example-cache.xml"); + When starting Ignite from Java IDE, pass path to this file to Ignition: + Ignition.start("examples/config/example-cache.xml"); --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -106,7 +106,7 @@ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> <property name="ipFinder"> <!-- - GridGain provides several options for automatic discovery that can be used + Ignite provides several options for automatic discovery that can be used instead os static IP based discovery. For information on all options refer to our documentation: http://doc.gridgain.org/latest/Automatic+Node+Discovery --> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/example-compute.xml ---------------------------------------------------------------------- diff --git a/examples/config/example-compute.xml b/examples/config/example-compute.xml index af32d1b..420ccdf 100644 --- a/examples/config/example-compute.xml +++ b/examples/config/example-compute.xml @@ -49,7 +49,7 @@ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> <property name="ipFinder"> <!-- - GridGain provides several options for automatic discovery that can be used + Ignite provides several options for automatic discovery that can be used instead os static IP based discovery. For information on all options refer to our documentation: http://doc.gridgain.org/latest/Automatic+Node+Discovery --> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/example-streamer.xml ---------------------------------------------------------------------- diff --git a/examples/config/example-streamer.xml b/examples/config/example-streamer.xml index c13b90d..0d9c024 100644 --- a/examples/config/example-streamer.xml +++ b/examples/config/example-streamer.xml @@ -18,18 +18,18 @@ --> <!-- - GridGain Spring configuration file to startup grid with streamers. + Ignite Spring configuration file to startup grid with streamers. - When starting a standalone GridGain node, you need to execute the following command: + When starting a standalone node, you need to execute the following command: {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/example-streamer.xml When starting nodes this way JAR file containing the examples code should be placed to {IGNITE_HOME}/libs folder. You can build - gridgain-examples.jar by running "mvn package" in {IGNITE_HOME}/examples folder. - After that gridgain-examples.jar will be generated by Maven in + ignite-examples.jar by running "mvn package" in {IGNITE_HOME}/examples folder. + After that ignite-examples.jar will be generated by Maven in {IGNITE_HOME}/examples/target folder. - When starting GridGain from Java IDE, pass path to this file into GridGain: - GridGain.start("examples/config/example-streamer.xml"); + When starting Ignite from Java IDE, pass path to this file to Ignition: + Ignition.start("examples/config/example-cache.xml"); --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -88,7 +88,7 @@ --> <bean class="org.apache.ignite.streamer.router.StreamerRandomEventRouter"/> <!-- - <bean class="org.gridgain.grid.streamer.router.GridStreamerLocalEventRouter"/> + <bean class="org.apache.ignite.streamer.router.GridStreamerLocalEventRouter"/> --> </property> @@ -272,7 +272,7 @@ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> <property name="ipFinder"> <!-- - GridGain provides several options for automatic discovery that can be used + Ignite provides several options for automatic discovery that can be used instead os static IP based discovery. For information on all options refer to our documentation: http://doc.gridgain.org/latest/Automatic+Node+Discovery --> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/filesystem/core-site.xml ---------------------------------------------------------------------- diff --git a/examples/config/filesystem/core-site.xml b/examples/config/filesystem/core-site.xml index c9d78f2..58ae948 100644 --- a/examples/config/filesystem/core-site.xml +++ b/examples/config/filesystem/core-site.xml @@ -19,7 +19,7 @@ --> <!-- - Example configuration of the Hadoop FS driver over GridGain FS API. + Example configuration of the Hadoop FS driver over Ignite FS API. Copy this file into '$HADOOP_HOME/conf/core-site.xml'. --> <configuration> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/filesystem/example-ggfs.xml ---------------------------------------------------------------------- diff --git a/examples/config/filesystem/example-ggfs.xml b/examples/config/filesystem/example-ggfs.xml index fb64227..9f19a42 100644 --- a/examples/config/filesystem/example-ggfs.xml +++ b/examples/config/filesystem/example-ggfs.xml @@ -18,13 +18,13 @@ --> <!-- - GridGain Spring configuration file to startup grid cache. + Ignite Spring configuration file to startup grid cache. - When starting a standalone GridGain node, you need to execute the following command: + When starting a standalone node, you need to execute the following command: {IGNITE_HOME}/bin/ignite.{bat|sh} examples/config/filesystem/example-ggfs.xml - When starting GridGain from Java IDE, pass path to this file into GridGain: - GridGain.start("examples/config/filesystem/example-ggfs.xml"); + When starting Ignite from Java IDE, pass path to this file into Ignition: + Ignition.start("examples/config/filesystem/example-ggfs.xml"); --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" @@ -81,7 +81,7 @@ <!-- This will disable IPC endpoint binding thus preventing Hadoop clients from connecting to GGFS. With this option set to false the only possible way to interact with GGFS is through - GridGain API. + Ignite API. --> <property name="ipcEndpointEnabled" value="false"/> @@ -144,7 +144,7 @@ <bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi"> <property name="ipFinder"> <!-- - GridGain provides several options for automatic discovery that can be used + Ignition provides several options for automatic discovery that can be used instead os static IP based discovery. For information on all options refer to our documentation: http://doc.gridgain.org/latest/Automatic+Node+Discovery --> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/hibernate/example-hibernate-L2-cache.xml ---------------------------------------------------------------------- diff --git a/examples/config/hibernate/example-hibernate-L2-cache.xml b/examples/config/hibernate/example-hibernate-L2-cache.xml index 779dd36..0c69248 100644 --- a/examples/config/hibernate/example-hibernate-L2-cache.xml +++ b/examples/config/hibernate/example-hibernate-L2-cache.xml @@ -41,7 +41,7 @@ <!-- Generate L2 cache statistics. --> <property name="generate_statistics">true</property> - <!-- Specify GridGain as L2 cache provider. --> + <!-- Specify Ignite as L2 cache provider. --> <property name="cache.region.factory_class">org.apache.ignite.cache.hibernate.GridHibernateRegionFactory</property> <!-- Specify the name of the grid, that will be used for second level caching. --> http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/config/servlet/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/examples/config/servlet/WEB-INF/web.xml b/examples/config/servlet/WEB-INF/web.xml index d099aeb..f48921e 100644 --- a/examples/config/servlet/WEB-INF/web.xml +++ b/examples/config/servlet/WEB-INF/web.xml @@ -18,7 +18,7 @@ --> <!-- - Example web.xml to startup GridGain from Servlet container, like Tomcat. + Example web.xml to startup Ignite from Servlet container, like Tomcat. --> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/rest/http-rest-example.php ---------------------------------------------------------------------- diff --git a/examples/rest/http-rest-example.php b/examples/rest/http-rest-example.php index 26bb394..c853e3c 100644 --- a/examples/rest/http-rest-example.php +++ b/examples/rest/http-rest-example.php @@ -19,7 +19,7 @@ */ /** - * To execute this script simply start up an instance of GridGain with cache enabled. + * To execute this script simply start up an instance of Ignite with cache enabled. * You can use any cache configuration from examples/config folder as follows: * ---- * ${IGNITE_HOME}/bin/ignite.sh examples/config/example-cache.xml @@ -95,9 +95,9 @@ function execute($query, $post) { curl_close($request); if (!$response) - die('Nothing was returned. Do you have a connection to GridGain Jetty server?'); + die('Nothing was returned. Do you have a connection to Ignite Jetty server?'); - echo "Response received from GridGain: $response\n\n"; + echo "Response received from Ignite: $response\n\n"; // JSON decoder. $result = json_decode($response, true); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/rest/memcache-rest-example.php ---------------------------------------------------------------------- diff --git a/examples/rest/memcache-rest-example.php b/examples/rest/memcache-rest-example.php index b8509cf..b019eb1 100644 --- a/examples/rest/memcache-rest-example.php +++ b/examples/rest/memcache-rest-example.php @@ -19,13 +19,13 @@ */ /** - * This example shows how to use PHP Memcache client for manipulating GridGain cache. + * This example shows how to use PHP Memcache client for manipulating Ignite cache. * * To execute this script you need to have PHP Memcached extension installed. * See http://pecl.php.net/package/memcached for details. * * You can use default cache configuration from examples/config folder to - * start up an instance of GridGain with cache enabled as follows: + * start up an instance of Ignite with cache enabled as follows: * ---- * ${IGNITE_HOME}/bin/ignite.sh examples/config/example-cache-default.xml * ---- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/ExamplesUtils.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/ExamplesUtils.java b/examples/src/main/java/org/apache/ignite/examples/ExamplesUtils.java index 2874fd8..5098156 100644 --- a/examples/src/main/java/org/apache/ignite/examples/ExamplesUtils.java +++ b/examples/src/main/java/org/apache/ignite/examples/ExamplesUtils.java @@ -82,7 +82,7 @@ public class ExamplesUtils { } /** - * @param ignite Grid. + * @param ignite Ignite. * @param name Streamer name. * @return {@code True} if grid has streamer with given name. */ http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeBroadcastExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeBroadcastExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeBroadcastExample.java index a12b6ac..b7a2612 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeBroadcastExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeBroadcastExample.java @@ -30,7 +30,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeBroadcastExample { @@ -54,14 +54,14 @@ public class ComputeBroadcastExample { } /** - * Print 'Hello' message on all grid nodes. + * Print 'Hello' message on all nodes. * - * @param g Grid instance. + * @param ignite Ignite instance. * @throws IgniteCheckedException If failed. */ - private static void hello(Ignite g) throws IgniteCheckedException { + private static void hello(Ignite ignite) throws IgniteCheckedException { // Print out hello message on all nodes. - g.compute().broadcast( + ignite.compute().broadcast( new IgniteRunnable() { @Override public void run() { System.out.println(); @@ -77,22 +77,22 @@ public class ComputeBroadcastExample { /** * Gather system info from all nodes and print it out. * - * @param g Grid instance. + * @param ignite Ignite instance. * @throws IgniteCheckedException if failed. */ - private static void gatherSystemInfo(Ignite g) throws IgniteCheckedException { + private static void gatherSystemInfo(Ignite ignite) throws IgniteCheckedException { // Gather system info from all nodes. - Collection<String> res = g.compute().broadcast( + Collection<String> res = ignite.compute().broadcast( new IgniteCallable<String>() { - // Automatically inject grid instance. + // Automatically inject ignite instance. @IgniteInstanceResource - private Ignite grid; + private Ignite ignite; @Override public String call() { System.out.println(); - System.out.println("Executing task on node: " + grid.cluster().localNode().id()); + System.out.println("Executing task on node: " + ignite.cluster().localNode().id()); - return "Node ID: " + grid.cluster().localNode().id() + "\n" + + return "Node ID: " + ignite.cluster().localNode().id() + "\n" + "OS: " + System.getProperty("os.name") + " " + System.getProperty("os.version") + " " + System.getProperty("os.arch") + "\n" + "User: " + System.getProperty("user.name") + "\n" + http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeCallableExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeCallableExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeCallableExample.java index 880ed10..1f50b13 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeCallableExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeCallableExample.java @@ -33,7 +33,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeCallableExample { @@ -44,7 +44,7 @@ public class ComputeCallableExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println(">>> Compute callable example started."); @@ -63,7 +63,7 @@ public class ComputeCallableExample { } // Execute collection of callables on the grid. - Collection<Integer> res = g.compute().call(calls); + Collection<Integer> res = ignite.compute().call(calls); int sum = 0; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeClosureExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeClosureExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeClosureExample.java index d0b2538..a206a9f 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeClosureExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeClosureExample.java @@ -24,7 +24,7 @@ import org.apache.ignite.lang.*; import java.util.*; /** - * Demonstrates a simple use of GridGain grid with reduce closure. + * Demonstrates a simple use of Ignite grid with reduce closure. * <p> * This example splits a phrase into collection of words, computes their length on different * nodes and then computes total amount of non-whitespaces characters in the phrase. @@ -32,7 +32,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeClosureExample { @@ -43,12 +43,12 @@ public class ComputeClosureExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println(">>> Compute closure example started."); // Execute closure on all grid nodes. - Collection<Integer> res = g.compute().apply( + Collection<Integer> res = ignite.compute().apply( new IgniteClosure<String, Integer>() { @Override public Integer apply(String word) { System.out.println(); @@ -59,7 +59,7 @@ public class ComputeClosureExample { } }, - // Job parameters. GridGain will create as many jobs as there are parameters. + // Job parameters. Ignite will create as many jobs as there are parameters. Arrays.asList("Count characters using closure".split(" ")) ); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeContinuousMapperExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeContinuousMapperExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeContinuousMapperExample.java index cfbbc94..ce78041 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeContinuousMapperExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeContinuousMapperExample.java @@ -42,7 +42,7 @@ import java.util.concurrent.atomic.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeContinuousMapperExample { @@ -56,8 +56,8 @@ public class ComputeContinuousMapperExample { System.out.println(); System.out.println(">>> Compute continuous mapper example started."); - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { - int phraseLen = g.compute().execute(GridContinuousMapperTask.class, "Hello Continuous Mapper"); + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { + int phraseLen = ignite.compute().execute(GridContinuousMapperTask.class, "Hello Continuous Mapper"); System.out.println(); System.out.println(">>> Total number of characters in the phrase is '" + phraseLen + "'."); @@ -69,7 +69,7 @@ public class ComputeContinuousMapperExample { * is split into multiple words and next word is sent out for processing only * when the result for the previous word was received. * <p> - * Note that annotation {@link org.apache.ignite.compute.ComputeTaskNoResultCache} is optional and tells GridGain + * Note that annotation {@link org.apache.ignite.compute.ComputeTaskNoResultCache} is optional and tells Ignite * not to accumulate results from individual jobs. In this example we increment * total character count directly in {@link #result(org.apache.ignite.compute.ComputeJobResult, List)} method, * and therefore don't need to accumulate them be be processed at reduction step. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeExecutorServiceExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeExecutorServiceExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeExecutorServiceExample.java index 38f277f..62ab8a4 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeExecutorServiceExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeExecutorServiceExample.java @@ -24,12 +24,12 @@ import org.apache.ignite.lang.*; import java.util.concurrent.*; /** - * Simple example to demonstrate usage of grid-enabled executor service provided by GridGain. + * Simple example to demonstrate usage of grid-enabled executor service provided by Ignite. * <p> * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public final class ComputeExecutorServiceExample { @@ -41,12 +41,12 @@ public final class ComputeExecutorServiceExample { */ @SuppressWarnings({"TooBroadScope"}) public static void main(String[] args) throws Exception { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println(">>> Compute executor service example started."); // Get grid-enabled executor service. - ExecutorService exec = g.executorService(); + ExecutorService exec = ignite.executorService(); // Iterate through all words in the sentence and create callable jobs. for (final String word : "Print words using runnable".split(" ")) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeFibonacciContinuationExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeFibonacciContinuationExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeFibonacciContinuationExample.java index 6f2ced7..8c5e3a4 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeFibonacciContinuationExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeFibonacciContinuationExample.java @@ -30,7 +30,7 @@ import java.math.*; import java.util.*; /** - * This example demonstrates how to use continuation feature of GridGain by + * This example demonstrates how to use continuation feature of Ignite by * performing the distributed recursive calculation of {@code 'Fibonacci'} * numbers on the grid. Continuations * functionality is exposed via {@link org.apache.ignite.compute.ComputeJobContext#holdcc()} and @@ -39,7 +39,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public final class ComputeFibonacciContinuationExample { @@ -50,25 +50,25 @@ public final class ComputeFibonacciContinuationExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Compute Fibonacci continuation example started."); long N = 100; - final UUID exampleNodeId = g.cluster().localNode().id(); + final UUID exampleNodeId = ignite.cluster().localNode().id(); // Filter to exclude this node from execution. final IgnitePredicate<ClusterNode> nodeFilter = new IgnitePredicate<ClusterNode>() { @Override public boolean apply(ClusterNode n) { // Give preference to remote nodes. - return g.cluster().forRemotes().nodes().isEmpty() || !n.id().equals(exampleNodeId); + return ignite.cluster().forRemotes().nodes().isEmpty() || !n.id().equals(exampleNodeId); } }; long start = System.currentTimeMillis(); - BigInteger fib = g.compute(g.cluster().forPredicate(nodeFilter)).apply(new FibonacciClosure(nodeFilter), N); + BigInteger fib = ignite.compute(ignite.cluster().forPredicate(nodeFilter)).apply(new FibonacciClosure(nodeFilter), N); long duration = System.currentTimeMillis() - start; @@ -96,9 +96,9 @@ public final class ComputeFibonacciContinuationExample { @IgniteJobContextResource private ComputeJobContext jobCtx; - /** Auto-inject grid instance. */ + /** Auto-inject ignite instance. */ @IgniteInstanceResource - private Ignite g; + private Ignite ignite; /** Predicate. */ private final IgnitePredicate<ClusterNode> nodeFilter; @@ -124,15 +124,15 @@ public final class ComputeFibonacciContinuationExample { return n == 0 ? BigInteger.ZERO : BigInteger.ONE; // Node-local storage. - ClusterNodeLocalMap<Long, IgniteInternalFuture<BigInteger>> locMap = g.cluster().nodeLocalMap(); + ClusterNodeLocalMap<Long, IgniteInternalFuture<BigInteger>> locMap = ignite.cluster().nodeLocalMap(); // Check if value is cached in node-local-map first. fut1 = locMap.get(n - 1); fut2 = locMap.get(n - 2); - ClusterGroup p = g.cluster().forPredicate(nodeFilter); + ClusterGroup p = ignite.cluster().forPredicate(nodeFilter); - IgniteCompute compute = g.compute(p).withAsync(); + IgniteCompute compute = ignite.compute(p).withAsync(); // If future is not cached in node-local-map, cache it. if (fut1 == null) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeProjectionExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeProjectionExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeProjectionExample.java index 0131003..a363578 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeProjectionExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeProjectionExample.java @@ -28,7 +28,7 @@ import org.apache.ignite.lang.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeProjectionExample { @@ -49,7 +49,6 @@ public class ComputeProjectionExample { IgniteCluster cluster = ignite.cluster(); // Say hello to all nodes in the grid, including local node. - // Note, that Grid itself also implements GridProjection. sayHello(ignite, cluster); // Say hello to all remote nodes. @@ -74,10 +73,10 @@ public class ComputeProjectionExample { } /** - * Print 'Hello' message on remote grid nodes. + * Print 'Hello' message on remote nodes. * - * @param ignite Grid. - * @param prj Grid projection. + * @param ignite Ignite. + * @param prj Projection. * @throws IgniteCheckedException If failed. */ private static void sayHello(Ignite ignite, final ClusterGroup prj) throws IgniteCheckedException { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeReducerExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeReducerExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeReducerExample.java index 4942875..7aed33e 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeReducerExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeReducerExample.java @@ -25,15 +25,15 @@ import java.util.*; import java.util.concurrent.atomic.*; /** - * Demonstrates a simple use of GridGain grid with reduce closure. + * Demonstrates a simple use of Ignite grid with reduce closure. * <p> - * Phrase is split into words and distributed across Grid nodes where length of each word is + * Phrase is split into words and distributed across nodes where length of each word is * calculated. Then total phrase length is calculated using reducer. * <p> * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start Ignite node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeReducerExample { @@ -44,11 +44,11 @@ public class ComputeReducerExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Compute reducer example started."); - Integer sum = g.compute().apply( + Integer sum = ignite.compute().apply( new IgniteClosure<String, Integer>() { @Override public Integer apply(String word) { System.out.println(); @@ -59,7 +59,7 @@ public class ComputeReducerExample { } }, - // Job parameters. GridGain will create as many jobs as there are parameters. + // Job parameters. Ignite will create as many jobs as there are parameters. Arrays.asList("Count characters using reducer".split(" ")), // Reducer to process results as they come. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeRunnableExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeRunnableExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeRunnableExample.java index e062335..b6fe8d9 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeRunnableExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeRunnableExample.java @@ -30,7 +30,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeRunnableExample { @@ -41,14 +41,14 @@ public class ComputeRunnableExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Compute runnable example started."); Collection<IgniteInternalFuture> futs = new ArrayList<>(); // Enable asynchronous mode. - IgniteCompute compute = g.compute().withAsync(); + IgniteCompute compute = ignite.compute().withAsync(); // Iterate through all words in the sentence and create callable jobs. for (final String word : "Print words using runnable".split(" ")) { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeScheduleExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeScheduleExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeScheduleExample.java index 7802f75..6cd7fc7 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeScheduleExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeScheduleExample.java @@ -32,7 +32,7 @@ import java.util.concurrent.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeScheduleExample { @@ -43,12 +43,12 @@ public class ComputeScheduleExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Compute schedule example started."); // Schedule output message every minute. - SchedulerFuture<?> fut = g.scheduler().scheduleLocal( + SchedulerFuture<?> fut = ignite.scheduler().scheduleLocal( new Callable<Integer>() { private int invocations; @@ -56,7 +56,7 @@ public class ComputeScheduleExample { invocations++; try { - g.compute().broadcast( + ignite.compute().broadcast( new IgniteRunnable() { @Override public void run() { System.out.println(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskMapExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskMapExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskMapExample.java index bd3fc67..5127b89 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskMapExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskMapExample.java @@ -26,7 +26,7 @@ import org.jetbrains.annotations.*; import java.util.*; /** - * Demonstrates a simple use of GridGain grid with + * Demonstrates a simple use of Ignite grid with * {@link org.apache.ignite.compute.ComputeTaskAdapter}. * <p> * Phrase passed as task argument is split into words on map stage and distributed among grid nodes. @@ -36,7 +36,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeTaskMapExample { @@ -47,12 +47,12 @@ public class ComputeTaskMapExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Compute task map example started."); // Execute task on the grid and wait for its completion. - int cnt = g.compute().execute(CharacterCountTask.class, "Hello Grid Enabled World!"); + int cnt = ignite.compute().execute(CharacterCountTask.class, "Hello Grid Enabled World!"); System.out.println(); System.out.println(">>> Total number of characters in the phrase is '" + cnt + "'."); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskSplitExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskSplitExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskSplitExample.java index d6c7d4c..cf991c2 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskSplitExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/ComputeTaskSplitExample.java @@ -25,7 +25,7 @@ import org.jetbrains.annotations.*; import java.util.*; /** - * Demonstrates a simple use of GridGain grid with {@link org.apache.ignite.compute.ComputeTaskSplitAdapter}. + * Demonstrates a simple use of Ignite grid with {@link org.apache.ignite.compute.ComputeTaskSplitAdapter}. * <p> * Phrase passed as task argument is split into jobs each taking one word. Then jobs are distributed among * grid nodes. Each node computes word length and returns result to master node where total phrase length @@ -34,7 +34,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public class ComputeTaskSplitExample { @@ -45,12 +45,12 @@ public class ComputeTaskSplitExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Compute task split example started."); // Execute task on the grid and wait for its completion. - int cnt = g.compute().execute(CharacterCountTask.class, "Hello Grid Enabled World!"); + int cnt = ignite.compute().execute(CharacterCountTask.class, "Hello Grid Enabled World!"); System.out.println(); System.out.println(">>> Total number of characters in the phrase is '" + cnt + "'."); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverExample.java index fa065aa..23fbbe9 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverExample.java @@ -27,7 +27,7 @@ import org.apache.ignite.internal.util.lang.*; import java.util.*; /** - * Demonstrates the usage of checkpoints in GridGain. + * Demonstrates the usage of checkpoints in Ignite. * <p> * The example tries to compute phrase length. In order to mitigate possible node failures, intermediate * result is saved as as checkpoint after each job step. @@ -42,15 +42,15 @@ public class ComputeFailoverExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start(ComputeFailoverNodeStartup.configuration())) { - if (!ExamplesUtils.checkMinTopologySize(g.cluster(), 2)) + try (Ignite ignite = Ignition.start(ComputeFailoverNodeStartup.configuration())) { + if (!ExamplesUtils.checkMinTopologySize(ignite.cluster(), 2)) return; System.out.println(); System.out.println("Compute failover example started."); // Number of letters. - int charCnt = g.compute().apply(new CheckPointJob(), "Stage1 Stage2"); + int charCnt = ignite.compute().apply(new CheckPointJob(), "Stage1 Stage2"); System.out.println(); System.out.println(">>> Finished executing fail-over example with checkpoints."); @@ -66,7 +66,7 @@ public class ComputeFailoverExample { @IgniteTaskSessionResource private ComputeTaskSession jobSes; - /** Injected grid logger. */ + /** Injected ignite logger. */ @IgniteLoggerResource private IgniteLogger log; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverNodeStartup.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverNodeStartup.java index dcfbdf9..0c64c83 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverNodeStartup.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/failover/ComputeFailoverNodeStartup.java @@ -43,9 +43,9 @@ public class ComputeFailoverNodeStartup { } /** - * Create Grid configuration with configured checkpoints. + * Create Ignite configuration with configured checkpoints. * - * @return Grid configuration. + * @return Ignite configuration. * @throws IgniteCheckedException If configuration creation failed. */ public static IgniteConfiguration configuration() throws IgniteCheckedException { http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/compute/montecarlo/CreditRiskExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/compute/montecarlo/CreditRiskExample.java b/examples/src/main/java/org/apache/ignite/examples/compute/montecarlo/CreditRiskExample.java index 49a2667..e8bbf43 100644 --- a/examples/src/main/java/org/apache/ignite/examples/compute/montecarlo/CreditRiskExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/compute/montecarlo/CreditRiskExample.java @@ -29,7 +29,7 @@ import java.util.*; * Remote nodes should always be started with special configuration file which * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-compute.xml'}. * <p> - * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start GridGain node + * Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start node * with {@code examples/config/example-compute.xml} configuration. */ public final class CreditRiskExample { @@ -40,7 +40,7 @@ public final class CreditRiskExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-compute.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) { System.out.println(); System.out.println("Credit risk example started."); @@ -78,7 +78,7 @@ public final class CreditRiskExample { // Credit risk crdRisk is the minimal amount that creditor has to have // available to cover possible defaults. - double crdRisk = g.compute().call(jobs(g.cluster().nodes().size(), portfolio, horizon, iter, percentile), + double crdRisk = ignite.compute().call(jobs(ignite.cluster().nodes().size(), portfolio, horizon, iter, percentile), new IgniteReducer<Double, Double>() { /** Collected values sum. */ private double sum; @@ -134,7 +134,7 @@ public final class CreditRiskExample { // will be identical. In real life scenarios when heterogeneous environment // is used a split that is weighted by, for example, CPU benchmarks of each // node in the split will be more efficient. It is fairly easy addition and - // GridGain comes with convenient Spring-compatible benchmark that can be + // Ignite comes with convenient Spring-compatible benchmark that can be // used for weighted splits. for (int i = 0; i < gridSize; i++) { final int nodeIter = i == gridSize - 1 ? lastNodeIter : iterPerNode; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java index aa99368..e75e781 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheAffinityExample.java @@ -33,7 +33,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public final class CacheAffinityExample { /** Cache name. */ @@ -49,11 +49,11 @@ public final class CacheAffinityExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache affinity example started."); - IgniteCache<Integer, String> cache = g.jcache(CACHE_NAME); + IgniteCache<Integer, String> cache = ignite.jcache(CACHE_NAME); // Clean up caches on all nodes before run. cache.clear(); @@ -76,9 +76,9 @@ public final class CacheAffinityExample { * @throws IgniteCheckedException If failed. */ private static void visitUsingAffinityRun() throws IgniteCheckedException { - Ignite g = Ignition.ignite(); + Ignite ignite = Ignition.ignite(); - final IgniteCache<Integer, String> cache = g.jcache(CACHE_NAME); + final IgniteCache<Integer, String> cache = ignite.jcache(CACHE_NAME); for (int i = 0; i < KEY_CNT; i++) { final int key = i; @@ -86,7 +86,7 @@ public final class CacheAffinityExample { // This runnable will execute on the remote node where // data with the given key is located. Since it will be co-located // we can use local 'peek' operation safely. - g.compute().affinityRun(CACHE_NAME, key, new IgniteRunnable() { + ignite.compute().affinityRun(CACHE_NAME, key, new IgniteRunnable() { @Override public void run() { // Peek is a local memory lookup, however, value should never be 'null' // as we are co-located with node that has a given key. @@ -104,7 +104,7 @@ public final class CacheAffinityExample { * @throws IgniteCheckedException If failed. */ private static void visitUsingMapKeysToNodes() throws IgniteCheckedException { - final Ignite g = Ignition.ignite(); + final Ignite ignite = Ignition.ignite(); Collection<Integer> keys = new ArrayList<>(KEY_CNT); @@ -112,7 +112,7 @@ public final class CacheAffinityExample { keys.add(i); // Map all keys to nodes. - Map<ClusterNode, Collection<Integer>> mappings = g.cluster().mapKeysToNodes(CACHE_NAME, keys); + Map<ClusterNode, Collection<Integer>> mappings = ignite.cluster().mapKeysToNodes(CACHE_NAME, keys); for (Map.Entry<ClusterNode, Collection<Integer>> mapping : mappings.entrySet()) { ClusterNode node = mapping.getKey(); @@ -121,9 +121,10 @@ public final class CacheAffinityExample { if (node != null) { // Bring computations to the nodes where the data resides (i.e. collocation). - g.compute(g.cluster().forNode(node)).run(new IgniteRunnable() { - @Override public void run() { - IgniteCache<Integer, String> cache = g.jcache(CACHE_NAME); + ignite.compute(ignite.cluster().forNode(node)).run(new IgniteRunnable() { + @Override + public void run() { + IgniteCache<Integer, String> cache = ignite.jcache(CACHE_NAME); // Peek is a local memory lookup, however, value should never be 'null' // as we are co-located with node that has a given key. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java index 269d841..0666fbb 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheApiExample.java @@ -31,7 +31,7 @@ import java.util.concurrent.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CacheApiExample { /** Cache name. */ @@ -44,12 +44,12 @@ public class CacheApiExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache API example started."); // Clean up caches on all nodes before run. - g.jcache(CACHE_NAME).clear(); + ignite.jcache(CACHE_NAME).clear(); // Demonstrate atomic map operations. atomicMapOperations(); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java index d801148..9ee65f7 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheContinuousQueryExample.java @@ -31,7 +31,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CacheContinuousQueryExample { /** Cache name. */ @@ -44,11 +44,11 @@ public class CacheContinuousQueryExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException, InterruptedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache continuous query example started."); - GridCache<Integer, String> cache = g.cache(CACHE_NAME); + GridCache<Integer, String> cache = ignite.cache(CACHE_NAME); // Clean up caches on all nodes before run. cache.globalClearAll(0); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataLoaderExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataLoaderExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataLoaderExample.java index 0fdd3db..7d6f8b6 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataLoaderExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheDataLoaderExample.java @@ -30,7 +30,7 @@ import org.apache.ignite.examples.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CacheDataLoaderExample { /** Cache name. */ @@ -51,19 +51,19 @@ public class CacheDataLoaderExample { public static void main(String[] args) throws Exception { ExamplesUtils.checkMinMemory(MIN_MEMORY); - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache data loader example started."); // Clean up caches on all nodes before run. - g.jcache(CACHE_NAME).clear(); + ignite.jcache(CACHE_NAME).clear(); System.out.println(); System.out.println(">>> Cache clear finished."); long start = System.currentTimeMillis(); - try (IgniteDataLoader<Integer, String> ldr = g.dataLoader(CACHE_NAME)) { + try (IgniteDataLoader<Integer, String> ldr = ignite.dataLoader(CACHE_NAME)) { // Configure loader. ldr.perNodeBufferSize(1024); ldr.perNodeParallelLoadOperations(8); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java index dd7ab89..1aabeb8 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheEventsExample.java @@ -34,7 +34,7 @@ import static org.apache.ignite.events.IgniteEventType.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CacheEventsExample { /** Cache name. */ @@ -47,11 +47,11 @@ public class CacheEventsExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException, InterruptedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache events example started."); - final IgniteCache<Integer, String> cache = g.jcache(CACHE_NAME); + final IgniteCache<Integer, String> cache = ignite.jcache(CACHE_NAME); // Clean up caches on all nodes before run. cache.clear(); @@ -75,13 +75,13 @@ public class CacheEventsExample { int key = evt.key(); - return key >= 10 && g.affinity(CACHE_NAME).isPrimary(g.cluster().localNode(), key); + return key >= 10 && ignite.affinity(CACHE_NAME).isPrimary(ignite.cluster().localNode(), key); } }; // Subscribe to specified cache events on all nodes that have cache running. // Cache events are explicitly enabled in examples/config/example-cache.xml file. - g.events(g.cluster().forCache(CACHE_NAME)).remoteListen(locLsnr, rmtLsnr, + ignite.events(ignite.cluster().forCache(CACHE_NAME)).remoteListen(locLsnr, rmtLsnr, EVT_CACHE_OBJECT_PUT, EVT_CACHE_OBJECT_READ, EVT_CACHE_OBJECT_REMOVED); // Generate cache events. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java index 51cc3b7..1dc1246 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePopularNumbersExample.java @@ -33,7 +33,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CachePopularNumbersExample { /** Cache name. */ @@ -60,14 +60,14 @@ public class CachePopularNumbersExample { public static void main(String[] args) throws Exception { Timer popularNumbersQryTimer = new Timer("numbers-query-worker"); - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache popular numbers example started."); // Clean up caches on all nodes before run. - g.jcache(CACHE_NAME).clear(); + ignite.jcache(CACHE_NAME).clear(); - ClusterGroup prj = g.cluster().forCache(CACHE_NAME); + ClusterGroup prj = ignite.cluster().forCache(CACHE_NAME); if (prj.nodes().isEmpty()) { System.out.println("Grid does not have cache configured: " + CACHE_NAME); @@ -75,9 +75,9 @@ public class CachePopularNumbersExample { return; } - TimerTask task = scheduleQuery(g, popularNumbersQryTimer, POPULAR_NUMBERS_CNT); + TimerTask task = scheduleQuery(ignite, popularNumbersQryTimer, POPULAR_NUMBERS_CNT); - streamData(g); + streamData(ignite); // Force one more run to get final counts. task.run(); @@ -89,11 +89,11 @@ public class CachePopularNumbersExample { /** * Populates cache in real time with numbers and keeps count for every number. * - * @param g Grid. + * @param ignite Ignite. * @throws IgniteCheckedException If failed. */ - private static void streamData(final Ignite g) throws IgniteCheckedException { - try (IgniteDataLoader<Integer, Long> ldr = g.dataLoader(CACHE_NAME)) { + private static void streamData(final Ignite ignite) throws IgniteCheckedException { + try (IgniteDataLoader<Integer, Long> ldr = ignite.dataLoader(CACHE_NAME)) { // Set larger per-node buffer size since our state is relatively small. ldr.perNodeBufferSize(2048); @@ -107,18 +107,18 @@ public class CachePopularNumbersExample { /** * Schedules our popular numbers query to run every 3 seconds. * - * @param g Grid. + * @param ignite Ignite. * @param timer Timer. * @param cnt Number of popular numbers to return. * @return Scheduled task. */ - private static TimerTask scheduleQuery(final Ignite g, Timer timer, final int cnt) { + private static TimerTask scheduleQuery(final Ignite ignite, Timer timer, final int cnt) { TimerTask task = new TimerTask() { private CacheQuery<List<?>> qry; @Override public void run() { // Get reference to cache. - GridCache<Integer, Long> cache = g.cache(CACHE_NAME); + GridCache<Integer, Long> cache = ignite.cache(CACHE_NAME); if (qry == null) qry = cache.queries(). http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePutGetExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePutGetExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePutGetExample.java index 231abbb..14a76ec 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePutGetExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CachePutGetExample.java @@ -29,7 +29,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CachePutGetExample { /** Cache name. */ @@ -42,9 +42,9 @@ public class CachePutGetExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws Exception { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { // Clean up caches on all nodes before run. - g.jcache(CACHE_NAME).clear(); + ignite.jcache(CACHE_NAME).clear(); // Individual puts and gets. putGet(); @@ -63,9 +63,9 @@ public class CachePutGetExample { System.out.println(); System.out.println(">>> Cache put-get example started."); - Ignite g = Ignition.ignite(); + Ignite ignite = Ignition.ignite(); - final IgniteCache<Integer, String> cache = g.jcache(CACHE_NAME); + final IgniteCache<Integer, String> cache = ignite.jcache(CACHE_NAME); final int keyCnt = 20; @@ -88,9 +88,9 @@ public class CachePutGetExample { System.out.println(); System.out.println(">>> Starting putAll-getAll example."); - Ignite g = Ignition.ignite(); + Ignite ignite = Ignition.ignite(); - final IgniteCache<Integer, String> cache = g.jcache(CACHE_NAME); + final IgniteCache<Integer, String> cache = ignite.jcache(CACHE_NAME); final int keyCnt = 20; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java index 3237348..773133c 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java @@ -62,7 +62,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CacheQueryExample { /** Cache name. */ @@ -75,12 +75,12 @@ public class CacheQueryExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws Exception { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache query example started."); // Clean up caches on all nodes before run. - g.jcache(CACHE_NAME).clear(); + ignite.jcache(CACHE_NAME).clear(); // Populate cache. initialize(); @@ -148,7 +148,7 @@ public class CacheQueryExample { "and lower(Organization.name) = lower(?)"); // Execute queries for find employees for different organizations. - print("Following people are 'GridGain' employees: ", qry.execute("GridGain").get()); + print("Following people are 'Ignite' employees: ", qry.execute("Ignite").get()); print("Following people are 'Other' employees: ", qry.execute("Other").get()); } @@ -181,7 +181,7 @@ public class CacheQueryExample { private static void sqlQueryWithReducers() throws IgniteCheckedException { CacheProjection<CacheAffinityKey<UUID>, Person> cache = Ignition.ignite().cache(CACHE_NAME); - // Calculate average of salary of all persons in GridGain. + // Calculate average of salary of all persons in Ignite. CacheQuery<Map.Entry<CacheAffinityKey<UUID>, Person>> qry = cache.queries().createSqlQuery( Person.class, "from Person, Organization where Person.orgId = Organization.id and " + @@ -205,7 +205,7 @@ public class CacheQueryExample { @Override public IgniteBiTuple<Double, Integer> reduce() { return new IgniteBiTuple<>(sum, cnt); } - }, "GridGain").get(); + }, "Ignite").get(); double sum = 0.0d; int cnt = 0; @@ -218,7 +218,7 @@ public class CacheQueryExample { double avg = sum / cnt; // Calculate average salary for a specific organization. - print("Average salary for 'GridGain' employees: " + avg); + print("Average salary for 'Ignite' employees: " + avg); } /** @@ -246,8 +246,8 @@ public class CacheQueryExample { } }; - // Query all nodes for names of all GridGain employees. - print("Names of all 'GridGain' employees: " + qry.execute(trans, "GridGain").get()); + // Query all nodes for names of all Ignite employees. + print("Names of all 'Ignite' employees: " + qry.execute(trans, "Ignite").get()); } /** @@ -310,7 +310,7 @@ public class CacheQueryExample { cache.projection(CacheAffinityKey.class, Person.class); // Organizations. - Organization org1 = new Organization("GridGain"); + Organization org1 = new Organization("Ignite"); Organization org2 = new Organization("Other"); // People. http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java index ee52b79..540543d 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheTransactionExample.java @@ -34,7 +34,7 @@ import static org.apache.ignite.transactions.IgniteTxIsolation.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public class CacheTransactionExample { /** Cache name. */ @@ -47,14 +47,14 @@ public class CacheTransactionExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache transaction example started."); // Clean up caches on all nodes before run. - g.jcache(CACHE_NAME).clear(); + ignite.jcache(CACHE_NAME).clear(); - IgniteCache<Integer, Account> cache = g.jcache(CACHE_NAME); + IgniteCache<Integer, Account> cache = ignite.jcache(CACHE_NAME); // Initialize. cache.put(1, new Account(1, 100)); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicLongExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicLongExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicLongExample.java index 51359fd..f6c6662 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicLongExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicLongExample.java @@ -31,7 +31,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public final class CacheAtomicLongExample { /** Cache name. */ @@ -47,7 +47,7 @@ public final class CacheAtomicLongExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache atomic long example started."); @@ -55,15 +55,16 @@ public final class CacheAtomicLongExample { String atomicName = UUID.randomUUID().toString(); // Initialize atomic long in grid. - final CacheAtomicLong atomicLong = g.cache(CACHE_NAME).dataStructures().atomicLong(atomicName, 0, true); + final CacheAtomicLong atomicLong = ignite.cache(CACHE_NAME).dataStructures().atomicLong(atomicName, 0, true); System.out.println(); System.out.println("Atomic long initial value : " + atomicLong.get() + '.'); // Try increment atomic long from all grid nodes. // Note that this node is also part of the grid. - g.compute(g.cluster().forCache(CACHE_NAME)).call(new IgniteCallable<Object>() { - @Override public Object call() throws Exception { + ignite.compute(ignite.cluster().forCache(CACHE_NAME)).call(new IgniteCallable<Object>() { + @Override + public Object call() throws Exception { for (int i = 0; i < RETRIES; i++) System.out.println("AtomicLong value has been incremented: " + atomicLong.incrementAndGet()); http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicReferenceExample.java ---------------------------------------------------------------------- diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicReferenceExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicReferenceExample.java index fa86d21..9e60c6c 100644 --- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicReferenceExample.java +++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicReferenceExample.java @@ -31,7 +31,7 @@ import java.util.*; * enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}. * <p> * Alternatively you can run {@link CacheNodeStartup} in another JVM which will - * start GridGain node with {@code examples/config/example-cache.xml} configuration. + * start node with {@code examples/config/example-cache.xml} configuration. */ public final class CacheAtomicReferenceExample { /** Cache name. */ @@ -44,7 +44,7 @@ public final class CacheAtomicReferenceExample { * @throws IgniteCheckedException If example execution failed. */ public static void main(String[] args) throws IgniteCheckedException { - try (Ignite g = Ignition.start("examples/config/example-cache.xml")) { + try (Ignite ignite = Ignition.start("examples/config/example-cache.xml")) { System.out.println(); System.out.println(">>> Cache atomic reference example started."); @@ -55,7 +55,7 @@ public final class CacheAtomicReferenceExample { String val = UUID.randomUUID().toString(); // Initialize atomic reference in grid. - CacheAtomicReference<String> ref = g.cache(CACHE_NAME).dataStructures(). + CacheAtomicReference<String> ref = ignite.cache(CACHE_NAME).dataStructures(). atomicReference(refName, val, true); System.out.println("Atomic reference initial value : " + ref.get() + '.'); @@ -64,7 +64,7 @@ public final class CacheAtomicReferenceExample { Runnable c = new ReferenceClosure(CACHE_NAME, refName); // Check atomic reference on all grid nodes. - g.compute().run(c); + ignite.compute().run(c); // Make new value of atomic reference. String newVal = UUID.randomUUID().toString(); @@ -75,7 +75,7 @@ public final class CacheAtomicReferenceExample { // Check atomic reference on all grid nodes. // Atomic reference value shouldn't be changed. - g.compute().run(c); + ignite.compute().run(c); System.out.println("Try to change value of atomic reference with correct expected value."); @@ -83,7 +83,7 @@ public final class CacheAtomicReferenceExample { // Check atomic reference on all grid nodes. // Atomic reference value should be changed. - g.compute().run(c); + ignite.compute().run(c); } System.out.println();
