org.apache.ignite.internal.processors.datastructures

## Class DataStructuresProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.datastructures.DataStructuresProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public final class DataStructuresProcessor
    extends GridProcessorAdapter

Manager of data structures.

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.apache.ignite.internal.GridComponent

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

Fields
`static CacheDataStructuresConfigurationKey` `DATA_STRUCTURES_KEY`

### Fields inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`DataStructuresProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`IgniteAtomicLong` `atomicLong(String name, long initVal, boolean create)` Gets an atomic long from cache or creates one if it's not cached.
`<T> IgniteAtomicReference<T>` `atomicReference(String name, T initVal, boolean create)` Gets an atomic reference from cache or creates one if it's not cached.
`<T,S> IgniteAtomicStamped<T,S>` `atomicStamped(String name, T initVal, S initStamp, boolean create)` Gets an atomic stamped from cache or creates one if it's not cached.
`IgniteCountDownLatch` `countDownLatch(String name, int cnt, boolean autoDel, boolean create)` Gets or creates count down latch.
`void` `onKernalStart()` Callback that notifies that kernal has successfully started, including all managers and processors.
`void` `onKernalStop(boolean cancel)` Callback to notify that kernal is about to stop.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`<T> IgniteQueue<T>` `queue(String name, int cap, CollectionConfiguration cfg)` Gets a queue from cache or creates one if it's not cached.
`void` `removeAtomicLong(String name)` Removes atomic long from cache.
`void` `removeAtomicReference(String name)` Removes atomic reference from cache.
`void` `removeAtomicStamped(String name)` Removes atomic stamped from cache.
`void` `removeCountDownLatch(String name)` Removes count down latch from cache.
`void` `removeQueue(String name, GridCacheContext cctx)`
`void` `removeSequence(String name)` Removes sequence from cache.
`void` `removeSet(String name, GridCacheContext cctx)`
`static <R> R` `retry(IgniteLogger log, Callable<R> call)`
`IgniteAtomicSequence` `sequence(String name, long initVal, boolean create)` Gets a sequence from cache or creates one if it's not cached.
`<T> IgniteSet<T>` `set(String name, CollectionConfiguration cfg)` Gets a set from cache or creates one if it's not cached.

### Methods inherited from class org.apache.ignite.internal.processors.GridProcessorAdapter

`assertParameter, collectDiscoveryData, discoveryDataType, onDiscoveryDataReceived, start, stop, toString, validateNode`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### DATA_STRUCTURES_KEY

    public static final CacheDataStructuresConfigurationKey DATA_STRUCTURES_KEY

### Constructor Detail

#### DataStructuresProcessor

    public DataStructuresProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Context.

### Method Detail

#### onKernalStart

    public void onKernalStart()
                       throws IgniteCheckedException

Callback that notifies that kernal has successfully started, including all managers and processors.

Specified by:
  `onKernalStart` in interface `GridComponent`
Overrides:
  `onKernalStart` in class `GridProcessorAdapter`
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### onKernalStop

    public void onKernalStop(boolean cancel)

Callback to notify that kernal is about to stop.

Specified by:
  `onKernalStop` in interface `GridComponent`
Overrides:
  `onKernalStop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - Flag indicating whether jobs should be canceled.

#### sequence

    public final IgniteAtomicSequence sequence(String name,
                                long initVal,
                                boolean create)
                                        throws IgniteCheckedException

Gets a sequence from cache or creates one if it's not cached.

Parameters:
  `name` - Sequence name.
  `initVal` - Initial value for sequence. If sequence already cached, `initVal` will be ignored.
  `create` - If `true` sequence will be created in case it is not in cache.
Returns:
  Sequence.
Throws:
  `IgniteCheckedException` - If loading failed.

#### removeSequence

    public final void removeSequence(String name)
                              throws IgniteCheckedException

Removes sequence from cache.

Parameters:
  `name` - Sequence name.
Throws:
  `IgniteCheckedException` - If removing failed.

#### atomicLong

    public final IgniteAtomicLong atomicLong(String name,
                              long initVal,
                              boolean create)
                                      throws IgniteCheckedException

Gets an atomic long from cache or creates one if it's not cached.

Parameters:
  `name` - Name of atomic long.
  `initVal` - Initial value for atomic long. If atomic long already cached, `initVal` will be ignored.
  `create` - If `true` atomic long will be created in case it is not in cache.
Returns:
  Atomic long.
Throws:
  `IgniteCheckedException` - If loading failed.

#### removeAtomicLong

    public final void removeAtomicLong(String name)
                                throws IgniteCheckedException

Removes atomic long from cache.

Parameters:
  `name` - Atomic long name.
Throws:
  `IgniteCheckedException` - If removing failed.

#### atomicReference

    public final <T> IgniteAtomicReference<T> atomicReference(String name,
                                               T initVal,
                                               boolean create)
                                                   throws IgniteCheckedException

Gets an atomic reference from cache or creates one if it's not cached.

Parameters:
  `name` - Name of atomic reference.
  `initVal` - Initial value for atomic reference. If atomic reference already cached, `initVal` will be ignored.
  `create` - If `true` atomic reference will be created in case it is not in cache.
Returns:
  Atomic reference.
Throws:
  `IgniteCheckedException` - If loading failed.

#### removeAtomicReference

    public final void removeAtomicReference(String name)
                                     throws IgniteCheckedException

Removes atomic reference from cache.

Parameters:
  `name` - Atomic reference name.
Throws:
  `IgniteCheckedException` - If removing failed.

#### atomicStamped

    public final <T,S> IgniteAtomicStamped<T,S> atomicStamped(String name,
                                               T initVal,
                                               S initStamp,
                                               boolean create)
                                                 throws IgniteCheckedException

Gets an atomic stamped from cache or creates one if it's not cached.

Parameters:
  `name` - Name of atomic stamped.
  `initVal` - Initial value for atomic stamped. If atomic stamped already cached, `initVal` will be ignored.
  `initStamp` - Initial stamp for atomic stamped. If atomic stamped already cached, `initStamp` will be ignored.
  `create` - If `true` atomic stamped will be created in case it is not in cache.
Returns:
  Atomic stamped.
Throws:
  `IgniteCheckedException` - If loading failed.

#### removeAtomicStamped

    public final void removeAtomicStamped(String name)
                                   throws IgniteCheckedException

Removes atomic stamped from cache.

Parameters:
  `name` - Atomic stamped name.
Throws:
  `IgniteCheckedException` - If removing failed.

#### queue

    public final <T> IgniteQueue<T> queue(String name,
                           int cap,
                           @Nullable
                           CollectionConfiguration cfg)
                               throws IgniteCheckedException

Gets a queue from cache or creates one if it's not cached.

Parameters:
  `name` - Name of queue.
  `cap` - Max size of queue.
  `cfg` - Non-null queue configuration if new queue should be created.
Returns:
  Instance of queue.
Throws:
  `IgniteCheckedException` - If failed.

#### removeQueue

    public void removeQueue(String name,
                   GridCacheContext cctx)
                     throws IgniteCheckedException

Parameters:
  `name` - Queue name.
  `cctx` - Queue cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### countDownLatch

    public IgniteCountDownLatch countDownLatch(String name,
                                      int cnt,
                                      boolean autoDel,
                                      boolean create)
                                        throws IgniteCheckedException

Gets or creates count down latch. If count down latch is not found in cache, it is created using provided name and count parameter.

Parameters:
  `name` - Name of the latch.
  `cnt` - Initial count.
  `autoDel` - `True` to automatically delete latch from cache when its count reaches zero.
  `create` - If `true` latch will be created in case it is not in cache, if it is `false` all parameters except `name` are ignored.
Returns:
  Count down latch for the given name or `null` if it is not found and `create` is false.
Throws:
  `IgniteCheckedException` - If operation failed.

#### removeCountDownLatch

    public void removeCountDownLatch(String name)
                              throws IgniteCheckedException

Removes count down latch from cache.

Parameters:
  `name` - Name of the latch.
Throws:
  `IgniteCheckedException` - If operation failed.

#### set

    @Nullable
    public <T> IgniteSet<T> set(String name,
                                @Nullable
                                CollectionConfiguration cfg)
                     throws IgniteCheckedException

Gets a set from cache or creates one if it's not cached.

Parameters:
  `name` - Set name.
  `cfg` - Set configuration if new set should be created.
Returns:
  Set instance.
Throws:
  `IgniteCheckedException` - If failed.

#### removeSet

    public void removeSet(String name,
                 GridCacheContext cctx)
                   throws IgniteCheckedException

Parameters:
  `name` - Set name.
  `cctx` - Set cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### retry

    public static <R> R retry(IgniteLogger log,
              Callable<R> call)
                   throws IgniteCheckedException

Parameters:
  `log` - Logger.
  `call` - Callable.
Returns:
  Callable result.
Throws:
  `IgniteCheckedException` - If all retries failed.

#### printMemoryStats

    public void printMemoryStats()

Prints memory statistics (sizes of internal structures, etc.). NOTE: this method is for testing and profiling purposes only.

Specified by:
  `printMemoryStats` in interface `GridComponent`
Overrides:
  `printMemoryStats` in class `GridProcessorAdapter`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.2.0-incubating
Release Date | : June 16 2015