Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sboikov committed Jan 26, 2015
1 parent 78775c4 commit 712ce14
Show file tree
Hide file tree
Showing 63 changed files with 304 additions and 304 deletions.
Expand Up @@ -55,7 +55,7 @@ public static void main(String[] args) throws IgniteCheckedException {
String atomicName = UUID.randomUUID().toString();

// Initialize atomic long in grid.
final CacheAtomicLong atomicLong = g.cache(CACHE_NAME).dataStructures().atomicLong(atomicName, 0, true);
final IgniteAtomicLong atomicLong = g.cache(CACHE_NAME).dataStructures().atomicLong(atomicName, 0, true);

System.out.println();
System.out.println("Atomic long initial value : " + atomicLong.get() + '.');
Expand Down
Expand Up @@ -55,7 +55,7 @@ public static void main(String[] args) throws IgniteCheckedException {
String val = UUID.randomUUID().toString();

// Initialize atomic reference in grid.
CacheAtomicReference<String> ref = g.cache(CACHE_NAME).dataStructures().
IgniteAtomicReference<String> ref = g.cache(CACHE_NAME).dataStructures().
atomicReference(refName, val, true);

System.out.println("Atomic reference initial value : " + ref.get() + '.');
Expand Down Expand Up @@ -113,7 +113,7 @@ private static class ReferenceClosure implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
CacheAtomicReference<String> ref = Ignition.ignite().cache(cacheName).dataStructures().
IgniteAtomicReference<String> ref = Ignition.ignite().cache(cacheName).dataStructures().
atomicReference(refName, null, true);

System.out.println("Atomic reference value is " + ref.get() + '.');
Expand Down
Expand Up @@ -55,7 +55,7 @@ public static void main(String[] args) throws IgniteCheckedException {
final String seqName = UUID.randomUUID().toString();

// Initialize atomic sequence in grid.
CacheAtomicSequence seq = g.cache(CACHE_NAME).dataStructures().atomicSequence(seqName, 0, true);
IgniteAtomicSequence seq = g.cache(CACHE_NAME).dataStructures().atomicSequence(seqName, 0, true);

// First value of atomic sequence on this node.
long firstVal = seq.get();
Expand Down Expand Up @@ -96,7 +96,7 @@ private static class SequenceClosure implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
CacheAtomicSequence seq = Ignition.ignite().cache(cacheName).dataStructures().
IgniteAtomicSequence seq = Ignition.ignite().cache(cacheName).dataStructures().
atomicSequence(seqName, 0, true);

for (int i = 0; i < RETRIES; i++)
Expand Down
Expand Up @@ -58,7 +58,7 @@ public static void main(String[] args) throws IgniteCheckedException {
String stamp = UUID.randomUUID().toString();

// Initialize atomic stamped in cache.
CacheAtomicStamped<String, String> stamped = g.cache(CACHE_NAME).dataStructures().
IgniteAtomicStamped<String, String> stamped = g.cache(CACHE_NAME).dataStructures().
atomicStamped(stampedName, val, stamp, true);

System.out.println("Atomic stamped initial [value=" + stamped.value() + ", stamp=" + stamped.stamp() + ']');
Expand Down Expand Up @@ -119,7 +119,7 @@ private static class StampedUpdateClosure implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
CacheAtomicStamped<String, String> stamped = Ignition.ignite().cache(cacheName).dataStructures().
IgniteAtomicStamped<String, String> stamped = Ignition.ignite().cache(cacheName).dataStructures().
atomicStamped(stampedName, null, null, true);

System.out.println("Atomic stamped [value=" + stamped.value() + ", stamp=" + stamped.stamp() + ']');
Expand Down
Expand Up @@ -55,7 +55,7 @@ public static void main(String[] args) throws Exception {
final String latchName = UUID.randomUUID().toString();

// Initialize count down latch in grid.
CacheCountDownLatch latch = g.cache(CACHE_NAME).dataStructures().
IgniteCountDownLatch latch = g.cache(CACHE_NAME).dataStructures().
countDownLatch(latchName, INITIAL_COUNT, false, true);

System.out.println("Latch initial value: " + latch.count());
Expand Down Expand Up @@ -97,7 +97,7 @@ private static class LatchClosure implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
CacheCountDownLatch latch = Ignition.ignite().cache(cacheName).dataStructures().
IgniteCountDownLatch latch = Ignition.ignite().cache(cacheName).dataStructures().
countDownLatch(latchName, 1, false, true);

int newCnt = latch.countDown();
Expand Down
Expand Up @@ -42,7 +42,7 @@ public class CacheQueueExample {
private static final int RETRIES = 20;

/** Queue instance. */
private static CacheQueue<String> queue;
private static IgniteQueue<String> queue;

/**
* Executes example.
Expand Down Expand Up @@ -78,9 +78,9 @@ public static void main(String[] args) throws IgniteCheckedException {
* @return Queue.
* @throws IgniteCheckedException If execution failed.
*/
private static CacheQueue<String> initializeQueue(Ignite g, String queueName) throws IgniteCheckedException {
private static IgniteQueue<String> initializeQueue(Ignite g, String queueName) throws IgniteCheckedException {
// Initialize new FIFO queue.
CacheQueue<String> queue = g.cache(CACHE_NAME).dataStructures().queue(queueName, 0, false, true);
IgniteQueue<String> queue = g.cache(CACHE_NAME).dataStructures().queue(queueName, 0, false, true);

// Initialize queue items.
// We will be use blocking operation and queue size must be appropriated.
Expand Down Expand Up @@ -182,7 +182,7 @@ private static class QueueClosure implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
CacheQueue<String> queue = Ignition.ignite().cache(cacheName).dataStructures().
IgniteQueue<String> queue = Ignition.ignite().cache(cacheName).dataStructures().
queue(queueName, 0, false, true);

if (put) {
Expand Down
Expand Up @@ -38,7 +38,7 @@ public class CacheSetExample {
private static final String CACHE_NAME = "partitioned_tx";

/** Set instance. */
private static CacheSet<String> set;
private static IgniteSet<String> set;

/**
* Executes example.
Expand Down Expand Up @@ -72,9 +72,9 @@ public static void main(String[] args) throws IgniteCheckedException {
* @return Set.
* @throws IgniteCheckedException If execution failed.
*/
private static CacheSet<String> initializeSet(Ignite g, String setName) throws IgniteCheckedException {
private static IgniteSet<String> initializeSet(Ignite g, String setName) throws IgniteCheckedException {
// Initialize new set.
CacheSet<String> set = g.cache(CACHE_NAME).dataStructures().set(setName, false, true);
IgniteSet<String> set = g.cache(CACHE_NAME).dataStructures().set(setName, false, true);

// Initialize set items.
for (int i = 0; i < 10; i++)
Expand Down Expand Up @@ -173,7 +173,7 @@ private static class SetClosure implements IgniteRunnable {
/** {@inheritDoc} */
@Override public void run() {
try {
CacheSet<String> set = Ignition.ignite().cache(cacheName).dataStructures().set(setName, false, true);
IgniteSet<String> set = Ignition.ignite().cache(cacheName).dataStructures().set(setName, false, true);

UUID locId = Ignition.ignite().cluster().localNode().id();

Expand Down
Expand Up @@ -88,7 +88,7 @@ public static void main(String[] args) throws Exception {
System.out.println(">>> Current cache size: " + cache.size() + " (expected: 0).");

// Create atomic long.
CacheAtomicLong l = cache.dataStructures().atomicLong("atomicLong", 10, true);
IgniteAtomicLong l = cache.dataStructures().atomicLong("atomicLong", 10, true);

// Increment atomic long by 5 using Memcache client.
if (client.incr("atomicLong", 5, 0) == 15)
Expand Down
Expand Up @@ -49,7 +49,7 @@
* <li>
* Method {@link #dataStructures()} provides {@link org.apache.ignite.cache.datastructures.CacheDataStructures} service for
* creating and working with distributed concurrent data structures, such as
* {@link IgniteAtomicLong}, {@link IgniteAtomicReference}, {@link org.apache.ignite.cache.datastructures.CacheQueue}, etc.
* {@link IgniteAtomicLong}, {@link IgniteAtomicReference}, {@link org.apache.ignite.cache.datastructures.IgniteQueue}, etc.
* </li>
* <li>
* Methods like {@code 'tx{Un}Synchronize(..)'} witch allow to get notifications for transaction state changes.
Expand Down
Expand Up @@ -1349,7 +1349,7 @@ public void setCloner(CacheCloner cloner) {
}

/**
* Gets default number of sequence values reserved for {@link org.apache.ignite.cache.datastructures.CacheAtomicSequence} instances. After
* Gets default number of sequence values reserved for {@link org.apache.ignite.cache.datastructures.IgniteAtomicSequence} instances. After
* a certain number has been reserved, consequent increments of sequence will happen locally,
* without communication with other nodes, until the next reservation has to be made.
* <p>
Expand All @@ -1362,7 +1362,7 @@ public int getAtomicSequenceReserveSize() {
}

/**
* Sets default number of sequence values reserved for {@link org.apache.ignite.cache.datastructures.CacheAtomicSequence} instances. After a certain
* Sets default number of sequence values reserved for {@link org.apache.ignite.cache.datastructures.IgniteAtomicSequence} instances. After a certain
* number has been reserved, consequent increments of sequence will happen locally, without communication with other
* nodes, until the next reservation has to be made.
*
Expand Down
Expand Up @@ -46,7 +46,7 @@
* <li>
* Method {@link #dataStructures()} provides {@link org.apache.ignite.cache.datastructures.CacheDataStructures} service for
* creating and working with distributed concurrent data structures, such as
* {@link org.apache.ignite.cache.datastructures.CacheAtomicLong}, {@link org.apache.ignite.cache.datastructures.CacheAtomicReference}, {@link org.apache.ignite.cache.datastructures.CacheQueue}, etc.
* {@link org.apache.ignite.cache.datastructures.IgniteAtomicLong}, {@link org.apache.ignite.cache.datastructures.IgniteAtomicReference}, {@link org.apache.ignite.cache.datastructures.IgniteQueue}, etc.
* </li>
* <li>
* Methods like {@code 'tx{Un}Synchronize(..)'} witch allow to get notifications for transaction state changes.
Expand Down
Expand Up @@ -23,8 +23,8 @@
/**
* Facade for working with distributed cache data structures. All cache data structures are similar
* in APIs to {@code 'java.util.concurrent'} package, but all operations on them are grid-aware.
* For example, if you increment {@link CacheAtomicLong} on one node, another node will
* know about the change. Or if you add an element to {@link CacheQueue} on one node,
* For example, if you increment {@link IgniteAtomicLong} on one node, another node will
* know about the change. Or if you add an element to {@link IgniteQueue} on one node,
* you can poll it on another node.
* <p>
* You can get data structures facade by calling {@link org.apache.ignite.cache.GridCache#dataStructures()} method.
Expand All @@ -40,7 +40,7 @@ public interface CacheDataStructures {
* @return Sequence for the given name.
* @throws IgniteCheckedException If sequence could not be fetched or created.
*/
@Nullable public CacheAtomicSequence atomicSequence(String name, long initVal, boolean create)
@Nullable public IgniteAtomicSequence atomicSequence(String name, long initVal, boolean create)
throws IgniteCheckedException;

/**
Expand All @@ -63,7 +63,7 @@ public interface CacheDataStructures {
* @return Atomic long.
* @throws IgniteCheckedException If atomic long could not be fetched or created.
*/
@Nullable public CacheAtomicLong atomicLong(String name, long initVal, boolean create) throws IgniteCheckedException;
@Nullable public IgniteAtomicLong atomicLong(String name, long initVal, boolean create) throws IgniteCheckedException;

/**
* Remove atomic long from cache.
Expand Down Expand Up @@ -94,7 +94,7 @@ public interface CacheDataStructures {
* @return Queue with given properties.
* @throws IgniteCheckedException If remove failed.
*/
@Nullable public <T> CacheQueue<T> queue(String name, int cap, boolean collocated,
@Nullable public <T> IgniteQueue<T> queue(String name, int cap, boolean collocated,
boolean create) throws IgniteCheckedException;

/**
Expand Down Expand Up @@ -135,7 +135,7 @@ public interface CacheDataStructures {
* @return Set with given properties.
* @throws IgniteCheckedException If failed.
*/
@Nullable public <T> CacheSet<T> set(String name, boolean collocated, boolean create) throws IgniteCheckedException;
@Nullable public <T> IgniteSet<T> set(String name, boolean collocated, boolean create) throws IgniteCheckedException;

/**
* Removes set from cache.
Expand All @@ -157,7 +157,7 @@ public interface CacheDataStructures {
* @return Atomic reference for the given name.
* @throws IgniteCheckedException If atomic reference could not be fetched or created.
*/
@Nullable public <T> CacheAtomicReference<T> atomicReference(String name, @Nullable T initVal, boolean create)
@Nullable public <T> IgniteAtomicReference<T> atomicReference(String name, @Nullable T initVal, boolean create)
throws IgniteCheckedException;

/**
Expand All @@ -182,7 +182,7 @@ public interface CacheDataStructures {
* @return Atomic stamped for the given name.
* @throws IgniteCheckedException If atomic stamped could not be fetched or created.
*/
@Nullable public <T, S> CacheAtomicStamped<T, S> atomicStamped(String name, @Nullable T initVal,
@Nullable public <T, S> IgniteAtomicStamped<T, S> atomicStamped(String name, @Nullable T initVal,
@Nullable S initStamp, boolean create) throws IgniteCheckedException;

/**
Expand All @@ -206,7 +206,7 @@ public interface CacheDataStructures {
* @return Count down latch for the given name.
* @throws IgniteCheckedException If operation failed.
*/
@Nullable public CacheCountDownLatch countDownLatch(String name, int cnt, boolean autoDel, boolean create)
@Nullable public IgniteCountDownLatch countDownLatch(String name, int cnt, boolean autoDel, boolean create)
throws IgniteCheckedException;

/**
Expand Down
Expand Up @@ -62,7 +62,7 @@
* @see CacheDataStructures#atomicLong(String, long, boolean)
* @see CacheDataStructures#removeAtomicLong(String)
*/
public interface CacheAtomicLong {
public interface IgniteAtomicLong {
/**
* Name of atomic long.
*
Expand Down
Expand Up @@ -49,7 +49,7 @@
* @see CacheDataStructures#atomicReference(String, Object, boolean)
* @see CacheDataStructures#removeAtomicReference(String)
*/
public interface CacheAtomicReference<T> {
public interface IgniteAtomicReference<T> {
/**
* Name of atomic reference.
*
Expand Down
Expand Up @@ -57,7 +57,7 @@
* @see CacheDataStructures#atomicSequence(String, long, boolean)
* @see CacheDataStructures#removeAtomicSequence(String)
*/
public interface CacheAtomicSequence {
public interface IgniteAtomicSequence {
/**
* Name of atomic sequence.
*
Expand Down
Expand Up @@ -58,7 +58,7 @@
* @see CacheDataStructures#atomicStamped(String, Object, Object, boolean)
* @see CacheDataStructures#removeAtomicStamped(String)
*/
public interface CacheAtomicStamped<T, S> {
public interface IgniteAtomicStamped<T, S> {
/**
* Name of atomic stamped.
*
Expand Down
Expand Up @@ -34,7 +34,7 @@
* @see CacheDataStructures#countDownLatch(String, int, boolean, boolean)
* @see CacheDataStructures#removeCountDownLatch(String)
*/
public interface CacheCountDownLatch {
public interface IgniteCountDownLatch {
/**
* Gets name of the latch.
*
Expand Down
Expand Up @@ -41,7 +41,7 @@
* changed later. Here is an example of how to create {@code bounded} {@code LIFO} queue with
* capacity of {@code 1000} items.
* <pre name="code" class="java">
* CacheQueue&lt;String&gt; queue = cache().queue("anyName", LIFO, 1000);
* IgniteQueue&lt;String&gt; queue = cache().queue("anyName", LIFO, 1000);
* ...
* queue.add("item");
* </pre>
Expand All @@ -58,7 +58,7 @@
* Here is an example of how create {@code unbounded} queue
* in non-collocated mode.
* <pre name="code" class="java">
* CacheQueue&lt;String&gt; queue = cache().queue("anyName", 0 &#047;*unbounded*&#047;, false &#047;*non-collocated*&#047;);
* IgniteQueue&lt;String&gt; queue = cache().queue("anyName", 0 &#047;*unbounded*&#047;, false &#047;*non-collocated*&#047;);
* ...
* queue.add("item");
* </pre>
Expand All @@ -72,7 +72,7 @@
* @see CacheDataStructures#removeQueue(String)
* @see CacheDataStructures#removeQueue(String, int)
*/
public interface CacheQueue<T> extends BlockingQueue<T> {
public interface IgniteQueue<T> extends BlockingQueue<T> {
/**
* Gets queue name.
*
Expand Down
Expand Up @@ -35,7 +35,7 @@
* @see CacheDataStructures#set(String, boolean, boolean)
* @see CacheDataStructures#removeSet(String)
*/
public interface CacheSet<T> extends Set<T> {
public interface IgniteSet<T> extends Set<T> {
/**
* Gets set name.
*
Expand Down
Expand Up @@ -27,7 +27,7 @@
import java.util.*;

/**
* {@link org.apache.ignite.cache.datastructures.CacheQueue} implementation using atomic cache.
* {@link org.apache.ignite.cache.datastructures.IgniteQueue} implementation using atomic cache.
*/
public class GridAtomicCacheQueueImpl<T> extends GridCacheQueueAdapter<T> {
/** */
Expand Down
Expand Up @@ -22,7 +22,7 @@
/**
* Atomic managed by cache ({@code 'Ex'} stands for external).
*/
public interface GridCacheAtomicLongEx extends GridCacheRemovable, CacheAtomicLong {
public interface GridCacheAtomicLongEx extends GridCacheRemovable, IgniteAtomicLong {
/**
* Get current atomic long key.
*
Expand Down
Expand Up @@ -22,7 +22,7 @@
/**
* Atomic reference managed by cache ({@code 'Ex'} stands for external).
*/
public interface GridCacheAtomicReferenceEx<T> extends GridCacheRemovable, CacheAtomicReference<T> {
public interface GridCacheAtomicReferenceEx<T> extends GridCacheRemovable, IgniteAtomicReference<T> {
/**
* Get current atomic reference key.
*
Expand Down
Expand Up @@ -22,7 +22,7 @@
/**
* Sequence managed by cache ({@code 'Ex'} stands for external.
*/
public interface GridCacheAtomicSequenceEx extends GridCacheRemovable, CacheAtomicSequence {
public interface GridCacheAtomicSequenceEx extends GridCacheRemovable, IgniteAtomicSequence {
/**
* Get current sequence key.
*
Expand Down
Expand Up @@ -22,7 +22,7 @@
/**
* Atomic stamped managed by cache ({@code 'Ex'} stands for external).
*/
public interface GridCacheAtomicStampedEx<T, S> extends GridCacheRemovable, CacheAtomicStamped<T, S> {
public interface GridCacheAtomicStampedEx<T, S> extends GridCacheRemovable, IgniteAtomicStamped<T, S> {
/**
* Get current atomic stamped key.
*
Expand Down
Expand Up @@ -22,7 +22,7 @@
/**
* Grid cache count down latch ({@code 'Ex'} stands for external).
*/
public interface GridCacheCountDownLatchEx extends CacheCountDownLatch, GridCacheRemovable {
public interface GridCacheCountDownLatchEx extends IgniteCountDownLatch, GridCacheRemovable {
/**
* Get current count down latch key.
*
Expand Down

0 comments on commit 712ce14

Please sign in to comment.