Package org.apache.ignite.internal.processors.cache

## Class ClusterCachesInfo

- java.lang.Object
- - org.apache.ignite.internal.processors.cache.ClusterCachesInfo

    public class ClusterCachesInfo
    extends Object

Logic related to cache discovery data processing.

### Field Summary

Fields
`static String` `CACHE_GRPS_VIEW`
`static String` `CACHE_GRPS_VIEW_DESC`
`static String` `CACHES_VIEW`
`static String` `CACHES_VIEW_DESC`

### Constructor Summary

Constructors
`ClusterCachesInfo​(GridKernalContext ctx)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `cleanupRemovedCacheGroups​(AffinityTopologyVersion topVer)` Cleanups cache group descriptors that belong to the `topVer` and earlier.
`void` `cleanupRemovedCaches​(AffinityTopologyVersion topVer)` Cleanups cache descriptors that belong to the `topVer` and earlier.
`void` `collectGridNodeData​(DiscoveryDataBag dataBag, CacheConfigurationSplitter splitter)`
`void` `filterDynamicCacheDescriptors​(Set<String> localCachesOnStart)` Filters all dynamic cache descriptors and groups that were not presented on node start and were received with grid discovery data.
`boolean` `isMergeConfigSupports​(ClusterNode joiningNode)`
`boolean` `isRestarting​(String cacheName)`
`@Nullable LocalJoinCachesContext` `localJoinCachesContext()` Called from exchange worker.
`@Nullable DynamicCacheDescriptor` `markedForDeletionCache​(String cacheName)`
`@Nullable CacheGroupDescriptor` `markedForDeletionCacheGroupDesc​(int grpId)`
`boolean` `onCacheChangeRequested​(DynamicCacheChangeBatch batch, AffinityTopologyVersion topVer)`
`void` `onCacheChangeRequested​(DynamicCacheChangeFailureMessage failMsg, AffinityTopologyVersion topVer)` Creates exchanges actions.
`void` `onClientCacheChange​(ClientCacheChangeDiscoveryMessage msg, ClusterNode node)`
`void` `onDisconnected()`
`void` `onDiscoveryEvent​(int type, ClusterNode node, AffinityTopologyVersion topVer)` Discovery event callback, executed from discovery thread.
`void` `onGridDataReceived​(DiscoveryDataBag.GridDiscoveryData data)`
`void` `onJoiningNodeDataReceived​(DiscoveryDataBag.JoiningNodeDiscoveryData data)`
`void` `onKernalStart​(boolean checkConsistency)`
`org.apache.ignite.internal.processors.cache.ClusterCachesReconnectResult` `onReconnected​(boolean active, boolean transition)`
`void` `onStart​(CacheJoinNodeDiscoveryData joinDiscoData)`
`void` `onStateChangeFinish​(ChangeGlobalStateFinishMessage msg)`
`ExchangeActions` `onStateChangeRequest​(ChangeGlobalStateMessage msg, AffinityTopologyVersion topVer, DiscoveryDataClusterState curState)`
`void` `removeRestartingCache​(String cacheName)`
`void` `removeRestartingCaches()` Clear up information about restarting caches.
`String` `validateJoiningNodeData​(DiscoveryDataBag.JoiningNodeDiscoveryData data, boolean joiningNodeClient)`

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

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

### Field Detail

#### CACHES_VIEW

    public static final String CACHES_VIEW

See Also:
  Constant Field Values

#### CACHES_VIEW_DESC

    public static final String CACHES_VIEW_DESC

See Also:
  Constant Field Values

#### CACHE_GRPS_VIEW

    public static final String CACHE_GRPS_VIEW

See Also:
  Constant Field Values

#### CACHE_GRPS_VIEW_DESC

    public static final String CACHE_GRPS_VIEW_DESC

See Also:
  Constant Field Values

### Constructor Detail

#### ClusterCachesInfo

    public ClusterCachesInfo​(GridKernalContext ctx)

Parameters:
  `ctx` - Context.

### Method Detail

#### filterDynamicCacheDescriptors

    public void filterDynamicCacheDescriptors​(Set<String> localCachesOnStart)

Filters all dynamic cache descriptors and groups that were not presented on node start and were received with grid discovery data.

Parameters:
  `localCachesOnStart` - Caches which were already presented on node start.

#### onStart

    public void onStart​(CacheJoinNodeDiscoveryData joinDiscoData)
                 throws IgniteCheckedException

Parameters:
  `joinDiscoData` - Information about configured caches and templates.
Throws:
  `IgniteCheckedException` - If configuration validation failed.

#### onKernalStart

    public void onKernalStart​(boolean checkConsistency)
                       throws IgniteCheckedException

Parameters:
  `checkConsistency` - `True` if need check cache configurations consistency.
Throws:
  `IgniteCheckedException` - If failed.

#### onClientCacheChange

    public void onClientCacheChange​(ClientCacheChangeDiscoveryMessage msg,
                                    ClusterNode node)

Parameters:
  `msg` - Message.
  `node` - Node sent message.

#### onCacheChangeRequested

    public void onCacheChangeRequested​(DynamicCacheChangeFailureMessage failMsg,
                                       AffinityTopologyVersion topVer)

Creates exchanges actions. Forms a list of caches and cache groups to be stopped due to dynamic cache start failure.

Parameters:
  `failMsg` - Dynamic change request fail message.
  `topVer` - Current topology version.

#### onCacheChangeRequested

    public boolean onCacheChangeRequested​(DynamicCacheChangeBatch batch,
                                          AffinityTopologyVersion topVer)

Parameters:
  `batch` - Cache change request.
  `topVer` - Current topology version.
Returns:
  `True` if minor topology version should be increased.

#### localJoinCachesContext

    @Nullable
    public @Nullable LocalJoinCachesContext localJoinCachesContext()

Called from exchange worker.

Returns:
  Caches to be started when this node starts.

#### onDiscoveryEvent

    public void onDiscoveryEvent​(int type,
                                 ClusterNode node,
                                 AffinityTopologyVersion topVer)

Discovery event callback, executed from discovery thread.

Parameters:
  `type` - Event type.
  `node` - Event node.
  `topVer` - Topology version.

#### collectGridNodeData

    public void collectGridNodeData​(DiscoveryDataBag dataBag,
                                    CacheConfigurationSplitter splitter)

Parameters:
  `dataBag` - Discovery data bag.
  `splitter` - Cache configuration splitter.

#### onGridDataReceived

    public void onGridDataReceived​(DiscoveryDataBag.GridDiscoveryData data)

Parameters:
  `data` - Discovery data.

#### cleanupRemovedCaches

    public void cleanupRemovedCaches​(AffinityTopologyVersion topVer)

Cleanups cache descriptors that belong to the `topVer` and earlier.

Parameters:
  `topVer` - Topology version.

#### cleanupRemovedCacheGroups

    public void cleanupRemovedCacheGroups​(AffinityTopologyVersion topVer)

Cleanups cache group descriptors that belong to the `topVer` and earlier.

Parameters:
  `topVer` - Topology version.

#### markedForDeletionCacheGroupDesc

    @Nullable
    public @Nullable CacheGroupDescriptor markedForDeletionCacheGroupDesc​(int grpId)

Parameters:
  `grpId` - Group id.

#### markedForDeletionCache

    @Nullable
    public @Nullable DynamicCacheDescriptor markedForDeletionCache​(String cacheName)

Parameters:
  `cacheName` - Cache name.

#### onStateChangeFinish

    public void onStateChangeFinish​(ChangeGlobalStateFinishMessage msg)

Parameters:
  `msg` - Message.

#### onStateChangeRequest

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

Parameters:
  `msg` - Message.
  `topVer` - Current topology version.
  `curState` - Current cluster state.
Returns:
  Exchange action.
Throws:
  `IgniteCheckedException` - If configuration validation failed.

#### onJoiningNodeDataReceived

    public void onJoiningNodeDataReceived​(DiscoveryDataBag.JoiningNodeDiscoveryData data)

Parameters:
  `data` - Joining node data.

#### validateJoiningNodeData

    public String validateJoiningNodeData​(DiscoveryDataBag.JoiningNodeDiscoveryData data,
                                          boolean joiningNodeClient)

Parameters:
  `data` - Joining node data.
  `joiningNodeClient` - Joining node is client flag.
Returns:
  Message with error or null if everything was OK.

#### isMergeConfigSupports

    public boolean isMergeConfigSupports​(ClusterNode joiningNode)

Returns:
  `true` if grid supports merge of config and `False` otherwise.

#### onDisconnected

    public void onDisconnected()

#### onReconnected

    public org.apache.ignite.internal.processors.cache.ClusterCachesReconnectResult onReconnected​(boolean active,
                                                                                                  boolean transition)

Parameters:
  `active` - `True` if reconnected to active cluster.
  `transition` - `True` if reconnected while state transition in progress.
Returns:
  Information about stopped caches and cache groups.

#### isRestarting

    public boolean isRestarting​(String cacheName)

Parameters:
  `cacheName` - Cache name.
Returns:
  `True` if cache is restarting.

#### removeRestartingCache

    public void removeRestartingCache​(String cacheName)

Parameters:
  `cacheName` - Cache name which restart were cancelled.

#### removeRestartingCaches

    public void removeRestartingCaches()

Clear up information about restarting caches.