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, diagnosticLog, log`

### Constructor Summary

Constructors
Constructor and Description
`GridCacheProcessor(GridKernalContext ctx)`

### Method Summary

Methods
`void` `addCacheConfiguration(CacheConfiguration cacheCfg)`
`void` `awaitStarted()`
`void` `blockGateways()` Blocks all available gateways
`<K,V> IgniteInternalCache<K,V>` `cache(String name)`
`CacheConfiguration` `cacheConfiguration(String name)` Get configuration for the given cache.
`DynamicCacheDescriptor` `cacheDescriptor(int cacheId)`
`DynamicCacheDescriptor` `cacheDescriptor(String name)` Get registered cache descriptor.
`Map<String,DynamicCacheDescriptor>` `cacheDescriptors()`
`CacheGroupContext` `cacheGroup(int grpId)`
`Map<Integer,CacheGroupDescriptor>` `cacheGroupDescriptors()`
`Collection<CacheGroupContext>` `cacheGroups()`
`CacheMode` `cacheMode(String cacheName)` Gets cache mode.
`Collection<String>` `cacheNames()` Gets a collection of currently started caches.
`Collection<IgniteInternalCache<?,?>>` `caches()`
`List<T2<DynamicCacheDescriptor,NearCacheConfiguration>>` `cachesToStartOnLocalJoin()`
`CacheType` `cacheType(String cacheName)`
`<T> T` `clone(T obj)`
`void` `collectGridNodeData(DiscoveryDataBag dataBag)` Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.
`void` `collectJoiningNodeData(DiscoveryDataBag dataBag)` Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.
`<K,V> GridCacheSharedContext<K,V>` `context()`
`IgniteInternalFuture<?>` `createFromTemplate(String cacheName)` Dynamically starts cache using template configuration.
`void` `createMissingQueryCaches()` Starts client caches that do not exist yet.
`GridComponent.DiscoveryDataExchangeType` `discoveryDataType()` Gets unique component type to distinguish components providing discovery data.
`IgniteInternalFuture<Boolean>` `dynamicDestroyCache(String cacheName, boolean sql, boolean checkThreadTx, boolean restart)`
`IgniteInternalFuture<?>` `dynamicDestroyCaches(Collection<String> cacheNames, boolean checkThreadTx, boolean restart)`
`IgniteInternalFuture<?>` `dynamicDestroyCaches(Collection<String> cacheNames, boolean checkThreadTx, boolean restart, boolean destroy)`
`IgniteInternalFuture<Boolean>` `dynamicStartCache(CacheConfiguration ccfg, String cacheName, NearCacheConfiguration nearCfg, boolean failIfExists, boolean failIfNotStarted, boolean checkThreadTx)` Dynamically starts cache.
`IgniteInternalFuture<Boolean>` `dynamicStartCache(CacheConfiguration ccfg, String cacheName, NearCacheConfiguration nearCfg, CacheType cacheType, boolean sql, boolean failIfExists, boolean failIfNotStarted, boolean checkThreadTx)` Dynamically starts cache.
`IgniteInternalFuture<?>` `dynamicStartCaches(Collection<CacheConfiguration> ccfgList, boolean failIfExists, boolean checkThreadTx)` Dynamically starts multiple caches.
`IgniteInternalFuture<Boolean>` `dynamicStartSqlCache(CacheConfiguration ccfg)` Dynamically starts cache as a result of SQL `CREATE TABLE` command.
`CachePartitionExchangeWorkerTask` `exchangeTaskForCustomDiscoveryMessage(DiscoveryCustomMessage msg)` Create exchange worker task for custom discovery message.
`CacheConfiguration` `getConfigFromTemplate(String cacheName)`
`IgniteInternalFuture<?>` `getOrCreateFromTemplate(String cacheName, boolean checkThreadTx)` Dynamically starts cache using template configuration.
`<K,V> IgniteInternalCache<K,V>` `getOrStartCache(String name)`
`<K,V> IgniteInternalCache<K,V>` `getOrStartCache(String name, CacheConfiguration ccfg)`
`IgniteCacheProxy<?,?>` `getOrStartPublicCache(boolean start, boolean inclLoc)` Gets public cache that can be used for query execution.
`<K,V> GridCacheAdapter<K,V>` `internalCache(String name)`
`Collection<GridCacheAdapter<?,?>>` `internalCaches()`
`<K,V> IgniteCacheProxy<K,V>` `jcache(String name)`
`IgniteCacheProxy` `jcacheProxy(String name)`
`Collection<IgniteCacheProxy<?,?>>` `jcaches()`
`long` `lastDataVersion()`
`boolean` `onCustomEvent(DiscoveryCustomMessage msg, AffinityTopologyVersion topVer, ClusterNode node)` Callback invoked from discovery thread when discovery custom message is received.
`void` `onDisconnected(IgniteFuture<?> reconnectFut)` Client disconnected callback.
`void` `onDiscoveryEvent(int type, DiscoveryCustomMessage customMsg, ClusterNode node, AffinityTopologyVersion topVer, DiscoveryDataClusterState state)`
`void` `onExchangeDone(AffinityTopologyVersion topVer, ExchangeActions exchActions, Throwable err)` Callback invoked when first exchange future for dynamic cache is completed.
`void` `onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)` Receives discovery data object from remote nodes (called on new node during discovery process).
`void` `onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)` Method is called on nodes that are already in grid (not on joining node).
`void` `onKernalStart(boolean active)` 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` `onKernalStopCaches(boolean cancel)`
`IgniteInternalFuture<?>` `onReconnected(boolean clusterRestarted)` Client reconnected callback.
`void` `onStateChangeFinish(ChangeGlobalStateFinishMessage msg)`
`ExchangeActions` `onStateChangeRequest(ChangeGlobalStateMessage msg, AffinityTopologyVersion topVer)`
`void` `onUndeployed(ClassLoader ldr)` Callback invoked by deployment manager for whenever a class loader gets undeployed.
`void` `printMemoryStats()` Prints memory statistics (sizes of internal structures, etc.).
`<K,V> IgniteInternalCache<K,V>` `publicCache(String name)`
`Collection<String>` `publicCacheNames()` Gets a collection of currently started public cache names.
`Collection<IgniteCacheProxy<?,?>>` `publicCaches()`
`<K,V> IgniteCacheProxy<K,V>` `publicJCache(String cacheName)`
`<K,V> IgniteCacheProxy<K,V>` `publicJCache(String cacheName, boolean failIfNotStarted, boolean checkThreadTx)`
`IgniteInternalFuture<?>` `resetCacheState(Collection<String> cacheNames)` Resets cache state after the cache has been moved to recovery state.
`void` `resetRestartingCaches()` Reset restarting caches.
`void` `start()` Starts grid component.
`void` `startCachesOnLocalJoin(List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> caches, AffinityTopologyVersion exchTopVer)`
`Collection<DynamicCacheDescriptor>` `startReceivedCaches(UUID nodeId, AffinityTopologyVersion exchTopVer)` Starts statically configured caches received from remote nodes during exchange.
`void` `stop(boolean cancel)` Stops grid component.
`void` `stopCaches(boolean cancel)`
`boolean` `systemCache(String name)`
`IgniteTransactionsEx` `transactions()`
`<K,V> IgniteInternalCache<K,V>` `utilityCache()` Gets utility cache.
`IgniteNodeValidationResult` `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, 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

#### exchangeTaskForCustomDiscoveryMessage

    public CachePartitionExchangeWorkerTask exchangeTaskForCustomDiscoveryMessage(DiscoveryCustomMessage msg)

Create exchange worker task for custom discovery message.

Parameters:
  `msg` - Custom discovery message.
Returns:
  Task or `null` if message doesn't require any special processing.

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

#### cacheGroup

    @Nullable
    public CacheGroupContext cacheGroup(int grpId)

Parameters:
  `grpId` - Group ID.
Returns:
  Cache group.

#### cacheGroups

    public Collection<CacheGroupContext> cacheGroups()

Returns:
  Cache groups.

#### onKernalStart

    public void onKernalStart(boolean active)
                       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`
Parameters:
  `active` - Cluster active flag (note: should be used carefully since state can change concurrently).
Throws:
  `IgniteCheckedException` - Thrown in case of any errors.

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

#### stopCaches

    public void stopCaches(boolean cancel)

Parameters:
  `cancel` - Cancel.

#### blockGateways

    public void blockGateways()

Blocks all available gateways

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

#### onKernalStopCaches

    public void onKernalStopCaches(boolean cancel)

Parameters:
  `cancel` - Cancel.

#### onDisconnected

    public void onDisconnected(IgniteFuture<?> reconnectFut)
                        throws IgniteCheckedException

Client disconnected callback.

Specified by:
  `onDisconnected` in interface `GridComponent`
Overrides:
  `onDisconnected` in class `GridProcessorAdapter`
Parameters:
  `reconnectFut` - Reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

#### onReconnected

    public IgniteInternalFuture<?> onReconnected(boolean clusterRestarted)
                                          throws IgniteCheckedException

Client reconnected callback.

Specified by:
  `onReconnected` in interface `GridComponent`
Overrides:
  `onReconnected` in class `GridProcessorAdapter`
Parameters:
  `clusterRestarted` - Cluster restarted flag.
Returns:
  Future to wait before completing reconnect future.
Throws:
  `IgniteCheckedException` - If failed.

#### awaitStarted

    public void awaitStarted()
                      throws IgniteCheckedException

Throws:
  `IgniteCheckedException` - If failed to wait.

#### cacheNames

    public Collection<String> cacheNames()

Gets a collection of currently started caches.

Returns:
  Collection of started cache names.

#### getOrStartPublicCache

    public IgniteCacheProxy<?,?> getOrStartPublicCache(boolean start,
                                              boolean inclLoc)
                                                throws IgniteCheckedException

Gets public cache that can be used for query execution. If cache isn't created on current node it will be started.

Parameters:
  `start` - Start cache.
  `inclLoc` - Include local caches.
Returns:
  Cache or `null` if there is no suitable cache.
Throws:
  `IgniteCheckedException`

#### publicCacheNames

    public Collection<String> publicCacheNames()

Gets a collection of currently started public cache names.

Returns:
  Collection of currently started public cache names

#### cacheMode

    public CacheMode cacheMode(String cacheName)

Gets cache mode.

Parameters:
  `cacheName` - Cache name to check.
Returns:
  Cache mode.

#### cachesToStartOnLocalJoin

    public List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> cachesToStartOnLocalJoin()

Returns:
  Caches to be started when this node starts.

#### startCachesOnLocalJoin

    public void startCachesOnLocalJoin(List<T2<DynamicCacheDescriptor,NearCacheConfiguration>> caches,
                              AffinityTopologyVersion exchTopVer)
                                throws IgniteCheckedException

Parameters:
  `caches` - Caches to start.
  `exchTopVer` - Current exchange version.
Throws:
  `IgniteCheckedException` - If failed.

#### startReceivedCaches

    public Collection<DynamicCacheDescriptor> startReceivedCaches(UUID nodeId,
                                                         AffinityTopologyVersion exchTopVer)
                                                           throws IgniteCheckedException

Starts statically configured caches received from remote nodes during exchange.

Parameters:
  `nodeId` - Joining node ID.
  `exchTopVer` - Current exchange version.
Returns:
  Started caches descriptors.
Throws:
  `IgniteCheckedException` - If failed.

#### onExchangeDone

    public void onExchangeDone(AffinityTopologyVersion topVer,
                      @Nullable
                      ExchangeActions exchActions,
                      @Nullable
                      Throwable err)

Callback invoked when first exchange future for dynamic cache is completed.

Parameters:
  `topVer` - Completed topology version.
  `exchActions` - Change requests.
  `err` - Error.

#### discoveryDataType

    @Nullable
    public GridComponent.DiscoveryDataExchangeType discoveryDataType()

Gets unique component type to distinguish components providing discovery data. Must return non-null value if component implements any of methods `GridComponent.collectJoiningNodeData(DiscoveryDataBag)` or `GridComponent.collectGridNodeData(DiscoveryDataBag)`.

Specified by:
  `discoveryDataType` in interface `GridComponent`
Overrides:
  `discoveryDataType` in class `GridProcessorAdapter`
Returns:
  Unique component type for discovery data exchange.

#### collectJoiningNodeData

    public void collectJoiningNodeData(DiscoveryDataBag dataBag)

Collects discovery data on joining node before sending `TcpDiscoveryJoinRequestMessage` request.

Specified by:
  `collectJoiningNodeData` in interface `GridComponent`
Overrides:
  `collectJoiningNodeData` in class `GridProcessorAdapter`
Parameters:
  `dataBag` - container object to store discovery data in.

#### collectGridNodeData

    public void collectGridNodeData(DiscoveryDataBag dataBag)

Collects discovery data on nodes already in grid on receiving `TcpDiscoveryNodeAddedMessage`.

Specified by:
  `collectGridNodeData` in interface `GridComponent`
Overrides:
  `collectGridNodeData` in class `GridProcessorAdapter`
Parameters:
  `dataBag` - container object to store discovery data in.

#### onJoiningNodeDataReceived

    public void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data)

Method is called on nodes that are already in grid (not on joining node). It receives discovery data from joining node.

Specified by:
  `onJoiningNodeDataReceived` in interface `GridComponent`
Overrides:
  `onJoiningNodeDataReceived` in class `GridProcessorAdapter`
Parameters:
  `data` - `DiscoveryDataBag.JoiningNodeDiscoveryData` interface to retrieve discovery data of joining node.

#### onGridDataReceived

    public void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data)

Receives discovery data object from remote nodes (called on new node during discovery process).

Specified by:
  `onGridDataReceived` in interface `GridComponent`
Overrides:
  `onGridDataReceived` in class `GridProcessorAdapter`
Parameters:
  `data` - `DiscoveryDataBag.GridDiscoveryData` interface to retrieve discovery data collected on remote nodes (data common for all nodes in grid and specific for each node).

#### onStateChangeFinish

    public void onStateChangeFinish(ChangeGlobalStateFinishMessage msg)

Parameters:
  `msg` - Message.

#### onStateChangeRequest

    public ExchangeActions onStateChangeRequest(ChangeGlobalStateMessage msg,
                                       AffinityTopologyVersion topVer)
                                         throws IgniteCheckedException

Parameters:
  `msg` - Message.
  `topVer` - Current topology version.
Returns:
  Exchange actions.
Throws:
  `IgniteCheckedException` - If configuration validation failed.

#### createFromTemplate

    public IgniteInternalFuture<?> createFromTemplate(String cacheName)

Dynamically starts cache using template configuration.

Parameters:
  `cacheName` - Cache name.
Returns:
  Future that will be completed when cache is deployed.

#### getOrCreateFromTemplate

    public IgniteInternalFuture<?> getOrCreateFromTemplate(String cacheName,
                                                  boolean checkThreadTx)

Dynamically starts cache using template configuration.

Parameters:
  `cacheName` - Cache name.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when cache is deployed.

#### getConfigFromTemplate

    public CacheConfiguration getConfigFromTemplate(String cacheName)
                                             throws IgniteCheckedException

Parameters:
  `cacheName` - Cache name.
Returns:
  Cache configuration, or `null` if no template with matching name found.
Throws:
  `IgniteCheckedException` - If failed.

#### dynamicStartCache

    public IgniteInternalFuture<Boolean> dynamicStartCache(@Nullable
                                                  CacheConfiguration ccfg,
                                                  String cacheName,
                                                  @Nullable
                                                  NearCacheConfiguration nearCfg,
                                                  boolean failIfExists,
                                                  boolean failIfNotStarted,
                                                  boolean checkThreadTx)

Dynamically starts cache.

Parameters:
  `ccfg` - Cache configuration.
  `cacheName` - Cache name.
  `nearCfg` - Near cache configuration.
  `failIfExists` - Fail if exists flag.
  `failIfNotStarted` - If `true` fails if cache is not started.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when cache is deployed.

#### dynamicStartSqlCache

    public IgniteInternalFuture<Boolean> dynamicStartSqlCache(CacheConfiguration ccfg)

Dynamically starts cache as a result of SQL `CREATE TABLE` command.

Parameters:
  `ccfg` - Cache configuration.

#### dynamicStartCache

    public IgniteInternalFuture<Boolean> dynamicStartCache(@Nullable
                                                  CacheConfiguration ccfg,
                                                  String cacheName,
                                                  @Nullable
                                                  NearCacheConfiguration nearCfg,
                                                  CacheType cacheType,
                                                  boolean sql,
                                                  boolean failIfExists,
                                                  boolean failIfNotStarted,
                                                  boolean checkThreadTx)

Dynamically starts cache.

Parameters:
  `ccfg` - Cache configuration.
  `cacheName` - Cache name.
  `nearCfg` - Near cache configuration.
  `cacheType` - Cache type.
  `sql` - If the cache needs to be created as the result of SQL `CREATE TABLE` command.
  `failIfExists` - Fail if exists flag.
  `failIfNotStarted` - If `true` fails if cache is not started.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when cache is deployed.

#### dynamicStartCaches

    public IgniteInternalFuture<?> dynamicStartCaches(Collection<CacheConfiguration> ccfgList,
                                             boolean failIfExists,
                                             boolean checkThreadTx)

Dynamically starts multiple caches.

Parameters:
  `ccfgList` - Collection of cache configuration.
  `failIfExists` - Fail if exists flag.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when all caches are deployed.

#### dynamicDestroyCache

    public IgniteInternalFuture<Boolean> dynamicDestroyCache(String cacheName,
                                                    boolean sql,
                                                    boolean checkThreadTx,
                                                    boolean restart)

Parameters:
  `cacheName` - Cache name to destroy.
  `sql` - If the cache needs to be destroyed only if it was created as the result of SQL `CREATE TABLE` command.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when cache is destroyed.

#### dynamicDestroyCaches

    public IgniteInternalFuture<?> dynamicDestroyCaches(Collection<String> cacheNames,
                                               boolean checkThreadTx,
                                               boolean restart)

Parameters:
  `cacheNames` - Collection of cache names to destroy.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when cache is destroyed.

#### dynamicDestroyCaches

    public IgniteInternalFuture<?> dynamicDestroyCaches(Collection<String> cacheNames,
                                               boolean checkThreadTx,
                                               boolean restart,
                                               boolean destroy)

Parameters:
  `cacheNames` - Collection of cache names to destroy.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Future that will be completed when cache is destroyed.

#### resetCacheState

    public IgniteInternalFuture<?> resetCacheState(Collection<String> cacheNames)

Resets cache state after the cache has been moved to recovery state.

Parameters:
  `cacheNames` - Cache names.
Returns:
  Future that will be completed when state is changed for all caches.

#### cacheType

    public CacheType cacheType(String cacheName)

#### onDiscoveryEvent

    public void onDiscoveryEvent(int type,
                        @Nullable
                        DiscoveryCustomMessage customMsg,
                        ClusterNode node,
                        AffinityTopologyVersion topVer,
                        DiscoveryDataClusterState state)

Parameters:
  `type` - Event type.
  `customMsg` - Custom message instance.
  `node` - Event node.
  `topVer` - Topology version.
  `state` - Cluster state.

#### onCustomEvent

    public boolean onCustomEvent(DiscoveryCustomMessage msg,
                        AffinityTopologyVersion topVer,
                        ClusterNode node)

Callback invoked from discovery thread when discovery custom message is received.

Parameters:
  `msg` - Customer message.
  `topVer` - Current topology version.
  `node` - Node sent message.
Returns:
  `True` if minor topology version should be increased.

#### validateNode

    @Nullable
    public IgniteNodeValidationResult 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.

#### resetRestartingCaches

    public void resetRestartingCaches()

Reset restarting caches.

#### lastDataVersion

    public long lastDataVersion()

Returns:
  Last data version.

#### cache

    public <K,V> IgniteInternalCache<K,V> cache(String name)

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

#### getOrStartCache

    public <K,V> IgniteInternalCache<K,V> getOrStartCache(String name)
                                             throws IgniteCheckedException

Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.
Throws:
  `IgniteCheckedException` - If failed.

#### getOrStartCache

    public <K,V> IgniteInternalCache<K,V> getOrStartCache(String name,
                                                 CacheConfiguration ccfg)
                                             throws IgniteCheckedException

Parameters:
  `name` - Cache name.
Returns:
  Cache instance for given name.
Throws:
  `IgniteCheckedException` - If failed.

#### caches

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

Returns:
  All configured cache instances.

#### jcaches

    public Collection<IgniteCacheProxy<?,?>> jcaches()

Returns:
  All configured cache instances.

#### utilityCache

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

Gets utility cache.

Returns:
  Utility cache.

#### publicCache

    public <K,V> IgniteInternalCache<K,V> publicCache(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> IgniteCacheProxy<K,V> publicJCache(String cacheName)
                                       throws IgniteCheckedException

Type Parameters:
  `K` - type of keys.
  `V` - type of values.
Parameters:
  `cacheName` - Cache name.
Returns:
  Cache instance for given name.
Throws:
  `IgniteCheckedException` - If failed.

#### publicJCache

    @Nullable
    public <K,V> IgniteCacheProxy<K,V> publicJCache(String cacheName,
                                                    boolean failIfNotStarted,
                                                    boolean checkThreadTx)
                                       throws IgniteCheckedException

Parameters:
  `cacheName` - Cache name.
  `failIfNotStarted` - If `true` throws `IllegalArgumentException` if cache is not started, otherwise returns `null` in this case.
  `checkThreadTx` - If `true` checks that current thread does not have active transactions.
Returns:
  Cache instance for given name.
Throws:
  `IgniteCheckedException` - If failed.

#### cacheConfiguration

    public CacheConfiguration cacheConfiguration(String name)

Get configuration for the given cache.

Parameters:
  `name` - Cache name.
Returns:
  Cache configuration.

#### cacheDescriptor

    public DynamicCacheDescriptor cacheDescriptor(String name)

Get registered cache descriptor.

Parameters:
  `name` - Name.
Returns:
  Descriptor.

#### cacheDescriptors

    public Map<String,DynamicCacheDescriptor> cacheDescriptors()

Returns:
  Cache descriptors.

#### cacheGroupDescriptors

    public Map<Integer,CacheGroupDescriptor> cacheGroupDescriptors()

Returns:
  Cache group descriptors.

#### cacheDescriptor

    @Nullable
    public DynamicCacheDescriptor cacheDescriptor(int cacheId)

Parameters:
  `cacheId` - Cache ID.
Returns:
  Cache descriptor.

#### addCacheConfiguration

    public void addCacheConfiguration(CacheConfiguration cacheCfg)
                               throws IgniteCheckedException

Parameters:
  `cacheCfg` - Cache configuration template.
Throws:
  `IgniteCheckedException` - If failed.

#### jcache

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

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

#### jcacheProxy

    @Nullable
    public IgniteCacheProxy jcacheProxy(String name)

Parameters:
  `name` - Cache name.
Returns:
  Cache proxy.

#### publicCaches

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

Returns:
  All configured public cache instances.

#### internalCache

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

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

#### internalCaches

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

Returns:
  All internal cache instances.

#### systemCache

    public boolean systemCache(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.

#### createMissingQueryCaches

    public void createMissingQueryCaches()
                                  throws IgniteCheckedException

Starts client caches that do not exist yet.

Throws:
  `IgniteCheckedException` - In case of error.

#### clone

    public <T> T clone(T obj)
            throws IgniteCheckedException

Parameters:
  `obj` - Object to clone.
Returns:
  Object copy.
Throws:
  `IgniteCheckedException` - If failed.

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.2.0
Release Date | : September 15 2017