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 Modifier and Type Field Description static StringCACHE_GRPS_VIEWstatic StringCACHE_GRPS_VIEW_DESCstatic StringCACHES_VIEWstatic StringCACHES_VIEW_DESC
-
Constructor Summary
Constructors Constructor Description ClusterCachesInfo(GridKernalContext ctx)
-
Method Summary
-
-
-
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-Trueif 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:
Trueif 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 thetopVerand earlier.- Parameters:
topVer- Topology version.
-
cleanupRemovedCacheGroups
public void cleanupRemovedCacheGroups(AffinityTopologyVersion topVer)
Cleanups cache group descriptors that belong to thetopVerand 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:
trueif grid supports merge of config andFalseotherwise.
-
onDisconnected
public void onDisconnected()
-
onReconnected
public org.apache.ignite.internal.processors.cache.ClusterCachesReconnectResult onReconnected(boolean active, boolean transition)- Parameters:
active-Trueif reconnected to active cluster.transition-Trueif 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:
Trueif 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.
-
-