You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/02/02 13:13:46 UTC
[1/3] incubator-ignite git commit: #IGNITE-106: Remove word GridGain
from examples.
Repository: incubator-ignite
Updated Branches:
refs/heads/ignite-106 b4a4f1b0d -> a234cdda1
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala
index 7dc8c5f..fd63601 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarTaskExample.scala
@@ -27,7 +27,7 @@ import scala.collection.JavaConversions._
/**
* Demonstrates use of full grid task API using Scalar. Note that using task-based
- * grid enabling gives you all the advanced features of GridGain such as custom topology
+ * grid enabling gives you all the advanced features of Ignite such as custom topology
* and collision resolution, custom failover, mapping, reduction, load balancing, etc.
* As a trade off in such cases the more code needs to be written vs. simple closure execution.
* <p>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/test/java/org/apache/ignite/examples/GridMonteCarloExamplesSelfTest.java
----------------------------------------------------------------------
diff --git a/examples/src/test/java/org/apache/ignite/examples/GridMonteCarloExamplesSelfTest.java b/examples/src/test/java/org/apache/ignite/examples/GridMonteCarloExamplesSelfTest.java
index 3d0a30c..89f49cc 100644
--- a/examples/src/test/java/org/apache/ignite/examples/GridMonteCarloExamplesSelfTest.java
+++ b/examples/src/test/java/org/apache/ignite/examples/GridMonteCarloExamplesSelfTest.java
@@ -28,7 +28,7 @@ import org.apache.ignite.testframework.junits.common.*;
* AOP configurations must be provided.
* <h2 class="header">Jboss AOP</h2>
* The following configuration needs to be applied to enable JBoss byte code
- * weaving. Note that GridGain is not shipped with JBoss and necessary
+ * weaving. Note that Ignite is not shipped with JBoss and necessary
* libraries will have to be downloaded separately (they come standard
* if you have JBoss installed already):
* <ul>
[2/3] incubator-ignite git commit: #IGNITE-106: Remove word GridGain
from examples.
Posted by sb...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
index 1e509ba..fc82bbb 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicSequenceExample.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 CacheAtomicSequenceExample {
/** Cache name. */
@@ -47,7 +47,7 @@ public final class CacheAtomicSequenceExample {
* @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 sequence example started.");
@@ -55,7 +55,7 @@ public final class CacheAtomicSequenceExample {
final String seqName = UUID.randomUUID().toString();
// Initialize atomic sequence in grid.
- CacheAtomicSequence seq = g.cache(CACHE_NAME).dataStructures().atomicSequence(seqName, 0, true);
+ CacheAtomicSequence seq = ignite.cache(CACHE_NAME).dataStructures().atomicSequence(seqName, 0, true);
// First value of atomic sequence on this node.
long firstVal = seq.get();
@@ -63,7 +63,7 @@ public final class CacheAtomicSequenceExample {
System.out.println("Sequence initial value: " + firstVal);
// Try increment atomic sequence on all grid nodes. Note that this node is also part of the grid.
- g.compute().run(new SequenceClosure(CACHE_NAME, seqName));
+ ignite.compute().run(new SequenceClosure(CACHE_NAME, seqName));
System.out.println("Sequence after incrementing [expected=" + (firstVal + RETRIES) + ", actual=" +
seq.get() + ']');
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicStampedExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicStampedExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicStampedExample.java
index 696c2fe..ba611fd 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicStampedExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheAtomicStampedExample.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 CacheAtomicStampedExample {
/** Cache name. */
@@ -44,7 +44,7 @@ public final class CacheAtomicStampedExample {
* @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 stamped example started.");
@@ -58,7 +58,7 @@ public final class CacheAtomicStampedExample {
String stamp = UUID.randomUUID().toString();
// Initialize atomic stamped in cache.
- CacheAtomicStamped<String, String> stamped = g.cache(CACHE_NAME).dataStructures().
+ CacheAtomicStamped<String, String> stamped = ignite.cache(CACHE_NAME).dataStructures().
atomicStamped(stampedName, val, stamp, true);
System.out.println("Atomic stamped initial [value=" + stamped.value() + ", stamp=" + stamped.stamp() + ']');
@@ -67,7 +67,7 @@ public final class CacheAtomicStampedExample {
Runnable c = new StampedUpdateClosure(CACHE_NAME, stampedName);
// Check atomic stamped on all grid nodes.
- g.compute().run(c);
+ ignite.compute().run(c);
// Make new value of atomic stamped.
String newVal = UUID.randomUUID().toString();
@@ -81,7 +81,7 @@ public final class CacheAtomicStampedExample {
// Check atomic stamped on all grid nodes.
// Atomic stamped value and stamp shouldn't be changed.
- g.compute().run(c);
+ ignite.compute().run(c);
System.out.println("Try to change value and stamp of atomic stamped with correct value and stamp.");
@@ -89,7 +89,7 @@ public final class CacheAtomicStampedExample {
// Check atomic stamped on all grid nodes.
// Atomic stamped value and stamp should be changed.
- g.compute().run(c);
+ ignite.compute().run(c);
}
System.out.println();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheCountDownLatchExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheCountDownLatchExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheCountDownLatchExample.java
index bd3c68b..9ddb9d7 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheCountDownLatchExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheCountDownLatchExample.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 CacheCountDownLatchExample {
/** Cache name. */
@@ -47,7 +47,7 @@ public class CacheCountDownLatchExample {
* @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 atomic countdown latch example started.");
@@ -55,14 +55,14 @@ public class CacheCountDownLatchExample {
final String latchName = UUID.randomUUID().toString();
// Initialize count down latch in grid.
- CacheCountDownLatch latch = g.cache(CACHE_NAME).dataStructures().
+ CacheCountDownLatch latch = ignite.cache(CACHE_NAME).dataStructures().
countDownLatch(latchName, INITIAL_COUNT, false, true);
System.out.println("Latch initial value: " + latch.count());
// Start waiting on the latch on all grid nodes.
for (int i = 0; i < INITIAL_COUNT; i++)
- g.compute().run(new LatchClosure(CACHE_NAME, latchName));
+ ignite.compute().run(new LatchClosure(CACHE_NAME, latchName));
// Wait for latch to go down which essentially means that all remote closures completed.
latch.await();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheQueueExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheQueueExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheQueueExample.java
index ae1f3b9..d0b4a15 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheQueueExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheQueueExample.java
@@ -32,7 +32,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 CacheQueueExample {
/** Cache name. */
@@ -51,20 +51,20 @@ public class CacheQueueExample {
* @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 queue example started.");
// Make queue name.
String queueName = UUID.randomUUID().toString();
- queue = initializeQueue(g, queueName);
+ queue = initializeQueue(ignite, queueName);
- readFromQueue(g);
+ readFromQueue(ignite);
- writeToQueue(g);
+ writeToQueue(ignite);
- clearAndRemoveQueue(g);
+ clearAndRemoveQueue(ignite);
}
System.out.println("Cache queue example finished.");
@@ -73,18 +73,18 @@ public class CacheQueueExample {
/**
* Initialize queue.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @param queueName Name of queue.
* @return Queue.
* @throws IgniteCheckedException If execution failed.
*/
- private static CacheQueue<String> initializeQueue(Ignite g, String queueName) throws IgniteCheckedException {
+ private static CacheQueue<String> initializeQueue(Ignite ignite, String queueName) throws IgniteCheckedException {
// Initialize new FIFO queue.
- CacheQueue<String> queue = g.cache(CACHE_NAME).dataStructures().queue(queueName, 0, false, true);
+ CacheQueue<String> queue = ignite.cache(CACHE_NAME).dataStructures().queue(queueName, 0, false, true);
// Initialize queue items.
// We will be use blocking operation and queue size must be appropriated.
- for (int i = 0; i < g.cluster().nodes().size() * RETRIES * 2; i++)
+ for (int i = 0; i < ignite.cluster().nodes().size() * RETRIES * 2; i++)
queue.put(Integer.toString(i));
System.out.println("Queue size after initializing: " + queue.size());
@@ -95,14 +95,14 @@ public class CacheQueueExample {
/**
* Read items from head and tail of queue.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If failed.
*/
- private static void readFromQueue(Ignite g) throws IgniteCheckedException {
+ private static void readFromQueue(Ignite ignite) throws IgniteCheckedException {
final String queueName = queue.name();
// Read queue items on each node.
- g.compute().run(new QueueClosure(CACHE_NAME, queueName, false));
+ ignite.compute().run(new QueueClosure(CACHE_NAME, queueName, false));
System.out.println("Queue size after reading [expected=0, actual=" + queue.size() + ']');
}
@@ -110,16 +110,16 @@ public class CacheQueueExample {
/**
* Write items into queue.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If failed.
*/
- private static void writeToQueue(Ignite g) throws IgniteCheckedException {
+ private static void writeToQueue(Ignite ignite) throws IgniteCheckedException {
final String queueName = queue.name();
// Write queue items on each node.
- g.compute().run(new QueueClosure(CACHE_NAME, queueName, true));
+ ignite.compute().run(new QueueClosure(CACHE_NAME, queueName, true));
- System.out.println("Queue size after writing [expected=" + g.cluster().nodes().size() * RETRIES +
+ System.out.println("Queue size after writing [expected=" + ignite.cluster().nodes().size() * RETRIES +
", actual=" + queue.size() + ']');
System.out.println("Iterate over queue.");
@@ -132,10 +132,10 @@ public class CacheQueueExample {
/**
* Clear and remove queue.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If execution failed.
*/
- private static void clearAndRemoveQueue(Ignite g) throws IgniteCheckedException {
+ private static void clearAndRemoveQueue(Ignite ignite) throws IgniteCheckedException {
System.out.println("Queue size before clearing: " + queue.size());
// Clear queue.
@@ -144,7 +144,7 @@ public class CacheQueueExample {
System.out.println("Queue size after clearing: " + queue.size());
// Remove queue from cache.
- g.cache(CACHE_NAME).dataStructures().removeQueue(queue.name());
+ ignite.cache(CACHE_NAME).dataStructures().removeQueue(queue.name());
// Try to work with removed queue.
try {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheSetExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheSetExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheSetExample.java
index dc68b1e..da49ea7 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheSetExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/datastructures/CacheSetExample.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 CacheSetExample {
/** Cache name. */
@@ -47,18 +47,18 @@ public class CacheSetExample {
* @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 set example started.");
// Make set name.
String setName = UUID.randomUUID().toString();
- set = initializeSet(g, setName);
+ set = initializeSet(ignite, setName);
- writeToSet(g);
+ writeToSet(ignite);
- clearAndRemoveSet(g);
+ clearAndRemoveSet(ignite);
}
System.out.println("Cache set example finished.");
@@ -67,14 +67,14 @@ public class CacheSetExample {
/**
* Initialize set.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @param setName Name of set.
* @return Set.
* @throws IgniteCheckedException If execution failed.
*/
- private static CacheSet<String> initializeSet(Ignite g, String setName) throws IgniteCheckedException {
+ private static CacheSet<String> initializeSet(Ignite ignite, String setName) throws IgniteCheckedException {
// Initialize new set.
- CacheSet<String> set = g.cache(CACHE_NAME).dataStructures().set(setName, false, true);
+ CacheSet<String> set = ignite.cache(CACHE_NAME).dataStructures().set(setName, false, true);
// Initialize set items.
for (int i = 0; i < 10; i++)
@@ -88,16 +88,16 @@ public class CacheSetExample {
/**
* Write items into set.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If failed.
*/
- private static void writeToSet(Ignite g) throws IgniteCheckedException {
+ private static void writeToSet(Ignite ignite) throws IgniteCheckedException {
final String setName = set.name();
// Write set items on each node.
- g.compute().broadcast(new SetClosure(CACHE_NAME, setName));
+ ignite.compute().broadcast(new SetClosure(CACHE_NAME, setName));
- System.out.println("Set size after writing [expected=" + (10 + g.cluster().nodes().size() * 5) +
+ System.out.println("Set size after writing [expected=" + (10 + ignite.cluster().nodes().size() * 5) +
", actual=" + set.size() + ']');
System.out.println("Iterate over set.");
@@ -126,10 +126,10 @@ public class CacheSetExample {
/**
* Clear and remove set.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If execution failed.
*/
- private static void clearAndRemoveSet(Ignite g) throws IgniteCheckedException {
+ private static void clearAndRemoveSet(Ignite ignite) throws IgniteCheckedException {
System.out.println("Set size before clearing: " + set.size());
// Clear set.
@@ -138,7 +138,7 @@ public class CacheSetExample {
System.out.println("Set size after clearing: " + set.size());
// Remove set from cache.
- g.cache(CACHE_NAME).dataStructures().removeSet(set.name());
+ ignite.cache(CACHE_NAME).dataStructures().removeSet(set.name());
System.out.println("Set was removed: " + set.removed());
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
index 20c377c..e674502 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/hibernate/HibernateL2CacheExample.java
@@ -29,7 +29,7 @@ import java.net.*;
import java.util.*;
/**
- * This example demonstrates the use of GridGain In-Memory Data Grid as a Hibernate
+ * This example demonstrates the use of Ignite In-Memory Data Grid as a Hibernate
* Second-Level cache provider.
* <p>
* The Hibernate Second-Level cache (or "L2 cache" shortly) lets you significantly
@@ -40,16 +40,16 @@ import java.util.*;
* This example defines 2 entity classes: {@link User} and {@link Post}, with
* 1 <-> N relation, and marks them with appropriate annotations for Hibernate
* object-relational mapping to SQL tables of an underlying H2 in-memory database.
- * The example launches GridGain node in the same JVM and registers it in
+ * The example launches node in the same JVM and registers it in
* Hibernate configuration as an L2 cache implementation. It then stores and
* queries instances of the entity classes to and from the database, having
- * Hibernate SQL output, L2 cache statistics output, and GridGain cache metrics
+ * Hibernate SQL output, L2 cache statistics output, and Ignite cache metrics
* output enabled.
* <p>
* When running example, it's easy to notice that when an object is first
* put into a database, the L2 cache is not used and it's contents is empty.
* However, when an object is first read from the database, it is immediately
- * stored in L2 cache (which is GridGain In-Memory Data Grid in fact), which can
+ * stored in L2 cache (which is Ignite In-Memory Data Grid in fact), which can
* be seen in stats output. Further requests of the same object only read the data
* from L2 cache and do not hit the database.
* <p>
@@ -83,8 +83,8 @@ public class HibernateL2CacheExample {
* @throws IgniteCheckedException If example execution failed.
*/
public static void main(String[] args) throws IgniteCheckedException {
- // Start the GridGain node, run the example, and stop the node when finished.
- try (Ignite g = Ignition.start(HibernateL2CacheExampleNodeStartup.configuration())) {
+ // Start the node, run the example, and stop the node when finished.
+ try (Ignite ignite = Ignition.start(HibernateL2CacheExampleNodeStartup.configuration())) {
// We use a single session factory, but create a dedicated session
// for each transaction or query. This way we ensure that L1 cache
// is not used (L1 cache has per-session scope only).
@@ -121,7 +121,7 @@ public class HibernateL2CacheExample {
ses.close();
}
- // Output L2 cache and GridGain cache stats. You may notice that
+ // Output L2 cache and Ignite cache stats. You may notice that
// at this point the object is not yet stored in L2 cache, because
// the read was not yet performed.
printStats(sesFactory);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
index 2283b3c..6a0688a 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/starschema/CacheStarSchemaExample.java
@@ -31,7 +31,7 @@ import java.util.concurrent.*;
* <i>Dimensions</i> can be referenced or joined by other <i>dimensions</i> or <i>facts</i>,
* however, <i>facts</i> are generally not referenced by other facts. You can view <i>dimensions</i>
* as your master or reference data, while <i>facts</i> are usually large data sets of events or
- * other objects that continuously come into the system and may change frequently. In GridGain
+ * other objects that continuously come into the system and may change frequently. In Ignite
* such architecture is supported via cross-cache queries. By storing <i>dimensions</i> in
* {@link org.apache.ignite.cache.CacheMode#REPLICATED REPLICATED} caches and <i>facts</i> in much larger
* {@link org.apache.ignite.cache.CacheMode#PARTITIONED PARTITIONED} caches you can freely execute distributed joins across
@@ -45,7 +45,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 CacheStarSchemaExample {
/** Partitioned cache name. */
@@ -64,14 +64,14 @@ public class CacheStarSchemaExample {
* @throws IgniteCheckedException If example execution failed.
*/
public static void main(String[] args) throws Exception {
- Ignite g = Ignition.start("examples/config/example-cache.xml");
+ Ignite ignite = Ignition.start("examples/config/example-cache.xml");
System.out.println();
System.out.println(">>> Cache star schema example started.");
// Clean up caches on all nodes before run.
- g.jcache(PARTITIONED_CACHE_NAME).clear();
- g.jcache(REPLICATED_CACHE_NAME).clear();
+ ignite.jcache(PARTITIONED_CACHE_NAME).clear();
+ ignite.jcache(REPLICATED_CACHE_NAME).clear();
try {
populateDimensions();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreExample.java
index 06b2ab8..32bb0e1 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreExample.java
@@ -45,16 +45,16 @@ public class CacheStoreExample {
IgniteConfiguration cfg = CacheNodeWithStoreStartup.configure();
// To start grid with desired configuration uncomment the appropriate line.
- try (Ignite g = Ignition.start(cfg)) {
+ try (Ignite ignite = Ignition.start(cfg)) {
System.out.println();
System.out.println(">>> Cache store example started.");
- IgniteCache<Long, Person> cache = g.jcache(null);
+ IgniteCache<Long, Person> cache = ignite.jcache(null);
// Clean up caches on all nodes before run.
cache.clear();
- try (IgniteTx tx = g.transactions().txStart()) {
+ try (IgniteTx tx = ignite.transactions().txStart()) {
Person val = cache.get(id);
System.out.println("Read value: " + val);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreLoadDataExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreLoadDataExample.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreLoadDataExample.java
index 907d789..0c9b1ef 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreLoadDataExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/CacheStoreLoadDataExample.java
@@ -47,11 +47,11 @@ public class CacheStoreLoadDataExample {
public static void main(String[] args) throws Exception {
ExamplesUtils.checkMinMemory(MIN_MEMORY);
- try (Ignite g = Ignition.start(CacheNodeWithStoreStartup.configure())) {
+ try (Ignite ignite = Ignition.start(CacheNodeWithStoreStartup.configure())) {
System.out.println();
System.out.println(">>> Cache store load data example started.");
- final IgniteCache<String, Integer> cache = g.jcache(null);
+ final IgniteCache<String, Integer> cache = ignite.jcache(null);
// Clean up caches on all nodes before run.
cache.clear();
@@ -59,8 +59,9 @@ public class CacheStoreLoadDataExample {
long start = System.currentTimeMillis();
// Start loading cache on all caching nodes.
- g.compute(g.cluster().forCache(null)).broadcast(new IgniteCallable<Object>() {
- @Override public Object call() throws Exception {
+ ignite.compute(ignite.cluster().forCache(null)).broadcast(new IgniteCallable<Object>() {
+ @Override
+ public Object call() throws Exception {
// Load cache from persistent store.
cache.loadCache(null, 0, ENTRY_COUNT);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
index f5c54f5..fc91b80 100644
--- a/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
+++ b/examples/src/main/java/org/apache/ignite/examples/datagrid/store/dummy/CacheDummyPersonStore.java
@@ -83,7 +83,7 @@ public class CacheDummyPersonStore extends CacheStoreAdapter<Long, Person> {
// Generate dummy person on the fly.
Person p = new Person(i, "first-" + i, "last-" + 1);
- // GridGain will automatically discard entries that don't belong on this node,
+ // Ignite will automatically discard entries that don't belong on this node,
// but we check if local node is primary or backup anyway just to demonstrate that we can.
// Ideally, partition ID of a key would be stored in the database and only keys
// for partitions that belong on this node would be loaded from database.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/events/EventsExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/events/EventsExample.java b/examples/src/main/java/org/apache/ignite/examples/events/EventsExample.java
index fb30474..80288cc 100644
--- a/examples/src/main/java/org/apache/ignite/examples/events/EventsExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/events/EventsExample.java
@@ -36,7 +36,7 @@ import static org.apache.ignite.events.IgniteEventType.*;
* Remote nodes should always be started with configuration: {@code 'ignite.sh examples/config/example-compute.xml'}.
* <p>
* Alternatively you can run {@link ComputeNodeStartup} in another JVM which will start
- * GridGain node with {@code examples/config/example-compute.xml} configuration.
+ * node with {@code examples/config/example-compute.xml} configuration.
*/
public class EventsExample {
/**
@@ -70,7 +70,7 @@ public class EventsExample {
System.out.println();
System.out.println(">>> Local event listener example.");
- Ignite g = Ignition.ignite();
+ Ignite ignite = Ignition.ignite();
IgnitePredicate<IgniteTaskEvent> lsnr = new IgnitePredicate<IgniteTaskEvent>() {
@Override public boolean apply(IgniteTaskEvent evt) {
@@ -81,17 +81,17 @@ public class EventsExample {
};
// Register event listener for all local task execution events.
- g.events().localListen(lsnr, EVTS_TASK_EXECUTION);
+ ignite.events().localListen(lsnr, EVTS_TASK_EXECUTION);
// Generate task events.
- g.compute().withName("example-event-task").run(new IgniteRunnable() {
+ ignite.compute().withName("example-event-task").run(new IgniteRunnable() {
@Override public void run() {
System.out.println("Executing sample job.");
}
});
// Unsubscribe local task event listener.
- g.events().stopLocalListen(lsnr);
+ ignite.events().stopLocalListen(lsnr);
}
/**
@@ -123,14 +123,14 @@ public class EventsExample {
}
};
- Ignite g = Ignition.ignite();
+ Ignite ignite = Ignition.ignite();
// Register event listeners on all nodes to listen for task events.
- g.events().remoteListen(locLsnr, rmtLsnr, EVTS_TASK_EXECUTION);
+ ignite.events().remoteListen(locLsnr, rmtLsnr, EVTS_TASK_EXECUTION);
// Generate task events.
for (int i = 0; i < 10; i++) {
- g.compute().withName(i < 5 ? "good-task-" + i : "bad-task-" + i).run(new IgniteRunnable() {
+ ignite.compute().withName(i < 5 ? "good-task-" + i : "bad-task-" + i).run(new IgniteRunnable() {
// Auto-inject task session.
@IgniteTaskSessionResource
private ComputeTaskSession ses;
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsExample.java b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsExample.java
index b8fa35e..23c2507 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsExample.java
@@ -25,7 +25,7 @@ import java.io.*;
import java.util.*;
/**
- * Example that shows usage of {@link org.apache.ignite.IgniteFs} API. It starts a GridGain node with {@code GGFS}
+ * Example that shows usage of {@link org.apache.ignite.IgniteFs} API. It starts a node with {@code GGFS}
* configured and performs several file system operations (create, write, append, read and delete
* files, create, list and delete directories).
* <p>
@@ -33,7 +33,7 @@ import java.util.*;
* GGFS: {@code 'ignite.sh examples/config/filesystem/example-ggfs.xml'}.
* <p>
* Alternatively you can run {@link GgfsNodeStartup} in another JVM which will start
- * GridGain node with {@code examples/config/filesystem/example-ggfs.xml} configuration.
+ * node with {@code examples/config/filesystem/example-ggfs.xml} configuration.
*/
public final class GgfsExample {
/**
@@ -43,14 +43,14 @@ public final class GgfsExample {
* @throws IgniteCheckedException If example execution failed.
*/
public static void main(String[] args) throws Exception {
- Ignite g = Ignition.start("examples/config/filesystem/example-ggfs.xml");
+ Ignite ignite = Ignition.start("examples/config/filesystem/example-ggfs.xml");
System.out.println();
System.out.println(">>> GGFS example started.");
try {
- // Get an instance of GridGain File System.
- IgniteFs fs = g.fileSystem("ggfs");
+ // Get an instance of Ignite File System.
+ IgniteFs fs = ignite.fileSystem("ggfs");
// Working directory path.
IgniteFsPath workDir = new IgniteFsPath("/examples/ggfs");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java
index 3813e2d..1c2106b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsMapReduceExample.java
@@ -34,7 +34,7 @@ import java.util.*;
* GGFS: {@code 'ignite.sh examples/config/filesystem/example-ggfs.xml'}.
* <p>
* Alternatively you can run {@link GgfsNodeStartup} in another JVM which will start
- * GridGain node with {@code examples/config/filesystem/example-ggfs.xml} configuration.
+ * node with {@code examples/config/filesystem/example-ggfs.xml} configuration.
*/
public class GgfsMapReduceExample {
/**
@@ -49,7 +49,7 @@ public class GgfsMapReduceExample {
else if (args.length == 1)
System.out.println("Please provide regular expression.");
else {
- try (Ignite g = Ignition.start("examples/config/filesystem/example-ggfs.xml")) {
+ try (Ignite ignite = Ignition.start("examples/config/filesystem/example-ggfs.xml")) {
System.out.println();
System.out.println(">>> GGFS map reduce example started.");
@@ -60,8 +60,8 @@ public class GgfsMapReduceExample {
String regexStr = args[1];
- // Get an instance of GridGain File System.
- IgniteFs fs = g.fileSystem("ggfs");
+ // Get an instance of Ignite File System.
+ IgniteFs fs = ignite.fileSystem("ggfs");
// Working directory path.
IgniteFsPath workDir = new IgniteFsPath("/examples/ggfs");
@@ -87,10 +87,10 @@ public class GgfsMapReduceExample {
}
/**
- * Write file to the GridGain file system.
+ * Write file to the Ignite file system.
*
- * @param fs GridGain file system.
- * @param fsPath GridGain file system path.
+ * @param fs Ignite file system.
+ * @param fsPath Ignite file system path.
* @param file File to write.
* @throws Exception In case of exception.
*/
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java
index e2cfea6..605eb81 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java
+++ b/examples/src/main/java/org/apache/ignite/examples/ggfs/GgfsNodeStartup.java
@@ -21,7 +21,7 @@ import org.apache.ignite.*;
/**
* Starts up an empty node with GGFS configuration.
- * You can also start a stand-alone GridGain instance by passing the path
+ * You can also start a stand-alone Ignite instance by passing the path
* to configuration file to {@code 'ignite.{sh|bat}'} script, like so:
* {@code 'ignite.sh examples/config/filesystem/example-ggfs.xml'}.
* <p>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html b/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html
index 47f55e5..80941e2 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html
+++ b/examples/src/main/java/org/apache/ignite/examples/ggfs/package.html
@@ -18,6 +18,6 @@
<html>
<body>
<!-- Package description. -->
- Demonstrates using of GridGain File System.
+ Demonstrates using of Ignite File System.
</body>
</html>
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java
index 2629a64..f09b10b 100644
--- a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingExample.java
@@ -36,7 +36,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 final class MessagingExample {
@@ -53,15 +53,15 @@ public final class MessagingExample {
* @throws IgniteCheckedException If example execution failed.
*/
public static void main(String[] args) throws Exception {
- try (Ignite g = Ignition.start("examples/config/example-compute.xml")) {
- if (!ExamplesUtils.checkMinTopologySize(g.cluster(), 2))
+ try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {
+ if (!ExamplesUtils.checkMinTopologySize(ignite.cluster(), 2))
return;
System.out.println();
System.out.println(">>> Messaging example started.");
// Projection for remote nodes.
- ClusterGroup rmtPrj = g.cluster().forRemotes();
+ ClusterGroup rmtPrj = ignite.cluster().forRemotes();
// Listen for messages from remote nodes to make sure that they received all the messages.
int msgCnt = rmtPrj.nodes().size() * MESSAGES_NUM;
@@ -69,20 +69,20 @@ public final class MessagingExample {
CountDownLatch orderedLatch = new CountDownLatch(msgCnt);
CountDownLatch unorderedLatch = new CountDownLatch(msgCnt);
- localListen(g.message(g.cluster().forLocal()), orderedLatch, unorderedLatch);
+ localListen(ignite.message(ignite.cluster().forLocal()), orderedLatch, unorderedLatch);
// Register listeners on all grid nodes.
- startListening(g.message(rmtPrj));
+ startListening(ignite.message(rmtPrj));
// Send unordered messages to all remote nodes.
for (int i = 0; i < MESSAGES_NUM; i++)
- g.message(rmtPrj).send(TOPIC.UNORDERED, Integer.toString(i));
+ ignite.message(rmtPrj).send(TOPIC.UNORDERED, Integer.toString(i));
System.out.println(">>> Finished sending unordered messages.");
// Send ordered messages to all remote nodes.
for (int i = 0; i < MESSAGES_NUM; i++)
- g.message(rmtPrj).sendOrdered(TOPIC.ORDERED, Integer.toString(i), 0);
+ ignite.message(rmtPrj).sendOrdered(TOPIC.ORDERED, Integer.toString(i), 0);
System.out.println(">>> Finished sending ordered messages.");
System.out.println(">>> Check output on all nodes for message printouts.");
@@ -105,13 +105,13 @@ public final class MessagingExample {
// Add ordered message listener.
msg.remoteListen(TOPIC.ORDERED, new IgniteBiPredicate<UUID, String>() {
@IgniteInstanceResource
- private Ignite g;
+ private Ignite ignite;
@Override public boolean apply(UUID nodeId, String msg) {
System.out.println("Received ordered message [msg=" + msg + ", fromNodeId=" + nodeId + ']');
try {
- g.message(g.cluster().forNodeId(nodeId)).send(TOPIC.ORDERED, msg);
+ ignite.message(ignite.cluster().forNodeId(nodeId)).send(TOPIC.ORDERED, msg);
}
catch (IgniteCheckedException e) {
e.printStackTrace();
@@ -124,13 +124,13 @@ public final class MessagingExample {
// Add unordered message listener.
msg.remoteListen(TOPIC.UNORDERED, new IgniteBiPredicate<UUID, String>() {
@IgniteInstanceResource
- private Ignite g;
+ private Ignite ignite;
@Override public boolean apply(UUID nodeId, String msg) {
System.out.println("Received unordered message [msg=" + msg + ", fromNodeId=" + nodeId + ']');
try {
- g.message(g.cluster().forNodeId(nodeId)).send(TOPIC.UNORDERED, msg);
+ ignite.message(ignite.cluster().forNodeId(nodeId)).send(TOPIC.UNORDERED, msg);
}
catch (IgniteCheckedException e) {
e.printStackTrace();
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
index a22b2aa..67f20ae 100644
--- a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongExample.java
@@ -35,7 +35,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 MessagingPingPongExample {
@@ -47,15 +47,15 @@ public class MessagingPingPongExample {
*/
public static void main(String[] args) throws IgniteCheckedException {
// Game is played over the default grid.
- try (Ignite g = Ignition.start("examples/config/example-compute.xml")) {
- if (!ExamplesUtils.checkMinTopologySize(g.cluster(), 2))
+ try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {
+ if (!ExamplesUtils.checkMinTopologySize(ignite.cluster(), 2))
return;
System.out.println();
System.out.println(">>> Messaging ping-pong example started.");
// Pick random remote node as a partner.
- ClusterGroup nodeB = g.cluster().forRemotes().forRandom();
+ ClusterGroup nodeB = ignite.cluster().forRemotes().forRandom();
// Note that both nodeA and nodeB will always point to
// same nodes regardless of whether they were implicitly
@@ -63,7 +63,7 @@ public class MessagingPingPongExample {
// anonymous closure's state during its remote execution.
// Set up remote player.
- g.message(nodeB).remoteListen(null, new IgniteBiPredicate<UUID, String>() {
+ ignite.message(nodeB).remoteListen(null, new IgniteBiPredicate<UUID, String>() {
/** This will be injected on node listener comes to. */
@IgniteInstanceResource
private Ignite ignite;
@@ -91,20 +91,20 @@ public class MessagingPingPongExample {
final CountDownLatch cnt = new CountDownLatch(MAX_PLAYS);
// Set up local player.
- g.message().localListen(null, new IgniteBiPredicate<UUID, String>() {
+ ignite.message().localListen(null, new IgniteBiPredicate<UUID, String>() {
@Override public boolean apply(UUID nodeId, String rcvMsg) {
System.out.println("Received message [msg=" + rcvMsg + ", sender=" + nodeId + ']');
try {
if (cnt.getCount() == 1) {
- g.message(g.cluster().forNodeId(nodeId)).send(null, "STOP");
+ ignite.message(ignite.cluster().forNodeId(nodeId)).send(null, "STOP");
cnt.countDown();
return false; // Stop listening.
}
else if ("PONG".equals(rcvMsg))
- g.message(g.cluster().forNodeId(nodeId)).send(null, "PING");
+ ignite.message(ignite.cluster().forNodeId(nodeId)).send(null, "PING");
else
throw new RuntimeException("Received unexpected message: " + rcvMsg);
@@ -119,7 +119,7 @@ public class MessagingPingPongExample {
});
// Serve!
- g.message(nodeB).send(null, "PING");
+ ignite.message(nodeB).send(null, "PING");
// Wait til the game is over.
try {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongListenActorExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongListenActorExample.java b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongListenActorExample.java
index eec94a7..5c9416e 100644
--- a/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongListenActorExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/messaging/MessagingPingPongListenActorExample.java
@@ -33,7 +33,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 MessagingPingPongListenActorExample {
@@ -45,17 +45,17 @@ public class MessagingPingPongListenActorExample {
*/
public static void main(String[] args) throws IgniteCheckedException {
// Game is played over the default grid.
- try (Ignite g = Ignition.start("examples/config/example-compute.xml")) {
- if (!ExamplesUtils.checkMinTopologySize(g.cluster(), 2))
+ try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {
+ if (!ExamplesUtils.checkMinTopologySize(ignite.cluster(), 2))
return;
System.out.println();
System.out.println(">>> Messaging ping-pong listen actor example started.");
// Pick first remote node as a partner.
- Collection<ClusterNode> rmtNodes = g.cluster().forRemotes().nodes();
+ Collection<ClusterNode> rmtNodes = ignite.cluster().forRemotes().nodes();
- ClusterGroup nodeB = g.cluster().forNode(rmtNodes.iterator().next());
+ ClusterGroup nodeB = ignite.cluster().forNode(rmtNodes.iterator().next());
// Note that both nodeA and nodeB will always point to
// same nodes regardless of whether they were implicitly
@@ -63,7 +63,7 @@ public class MessagingPingPongListenActorExample {
// anonymous closure's state during its remote execution.
// Set up remote player.
- g.message(nodeB).remoteListen(null, new MessagingListenActor<String>() {
+ ignite.message(nodeB).remoteListen(null, new MessagingListenActor<String>() {
@Override public void receive(UUID nodeId, String rcvMsg) throws IgniteCheckedException {
System.out.println(rcvMsg);
@@ -79,7 +79,7 @@ public class MessagingPingPongListenActorExample {
final CountDownLatch cnt = new CountDownLatch(MAX_PLAYS);
// Set up local player.
- g.message().localListen(null, new MessagingListenActor<String>() {
+ ignite.message().localListen(null, new MessagingListenActor<String>() {
@Override protected void receive(UUID nodeId, String rcvMsg) throws IgniteCheckedException {
System.out.println(rcvMsg);
@@ -93,7 +93,7 @@ public class MessagingPingPongListenActorExample {
});
// Serve!
- g.message(nodeB).send(null, "PING");
+ ignite.message(nodeB).send(null, "PING");
// Wait til the game is over.
try {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
index 04597b2..d5d2574 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/client/memcache/MemcacheRestExample.java
@@ -27,9 +27,9 @@ import java.net.*;
import java.util.*;
/**
- * This example shows how to use Memcache client for manipulating GridGain cache.
+ * This example shows how to use Memcache client for manipulating Ignite cache.
* <p>
- * GridGain implements Memcache binary protocol and it is available if
+ * Ignite implements Memcache binary protocol and it is available if
* REST is enabled on the node.
* Remote nodes should always be started using {@link MemcacheRestExampleNodeStartup}.
*/
@@ -47,11 +47,11 @@ public class MemcacheRestExample {
public static void main(String[] args) throws Exception {
MemcachedClient client = null;
- try (Ignite g = Ignition.start(MemcacheRestExampleNodeStartup.configuration())) {
+ try (Ignite ignite = Ignition.start(MemcacheRestExampleNodeStartup.configuration())) {
System.out.println();
System.out.println(">>> Memcache REST example started.");
- GridCache<String, Object> cache = g.cache(null);
+ GridCache<String, Object> cache = ignite.cache(null);
client = startMemcachedClient(host, port);
@@ -60,8 +60,8 @@ public class MemcacheRestExample {
System.out.println(">>> Successfully put string value using Memcache client.");
// Check that string value is actually in cache using traditional
- // GridGain API and Memcache binary protocol.
- System.out.println(">>> Getting value for 'strKey' using GridGain cache API: " + cache.get("strKey"));
+ // Ignite API and Memcache binary protocol.
+ System.out.println(">>> Getting value for 'strKey' using Ignite cache API: " + cache.get("strKey"));
System.out.println(">>> Getting value for 'strKey' using Memcache client: " + client.get("strKey"));
// Remove string value from cache using Memcache binary protocol.
@@ -76,8 +76,8 @@ public class MemcacheRestExample {
System.out.println(">>> Successfully put integer value using Memcache client.");
// Check that integer value is actually in cache using traditional
- // GridGain API and Memcache binary protocol.
- System.out.println(">>> Getting value for 'intKey' using GridGain cache API: " + cache.get("intKey"));
+ // Ignite API and Memcache binary protocol.
+ System.out.println(">>> Getting value for 'intKey' using Ignite cache API: " + cache.get("intKey"));
System.out.println(">>> Getting value for 'intKey' using Memcache client: " + client.get("intKey"));
// Remove string value from cache using Memcache binary protocol.
@@ -94,14 +94,14 @@ public class MemcacheRestExample {
if (client.incr("atomicLong", 5, 0) == 15)
System.out.println(">>> Successfully incremented atomic long by 5.");
- // Increment atomic long using GridGain API and check that value is correct.
+ // Increment atomic long using Ignite API and check that value is correct.
System.out.println(">>> New atomic long value: " + l.incrementAndGet() + " (expected: 16).");
// Decrement atomic long by 3 using Memcache client.
if (client.decr("atomicLong", 3, 0) == 13)
System.out.println(">>> Successfully decremented atomic long by 3.");
- // Decrement atomic long using GridGain API and check that value is correct.
+ // Decrement atomic long using Ignite API and check that value is correct.
System.out.println(">>> New atomic long value: " + l.decrementAndGet() + " (expected: 12).");
}
finally {
@@ -111,7 +111,7 @@ public class MemcacheRestExample {
}
/**
- * Creates Memcache client that uses binary protocol and connects to GridGain.
+ * Creates Memcache client that uses binary protocol and connects to Ignite.
*
* @param host Hostname.
* @param port Port number.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/misc/deployment/DeploymentExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/deployment/DeploymentExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/deployment/DeploymentExample.java
index 64151f6..a234ac5 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/deployment/DeploymentExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/deployment/DeploymentExample.java
@@ -43,7 +43,7 @@ import java.util.*;
* enables P2P class loading: {@code 'ignite.{sh|bat} examples/config/example-cache.xml'}.
* <p>
* Alternatively you can run {@link ComputeNodeStartup} in another JVM which will
- * start GridGain node with {@code examples/config/example-compute.xml} configuration.
+ * start node with {@code examples/config/example-compute.xml} configuration.
*/
public final class DeploymentExample {
/** Name of the deployed task. */
@@ -56,7 +56,7 @@ public final class DeploymentExample {
* @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(">>> Deployment example started.");
@@ -67,21 +67,21 @@ public final class DeploymentExample {
// 'GridCompute.localDeployTask(Class, ClassLoader) apply and
// then use 'GridCompute.execute(String, Object)' method
// passing your task name as first parameter.
- g.compute().localDeployTask(ExampleTask.class, ExampleTask.class.getClassLoader());
+ ignite.compute().localDeployTask(ExampleTask.class, ExampleTask.class.getClassLoader());
- for (Map.Entry<String, Class<? extends ComputeTask<?, ?>>> e : g.compute().localTasks().entrySet())
+ for (Map.Entry<String, Class<? extends ComputeTask<?, ?>>> e : ignite.compute().localTasks().entrySet())
System.out.println(">>> Found locally deployed task [alias=" + e.getKey() + ", taskCls=" + e.getValue());
// Execute the task passing its name as a parameter. The system will find
// the deployed task by its name and execute it.
- g.compute().execute(TASK_NAME, null);
+ ignite.compute().execute(TASK_NAME, null);
// Execute the task passing class name as a parameter. The system will find
// the deployed task by its class name and execute it.
// g.compute().execute(ExampleTask.class.getName(), null).get();
// Undeploy task
- g.compute().undeployTask(TASK_NAME);
+ ignite.compute().undeployTask(TASK_NAME);
System.out.println();
System.out.println(">>> Finished executing Grid Direct Deployment Example.");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
index f4fe684..6462a14 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/lifecycle/LifecycleExample.java
@@ -26,7 +26,7 @@ import static org.apache.ignite.lifecycle.LifecycleEventType.*;
/**
* This example shows how to provide your own {@link org.apache.ignite.lifecycle.LifecycleBean} implementation
- * to be able to hook into GridGain lifecycle. The {@link LifecycleExampleBean} bean
+ * to be able to hook into Ignite lifecycle. The {@link LifecycleExampleBean} bean
* will output occurred lifecycle events to the console.
* <p>
* This example does not require remote nodes to be started.
@@ -50,7 +50,7 @@ public final class LifecycleExample {
// Provide lifecycle bean to configuration.
cfg.setLifecycleBeans(bean);
- try (Ignite g = Ignition.start(cfg)) {
+ try (Ignite ignite = Ignition.start(cfg)) {
// Make sure that lifecycle bean was notified about grid startup.
assert bean.isStarted();
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java b/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java
index 709fb2b..96953d6 100644
--- a/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/misc/springbean/SpringBeanExample.java
@@ -24,7 +24,7 @@ import org.springframework.context.support.*;
import java.util.concurrent.*;
/**
- * Demonstrates a simple use of GridGain grid configured with Spring.
+ * Demonstrates a simple use of Ignite grid configured with Spring.
* <p>
* String "Hello World." is printed out by Callable passed into
* the executor service provided by Grid. This statement could be printed
@@ -38,7 +38,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 final class SpringBeanExample {
@@ -58,10 +58,10 @@ public final class SpringBeanExample {
try {
// Get grid from Spring (note that local grid node is already started).
- Ignite g = (Ignite)ctx.getBean("mySpringBean");
+ Ignite ignite = (Ignite)ctx.getBean("mySpringBean");
// Execute any method on the retrieved grid instance.
- ExecutorService exec = g.executorService();
+ ExecutorService exec = ignite.executorService();
Future<String> res = exec.submit(new Callable<String>() {
@Override public String call() throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/services/ServicesExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/services/ServicesExample.java b/examples/src/main/java/org/apache/ignite/examples/services/ServicesExample.java
index 7481137..4771f44 100644
--- a/examples/src/main/java/org/apache/ignite/examples/services/ServicesExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/services/ServicesExample.java
@@ -26,12 +26,12 @@ import org.apache.ignite.resources.*;
import java.util.*;
/**
- * Example that demonstrates how to deploy distributed services in GridGain.
+ * Example that demonstrates how to deploy distributed services in Ignite.
* Distributed services are especially useful when deploying singletons on the grid,
* be that cluster-singleton, or per-node-singleton, etc...
* <p>
* To start remote nodes, you must run {@link ComputeNodeStartup} in another JVM
- * which will start GridGain node with {@code examples/config/example-compute.xml} configuration.
+ * which will start node with {@code examples/config/example-compute.xml} configuration.
* <p>
* NOTE:<br/>
* Starting {@code ignite.sh} directly will not work, as distributed services
@@ -81,7 +81,7 @@ public class ServicesExample {
/**
* Simple example to demonstrate service proxy invocation of a remotely deployed service.
*
- * @param ignite Grid instance.
+ * @param ignite Ignite instance.
* @throws Exception If failed.
*/
private static void serviceProxyExample(Ignite ignite) throws Exception {
@@ -111,7 +111,7 @@ public class ServicesExample {
/**
* Simple example to demonstrate how to inject service proxy into distributed closures.
*
- * @param ignite Grid instance.
+ * @param ignite Ignite instance.
* @throws Exception If failed.
*/
private static void serviceInjectionExample(Ignite ignite) throws Exception {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java
index 6423d1e..a126074 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingCheckInExample.java
@@ -59,7 +59,7 @@ import java.util.concurrent.*;
* {@code IGNITE_HOME/examples} folder. After that {@code gridgain-examples.jar}
* will be generated by Maven in {@code IGNITE_HOME/examples/target} folder.
* <p>
- * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start GridGain node
+ * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start node
* with {@code examples/config/example-streamer.xml} configuration.
*/
public class StreamingCheckInExample {
@@ -107,14 +107,14 @@ public class StreamingCheckInExample {
Timer timer = new Timer("check-in-query-worker");
// Start grid.
- final Ignite g = Ignition.start("examples/config/example-streamer.xml");
+ final Ignite ignite = Ignition.start("examples/config/example-streamer.xml");
System.out.println();
System.out.println(">>> Streaming check-in example started.");
try {
// Get the streamer.
- IgniteStreamer streamer = g.streamer(STREAMER_NAME);
+ IgniteStreamer streamer = ignite.streamer(STREAMER_NAME);
assert streamer != null;
@@ -135,13 +135,13 @@ public class StreamingCheckInExample {
// Reset all streamers on all nodes to make sure that
// consecutive executions start from scratch.
- g.compute().broadcast(new Runnable() {
+ ignite.compute().broadcast(new Runnable() {
@Override public void run() {
- if (!ExamplesUtils.hasStreamer(g, STREAMER_NAME))
+ if (!ExamplesUtils.hasStreamer(ignite, STREAMER_NAME))
System.err.println("Default streamer not found (is example-streamer.xml " +
"configuration used on all nodes?)");
else {
- IgniteStreamer streamer = g.streamer(STREAMER_NAME);
+ IgniteStreamer streamer = ignite.streamer(STREAMER_NAME);
System.out.println("Clearing streamer data.");
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java
index 81e91f9..d7421ba 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPopularNumbersExample.java
@@ -42,7 +42,7 @@ import java.util.*;
* {@code IGNITE_HOME/examples} folder. After that {@code gridgain-examples.jar}
* will be generated by Maven in {@code IGNITE_HOME/examples/target} folder.
* <p>
- * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start GridGain node
+ * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start node
* with {@code examples/config/example-streamer.xml} configuration.
*/
public class StreamingPopularNumbersExample {
@@ -97,16 +97,16 @@ public class StreamingPopularNumbersExample {
Timer popularNumbersQryTimer = new Timer("numbers-query-worker");
// Start grid.
- final Ignite g = Ignition.start("examples/config/example-streamer.xml");
+ final Ignite ignite = Ignition.start("examples/config/example-streamer.xml");
System.out.println();
System.out.println(">>> Streaming popular numbers example started.");
try {
// Schedule query to find most popular words to run every 3 seconds.
- TimerTask task = scheduleQuery(g, popularNumbersQryTimer);
+ TimerTask task = scheduleQuery(ignite, popularNumbersQryTimer);
- streamData(g);
+ streamData(ignite);
// Force one more run to get final counts.
task.run();
@@ -115,13 +115,13 @@ public class StreamingPopularNumbersExample {
// Reset all streamers on all nodes to make sure that
// consecutive executions start from scratch.
- g.compute().broadcast(new Runnable() {
+ ignite.compute().broadcast(new Runnable() {
@Override public void run() {
- if (!ExamplesUtils.hasStreamer(g, "popular-numbers"))
+ if (!ExamplesUtils.hasStreamer(ignite, "popular-numbers"))
System.err.println("Default streamer not found (is example-streamer.xml " +
"configuration used on all nodes?)");
else {
- IgniteStreamer streamer = g.streamer("popular-numbers");
+ IgniteStreamer streamer = ignite.streamer("popular-numbers");
System.out.println("Clearing number counters from streamer.");
@@ -138,11 +138,11 @@ public class StreamingPopularNumbersExample {
/**
* Streams random numbers into the system.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If failed.
*/
- private static void streamData(final Ignite g) throws IgniteCheckedException {
- final IgniteStreamer streamer = g.streamer("popular-numbers");
+ private static void streamData(final Ignite ignite) throws IgniteCheckedException {
+ final IgniteStreamer streamer = ignite.streamer("popular-numbers");
// Use gaussian distribution to ensure that
// numbers closer to 0 have higher probability.
@@ -153,14 +153,14 @@ public class StreamingPopularNumbersExample {
/**
* Schedules our popular numbers query to run every 3 seconds.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @param timer Timer.
* @return Scheduled task.
*/
- private static TimerTask scheduleQuery(final Ignite g, Timer timer) {
+ private static TimerTask scheduleQuery(final Ignite ignite, Timer timer) {
TimerTask task = new TimerTask() {
@Override public void run() {
- final IgniteStreamer streamer = g.streamer("popular-numbers");
+ final IgniteStreamer streamer = ignite.streamer("popular-numbers");
try {
// Send reduce query to all 'popular-numbers' streamers
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java
index 584e55a..06a1d17 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingPriceBarsExample.java
@@ -49,11 +49,11 @@ import java.util.concurrent.*;
* {@code 'ignite.{sh|bat} examples/config/example-streamer.xml'}.
* When starting nodes this way JAR file containing the examples code
* should be placed to {@code IGNITE_HOME/libs} folder. You can build
- * {@code gridgain-examples.jar} by running {@code mvn package} in
- * {@code IGNITE_HOME/examples} folder. After that {@code gridgain-examples.jar}
+ * {@code ignite-examples.jar} by running {@code mvn package} in
+ * {@code IGNITE_HOME/examples} folder. After that {@code ignite-examples.jar}
* will be generated by Maven in {@code IGNITE_HOME/examples/target} folder.
* <p>
- * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start GridGain node
+ * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start node
* with {@code examples/config/example-streamer.xml} configuration.
*/
public class StreamingPriceBarsExample {
@@ -79,15 +79,15 @@ public class StreamingPriceBarsExample {
Timer timer = new Timer("priceBars");
// Start grid.
- final Ignite g = Ignition.start("examples/config/example-streamer.xml");
+ final Ignite ignite = Ignition.start("examples/config/example-streamer.xml");
System.out.println();
System.out.println(">>> Streaming price bars example started.");
try {
- TimerTask task = scheduleQuery(g, timer);
+ TimerTask task = scheduleQuery(ignite, timer);
- streamData(g);
+ streamData(ignite);
// Force one more run to get final results.
task.run();
@@ -96,13 +96,13 @@ public class StreamingPriceBarsExample {
// Reset all streamers on all nodes to make sure that
// consecutive executions start from scratch.
- g.compute().broadcast(new Runnable() {
+ ignite.compute().broadcast(new Runnable() {
@Override public void run() {
- if (!ExamplesUtils.hasStreamer(g, "priceBars"))
+ if (!ExamplesUtils.hasStreamer(ignite, "priceBars"))
System.err.println("Default streamer not found (is example-streamer.xml " +
"configuration used on all nodes?)");
else {
- IgniteStreamer streamer = g.streamer("priceBars");
+ IgniteStreamer streamer = ignite.streamer("priceBars");
System.out.println("Clearing bars from streamer.");
@@ -119,14 +119,14 @@ public class StreamingPriceBarsExample {
/**
* Schedules the query to periodically output built bars to the console.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @param timer Timer.
* @return Scheduled task.
*/
- private static TimerTask scheduleQuery(final Ignite g, Timer timer) {
+ private static TimerTask scheduleQuery(final Ignite ignite, Timer timer) {
TimerTask task = new TimerTask() {
@Override public void run() {
- final IgniteStreamer streamer = g.streamer("priceBars");
+ final IgniteStreamer streamer = ignite.streamer("priceBars");
try {
Collection<Bar> bars = streamer.context().reduce(
@@ -179,11 +179,11 @@ public class StreamingPriceBarsExample {
/**
* Streams random prices into the system.
*
- * @param g Grid.
+ * @param ignite Ignite.
* @throws IgniteCheckedException If failed.
*/
- private static void streamData(final Ignite g) throws IgniteCheckedException {
- IgniteStreamer streamer = g.streamer("priceBars");
+ private static void streamData(final Ignite ignite) throws IgniteCheckedException {
+ IgniteStreamer streamer = ignite.streamer("priceBars");
for (int i = 0; i < CNT; i++) {
for (int j = 0; j < INSTRUMENTS.length; j++) {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingRunningAverageExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingRunningAverageExample.java b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingRunningAverageExample.java
index 7ccbf42..b46c60d 100644
--- a/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingRunningAverageExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/streaming/StreamingRunningAverageExample.java
@@ -35,11 +35,11 @@ import java.util.concurrent.*;
* {@code 'ignite.{sh|bat} examples/config/example-streamer.xml'}.
* When starting nodes this way JAR file containing the examples code
* should be placed to {@code IGNITE_HOME/libs} folder. You can build
- * {@code gridgain-examples.jar} by running {@code mvn package} in
- * {@code IGNITE_HOME/examples} folder. After that {@code gridgain-examples.jar}
+ * {@code ignite-examples.jar} by running {@code mvn package} in
+ * {@code IGNITE_HOME/examples} folder. After that {@code ignite-examples.jar}
* will be generated by Maven in {@code IGNITE_HOME/examples/target} folder.
* <p>
- * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start GridGain node
+ * Alternatively you can run {@link StreamingNodeStartup} in another JVM which will start node
* with {@code examples/config/example-streamer.xml} configuration.
*/
public class StreamingRunningAverageExample {
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java b/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java
index c69c3ab..89fbdbe 100644
--- a/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java
+++ b/examples/src/main/java8/org/apache/ignite/examples/MessagingExample.java
@@ -33,7 +33,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 final class MessagingExample {
@@ -50,8 +50,8 @@ public final class MessagingExample {
* @throws IgniteCheckedException If example execution failed.
*/
public static void main(String[] args) throws Exception {
- try (Ignite g = Ignition.start("examples/config/example-compute.xml")) {
- if (g.nodes().size() < 2) {
+ try (Ignite ignite = Ignition.start("examples/config/example-compute.xml")) {
+ if (ignite.nodes().size() < 2) {
System.out.println();
System.out.println(">>> Please start at least 2 grid nodes to run example.");
System.out.println();
@@ -63,7 +63,7 @@ public final class MessagingExample {
System.out.println(">>> Messaging example started.");
// Projection for remote nodes.
- ClusterGroup rmtPrj = g.forRemotes();
+ ClusterGroup rmtPrj = ignite.forRemotes();
// Listen for messages from remote nodes to make sure that they received all the messages.
int msgCnt = rmtPrj.nodes().size() * MESSAGES_NUM;
@@ -71,7 +71,7 @@ public final class MessagingExample {
CountDownLatch orderedLatch = new CountDownLatch(msgCnt);
CountDownLatch unorderedLatch = new CountDownLatch(msgCnt);
- localListen(g.forLocal(), orderedLatch, unorderedLatch);
+ localListen(ignite.forLocal(), orderedLatch, unorderedLatch);
// Register listeners on all grid nodes.
startListening(rmtPrj);
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala
index b0ca960..c9b0539 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheAffinityExample1.scala
@@ -27,7 +27,7 @@ import org.jetbrains.annotations.Nullable
import java.util.concurrent.Callable
/**
- * Example of how to collocate computations and data in GridGain using
+ * Example of how to collocate computations and data in Ignite using
* `CacheAffinityKeyMapped` annotation as opposed to direct API calls. This
* example will first populate cache on some node where cache is available, and then
* will send jobs to the nodes where keys reside and print out values for those
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala
index e52f431..0605a8c 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCachePopularNumbersExample.scala
@@ -33,7 +33,7 @@ import scala.util.Random
* enables P2P class loading: `ignite.sh examples/config/example-cache.xml`
* <p>
* Alternatively you can run [[CacheNodeStartup]] in another JVM which will
- * start GridGain node with `examples/config/example-cache.xml` configuration.
+ * start node with `examples/config/example-cache.xml` configuration.
* <p>
* The counts are kept in cache on all remote nodes. Top `10` counts from each node are then grabbed to produce
* an overall top `10` list within the grid.
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
index d189e9f..61347c3 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarCacheQueryExample.scala
@@ -76,12 +76,12 @@ object ScalarCacheQueryExample {
// Example for SQL-based querying with custom remote transformer to make sure
// that only required data without any overhead is returned to caller.
- // Gets last names of all 'GridGain' employees.
- print("Last names of all 'GridGain' employees: ",
+ // Gets last names of all 'Ignite' employees.
+ print("Last names of all 'Ignite' employees: ",
cache.sqlTransform(
prj,
"from Person, Organization where Person.orgId = Organization.id " +
- "and Organization.name = 'GridGain'",
+ "and Organization.name = 'Ignite'",
(p: Person) => p.lastName
).map(_._2)
)
@@ -120,7 +120,7 @@ object ScalarCacheQueryExample {
val orgCache = mkCache[UUID, Organization]
// Organizations.
- val org1 = Organization("GridGain")
+ val org1 = Organization("Ignite")
val org2 = Organization("Other")
orgCache += (org1.id -> org1)
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala
index d1d4b12..e2ddd67 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarJvmCloudExample.scala
@@ -80,11 +80,11 @@ object ScalarJvmCloudExample {
JOptionPane.showMessageDialog(
null,
Array[JComponent](
- new JLabel("GridGain JVM cloud started."),
+ new JLabel("Ignite JVM cloud started."),
new JLabel("Number of nodes in the grid: " + scalar.grid$(NODES(1)).get.cluster().nodes().size()),
new JLabel("Click OK to stop.")
),
- "GridGain",
+ "Ignite",
JOptionPane.INFORMATION_MESSAGE)
}
http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/a234cdda/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
index ec42a40..87317d0 100644
--- a/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
+++ b/examples/src/main/scala/org/apache/ignite/scalar/examples/ScalarSnowflakeSchemaExample.scala
@@ -33,7 +33,7 @@ import scala.collection.JavaConversions._
* <i>Dimensions</i> can be referenced or joined by other <i>dimensions</i> or <i>facts</i>,
* however, <i>facts</i> are generally not referenced by other facts. You can view <i>dimensions</i>
* as your master or reference data, while <i>facts</i> are usually large data sets of events or
- * other objects that continuously come into the system and may change frequently. In GridGain
+ * other objects that continuously come into the system and may change frequently. In Ignite
* such architecture is supported via cross-cache queries. By storing <i>dimensions</i> in
* `CacheMode#REPLICATED REPLICATED` caches and <i>facts</i> in much larger
* `CacheMode#PARTITIONED PARTITIONED` caches you can freely execute distributed joins across
[3/3] incubator-ignite git commit: #IGNITE-106: Remove word GridGain
from examples.
Posted by sb...@apache.org.
#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-106
Commit: a234cdda168bdc9f8d4ededf360131da8ab6b3ec
Parents: b4a4f1b
Author: ivasilinets <iv...@gridgain.com>
Authored: Mon Feb 2 15:13:36 2015 +0300
Committer: ivasilinets <iv...@gridgain.com>
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();