public class CacheAffinitySharedManager<K,V> extends GridCacheSharedManagerAdapter<K,V>
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_CLIENT_CACHE_CHANGE_MESSAGE_TIMEOUT |
cctx, diagnosticLog, log
Constructor and Description |
---|
CacheAffinitySharedManager() |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onKernalStart, onKernalStart0, onKernalStop, onKernalStop0, onReconnected, printMemoryStats, start, startInfo, stop, stop0, stopInfo, toString
public static final int DFLT_CLIENT_CACHE_CHANGE_MESSAGE_TIMEOUT
protected void start0() throws IgniteCheckedException
start0
in class GridCacheSharedManagerAdapter<K,V>
IgniteCheckedException
- If failed.public IgniteInternalFuture<?> initCachesOnLocalJoin(Map<Integer,CacheGroupDescriptor> grpDescs, Map<String,DynamicCacheDescriptor> cacheDescs)
public boolean waitRebalance(int grpId, int partId)
grpId
- Group id.partId
- Partition id.True
if this node waits for the partition rebalance.public boolean rebalanceRequired()
true
if rebalance expected.public void addToWaitGroup(int grpId, int part, AffinityTopologyVersion topVer, List<ClusterNode> assignment)
Late affinity switch will be triggered as soons as wait list becomes empty.
grpId
- Group id.part
- Part.topVer
- Topology version.assignment
- Ideal assignment.public void onCustomMessageNoAffinityChange(GridDhtPartitionsExchangeFuture fut, @Nullable @Nullable ExchangeActions exchActions)
fut
- Exchange future.exchActions
- Exchange actions.public void stopCacheOnReconnect(GridCacheContext cctx)
cctx
- Stopped cache context.public void stopCacheGroupOnReconnect(CacheGroupContext grpCtx)
grpCtx
- Stopped cache group context.public void onDisconnected(IgniteFuture<?> reconnectFut)
onDisconnected
in interface GridCacheSharedManager<K,V>
onDisconnected
in class GridCacheSharedManagerAdapter<K,V>
reconnectFut
- Reconnect future.public void forceCloseCaches(GridDhtPartitionsExchangeFuture fut, boolean crd, ExchangeActions exchActions)
fut
- Exchange future.crd
- Coordinator flag.exchActions
- Cache change requests.public IgniteInternalFuture<?> onCacheChangeRequest(GridDhtPartitionsExchangeFuture fut, boolean crd, ExchangeActions exchActions) throws IgniteCheckedException
fut
- Exchange future.crd
- Coordinator flag.exchActions
- Cache change requests.IgniteCheckedException
- If failed.public void clearGroupHoldersAndRegistry()
public void onExchangeChangeAffinityMessage(GridDhtPartitionsExchangeFuture exchFut, CacheAffinityChangeMessage msg)
CacheAffinityChangeMessage
which should complete exchange.exchFut
- Exchange future.msg
- Affinity change message.public void onChangeAffinityMessage(GridDhtPartitionsExchangeFuture exchFut, CacheAffinityChangeMessage msg)
CacheAffinityChangeMessage
which sent after rebalance finished.exchFut
- Exchange future.msg
- Message.public void onClientEvent(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
fut
- Exchange future.IgniteCheckedException
- If failed.public void addDhtAssignmentFetchFuture(GridDhtAssignmentFetchFuture fut)
fut
- Future to add.public void removeDhtAssignmentFetchFuture(GridDhtAssignmentFetchFuture fut)
fut
- Future to remove.public IgniteInternalFuture<?> initStartedCaches(boolean crd, GridDhtPartitionsExchangeFuture fut, Collection<DynamicCacheDescriptor> descs) throws IgniteCheckedException
crd
- Coordinator flag.fut
- Exchange future.descs
- Cache descriptors.IgniteCheckedException
- If failed.public GridAffinityAssignmentCache affinity(Integer grpId)
grpId
- Cache group ID.public void applyAffinityFromFullMessage(GridDhtPartitionsExchangeFuture fut, Map<Integer,CacheGroupAffinityMessage> idealAffDiff)
fut
- Current exchange future.idealAffDiff
- Map [Cache group id - Affinity distribution] which contains difference with ideal affinity.public Set<Integer> onLocalJoin(GridDhtPartitionsExchangeFuture fut, Map<Integer,CacheGroupAffinityMessage> receivedAff, AffinityTopologyVersion resTopVer)
fut
- Current exchange future.receivedAff
- Map [Cache group id - Affinity distribution] received from coordinator to apply.resTopVer
- Result topology version.receivedAff
.public void onServerJoinWithExchangeMergeProtocol(GridDhtPartitionsExchangeFuture fut, boolean crd)
fut
- Current exchange future.crd
- Coordinator flag.public Map<Integer,CacheGroupAffinityMessage> onServerLeftWithExchangeMergeProtocol(GridDhtPartitionsExchangeFuture fut)
fut
- Current exchange future.public void onExchangeFreeSwitch(GridDhtPartitionsExchangeFuture fut)
fut
- Exchange future.public Map<Integer,CacheGroupAffinityMessage> onCustomEventWithEnforcedAffinityReassignment(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
fut
- Current exchange future.IgniteCheckedException
- If failed.public Map<Integer,CacheGroupAffinityMessage> onReassignmentEnforced(GridDhtPartitionsExchangeFuture fut)
fut
- Current exchange future.public void onServerJoin(GridDhtPartitionsExchangeFuture fut, boolean crd) throws IgniteCheckedException
fut
- Exchange future.crd
- Coordinator flag.IgniteCheckedException
- If failed.public void onBaselineTopologyChanged(GridDhtPartitionsExchangeFuture fut, boolean crd)
fut
- Exchange futurecrd
- Coordinator flag.public boolean onCentralizedAffinityChange(GridDhtPartitionsExchangeFuture fut, boolean crd) throws IgniteCheckedException
fut
- Exchange future.crd
- Coordinator flag.True
if affinity should be assigned by coordinator.IgniteCheckedException
- If failed.public IgniteInternalFuture<?> initCoordinatorCaches(GridDhtPartitionsExchangeFuture fut, boolean newAff) throws IgniteCheckedException
fut
- Exchange future.newAff
- True
if there are no older nodes with affinity info available.IgniteCheckedException
- If failed.public IgniteInternalFuture<Map<Integer,Map<Integer,List<UUID>>>> initAffinityOnNodeLeft(GridDhtPartitionsExchangeFuture fut) throws IgniteCheckedException
fut
- Exchange future.IgniteCheckedException
- If failed.public Map<Integer,CacheGroupDescriptor> cacheGroups()
public Map<Integer,DynamicCacheDescriptor> caches()
@Nullable public @Nullable GridAffinityAssignmentCache groupAffinity(int grpId)
grpId
- Cache group IDpublic void dumpDebugInfo()
public Set<ClusterNode> idealPrimaryNodesForLocalBackups()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021