org.apache.ignite.internal.processors.cache

## Class GridCacheProcessor

- java.lang.Object
- - org.apache.ignite.internal.processors.GridProcessorAdapter
  - - org.apache.ignite.internal.processors.cache.GridCacheProcessor

All Implemented Interfaces:
  GridComponent, GridProcessor

    public class GridCacheProcessor
    extends GridProcessorAdapter

Cache processor.

### Nested Class Summary

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

`GridComponent.DiscoveryDataExchangeType`

### Field Summary

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

`ctx, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`void` `addAttributes(Map<String,Object> attrs)` Adds attributes from this component to map of all node attributes.
`<K,V> GridCache<K,V>` `atomicsCache()` Gets utility cache for atomic data structures.
`<K,V> GridCache<K,V>` `cache()`
`<K,V> GridCache<K,V>` `cache(String name)`
`Collection<GridCache<?,?>>` `caches()`
`void` `cancelUserOperations()` Cancel all user operations.
`<K,V> GridCacheSharedContext<K,V>` `context()`
`<K,V> GridCacheAdapter<K,V>` `internalCache()`
`<K,V> GridCacheAdapter<K,V>` `internalCache(String name)`
`Collection<GridCacheAdapter<?,?>>` `internalCaches()`
`<K,V> IgniteCacheProxy<K,V>` `jcache(String name)`
`long` `lastDataVersion()`
`void` `onEvictFromSwap(String spaceName, byte[] keyBytes)`
`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` `onUndeployed(ClassLoader ldr)` Callback invoked by deployment manager for whenever a class loader gets undeployed.
`IgniteInternalFuture<?>` `orderedPreloadFuture(int order)` Gets preload finish future for preload-ordered cache with given order.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`<K,V> GridCache<K,V>` `publicCache()`
`<K,V> GridCache<K,V>` `publicCache(String name)`
`Collection<GridCache<?,?>>` `publicCaches()`
`<K,V> IgniteCache<K,V>` `publicJCache(String name)`
`void` `start()` Starts grid component.
`void` `stop(boolean cancel)` Stops grid component.
`boolean` `systemCache(String name)`
`IgniteTransactionsEx` `transactions()`
`<K,V> GridCacheAdapter<K,V>` `utilityCache()` Gets utility cache.
`<K extends GridCacheUtilityKey,V> GridCacheProjectionEx<K,V>` `utilityCache(Class<K> keyCls, Class<V> valCls)` Gets utility cache.
`IgniteSpiNodeValidationResult` `validateNode(ClusterNode node)` Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.

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

`assertParameter, collectDiscoveryData, discoveryDataType, onDiscoveryDataReceived, toString`

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

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

### Constructor Detail

#### GridCacheProcessor

    public GridCacheProcessor(GridKernalContext ctx)

Parameters:
  `ctx` - Kernal context.

### Method Detail

#### start

    public void start()
               throws IgniteCheckedException

Starts grid component.

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

#### addAttributes

    public void addAttributes(Map<String,Object> attrs)
                       throws IgniteCheckedException

Adds attributes from this component to map of all node attributes.

Specified by:
  `addAttributes` in interface `GridProcessor`
Overrides:
  `addAttributes` in class `GridProcessorAdapter`
Parameters:
  `attrs` - Map of all attributes.
Throws:
  `IgniteCheckedException` - If failed.

#### validateNode

    @Nullable
    public IgniteSpiNodeValidationResult validateNode(ClusterNode node)

Validates that new node can join grid topology, this method is called on coordinator node before new node joins topology.

Specified by:
  `validateNode` in interface `GridComponent`
Overrides:
  `validateNode` in class `GridProcessorAdapter`
Parameters:
  `node` - Joining node.
Returns:
  Validation result or `null` in case of success.

#### 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.

#### stop

    public void stop(boolean cancel)
              throws IgniteCheckedException

Stops grid component.

Specified by:
  `stop` in interface `GridComponent`
Overrides:
  `stop` in class `GridProcessorAdapter`
Parameters:
  `cancel` - If `true`, then all ongoing tasks or jobs for relevant components need to be cancelled.
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

#### orderedPreloadFuture

    @Nullable
    public IgniteInternalFuture<?> orderedPreloadFuture(int order)

Gets preload finish future for preload-ordered cache with given order. I.e. will get compound preload future with maximum order less than `order`.

Parameters:
  `order` - Cache order.
Returns:
  Compound preload future or `null` if order is minimal order found.

#### onEvictFromSwap

    public void onEvictFromSwap(String spaceName,
                       byte[] keyBytes)

Parameters:
  `spaceName` - Space name.
  `keyBytes` - Key bytes.

#### lastDataVersion

    public long lastDataVersion()

Returns:
  Last data version.

#### cache

    public <K,V> GridCache<K,V> cache()

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Returns:
  Default cache.

#### cache

    public <K,V> GridCache<K,V> cache(@Nullable
                             String name)

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.

#### caches

    public Collection<GridCache<?,?>> caches()

Returns:
  All configured cache instances.

#### publicCache

    public <K,V> GridCache<K,V> publicCache()

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Returns:
  Default cache.

#### utilityCache

    public <K extends GridCacheUtilityKey,V> GridCacheProjectionEx<K,V> utilityCache(Class<K> keyCls,
                                                                            Class<V> valCls)

Gets utility cache.

Parameters:
  `keyCls` - Key class.
  `valCls` - Value class.
Returns:
  Projection over utility cache.

#### utilityCache

    public <K,V> GridCacheAdapter<K,V> utilityCache()

Gets utility cache.

Returns:
  Utility cache.

#### atomicsCache

    public <K,V> GridCache<K,V> atomicsCache()

Gets utility cache for atomic data structures.

Returns:
  Utility cache for atomic data structures.

#### publicCache

    public <K,V> GridCache<K,V> publicCache(@Nullable
                                   String name)

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.

#### publicJCache

    public <K,V> IgniteCache<K,V> publicJCache(@Nullable
                                      String name)

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.

#### jcache

    public <K,V> IgniteCacheProxy<K,V> jcache(@Nullable
                                     String name)

Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.

#### publicCaches

    public Collection<GridCache<?,?>> publicCaches()

Returns:
  All configured public cache instances.

#### internalCache

    public <K,V> GridCacheAdapter<K,V> internalCache()

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Returns:
  Default cache.

#### internalCache

    public <K,V> GridCacheAdapter<K,V> internalCache(@Nullable
                                            String name)

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.

#### cancelUserOperations

    public void cancelUserOperations()

Cancel all user operations.

#### internalCaches

    public Collection<GridCacheAdapter<?,?>> internalCaches()

Returns:
  All internal cache instances.

#### systemCache

    public boolean systemCache(@Nullable
                      String name)

Parameters:
  `name` - Cache name.
Returns:
  `True` if specified cache is system, `false` otherwise.

#### 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`

#### onUndeployed

    public void onUndeployed(ClassLoader ldr)

Callback invoked by deployment manager for whenever a class loader gets undeployed.

Parameters:
  `ldr` - Class loader.

#### context

    public <K,V> GridCacheSharedContext<K,V> context()

Returns:
  Shared context.

#### transactions

    public IgniteTransactionsEx transactions()

Returns:
  Transactions interface implementation.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC1
Release Date | : February 17 2015