public class GridCachePartitionExchangeManager<K,V> extends GridCacheSharedManagerAdapter<K,V>
Modifier and Type | Field and Description |
---|---|
static int |
DFLT_DIAGNOSTIC_WARN_LIMIT |
static int |
DFLT_EXCHANGE_HISTORY_SIZE |
static int |
DFLT_EXCHANGE_MERGE_DELAY |
static String |
FAILED_DUMP_MSG
Prefix of error message for dumping long running operations.
|
cctx, diagnosticLog, log
Constructor and Description |
---|
GridCachePartitionExchangeManager() |
context, isStopping, kernalStartInfo, kernalStopInfo, log, onDisconnected, onKernalStart, onKernalStart0, onKernalStop, onReconnected, printMemoryStats, start, startInfo, stop, stopInfo, toString
public static final String FAILED_DUMP_MSG
public static final int DFLT_EXCHANGE_HISTORY_SIZE
public static final int DFLT_EXCHANGE_MERGE_DELAY
public static final int DFLT_DIAGNOSTIC_WARN_LIMIT
protected void start0() throws IgniteCheckedException
start0
in class GridCacheSharedManagerAdapter<K,V>
IgniteCheckedException
- If failed.public void onCoordinatorInitialized()
public void onLocalJoin(DiscoveryEvent evt, DiscoCache cache)
evt
- Event.cache
- Cache.public IgniteInternalFuture<?> reconnectExchangeFuture()
public AffinityTopologyVersion onKernalStart(boolean active, boolean reconnect) throws IgniteCheckedException
active
- Cluster state.reconnect
- Reconnect flag.IgniteCheckedException
- If failed.public static int exchangeProtocolVersion(IgniteProductVersion ver)
ver
- Node version.public static Object rebalanceTopic(int idx)
idx
- Index.protected void onKernalStop0(boolean cancel)
onKernalStop0
in class GridCacheSharedManagerAdapter<K,V>
cancel
- Cancel flag.protected void stop0(boolean cancel)
stop0
in class GridCacheSharedManagerAdapter<K,V>
cancel
- Cancel flag.@Nullable public @Nullable GridDhtPartitionTopology clientTopologyIfExists(int grpId)
grpId
- Cache group ID.public GridDhtPartitionTopology clientTopology(int grpId, DiscoCache discoCache)
grpId
- Cache group ID.discoCache
- Discovery data cache.public Collection<GridClientPartitionTopology> clientTopologies()
public GridClientPartitionTopology clearClientTopology(int grpId)
grpId
- Cache group ID.public AffinityTopologyVersion readyAffinityVersion()
public GridDhtPartitionsExchangeFuture lastTopologyFuture()
@Nullable public @Nullable GridDhtPartitionsExchangeFuture lastFinishedFuture()
public void lastFinishedFuture(GridDhtPartitionsExchangeFuture fut)
fut
- Finished future.@NotNull public @NotNull IgniteInternalFuture<AffinityTopologyVersion> affinityReadyFuture(AffinityTopologyVersion ver)
ver
- Topology version.null
is future is already completed.public List<GridDhtPartitionsExchangeFuture> exchangeFutures()
public boolean hasPendingExchange()
True
if pending future queue contains exchange task.public boolean hasPendingServerExchange()
True
if pending future queue contains server exchange task.public AffinityTopologyVersion lastAffinityChangedTopologyVersion(AffinityTopologyVersion topVer)
topVer
- Topology version.public boolean lastAffinityChangedTopologyVersion(AffinityTopologyVersion topVer, AffinityTopologyVersion lastAffTopVer)
topVer
- Topology version.lastAffTopVer
- Last topology version before the provided one when affinity was modified.True
if data was modified.public void forceReassign(GridDhtPartitionExchangeId exchId, GridDhtPartitionsExchangeFuture fut)
exchId
- Exchange ID.public IgniteInternalFuture<Boolean> forceRebalance(GridDhtPartitionExchangeId exchId)
exchId
- Exchange ID.public void finishPreloading(AffinityTopologyVersion topVer, int grpId)
topVer
- Topology version.grpId
- Group id.public IgniteInternalFuture<Void> deferStopCachesOnClientReconnect(Collection<GridCacheAdapter> caches)
caches
- Caches to stop.public void scheduleResendPartitions()
public void registerExchangeAwareComponent(PartitionsExchangeAware comp)
comp
- Component to be registered.public void unregisterExchangeAwareComponent(PartitionsExchangeAware comp)
comp
- Component to be registered.public List<PartitionsExchangeAware> exchangeAwareComponents()
public void refreshPartitions(@NotNull @NotNull Collection<CacheGroupContext> grps)
FullMessages
send,
for non coordinator - SingleMessages
sendgrps
- Cache groups for partitions refresh.public void refreshPartitions()
FullMessages
send,
for non coordinator - SingleMessages
sendpublic GridDhtPartitionsFullMessage createPartitionsFullMessage(boolean compress, boolean newCntrMap, @Nullable @Nullable GridDhtPartitionExchangeId exchId, @Nullable @Nullable GridCacheVersion lastVer, @Nullable @Nullable IgniteDhtPartitionHistorySuppliersMap partHistSuppliers, @Nullable @Nullable IgniteDhtPartitionsToReloadMap partsToReload)
compress
- True
if possible to compress message (properly work only if prepareMarshall/
finishUnmarshall methods are called).newCntrMap
- True
if possible to use CachePartitionFullCountersMap
.exchId
- Non-null exchange ID if message is created for exchange.lastVer
- Last version.partHistSuppliers
- Partition history suppliers map.partsToReload
- Partitions to reload map.public GridDhtPartitionsFullMessage createPartitionsFullMessage(boolean compress, boolean newCntrMap, @Nullable @Nullable GridDhtPartitionExchangeId exchId, @Nullable @Nullable GridCacheVersion lastVer, @Nullable @Nullable IgniteDhtPartitionHistorySuppliersMap partHistSuppliers, @Nullable @Nullable IgniteDhtPartitionsToReloadMap partsToReload, Collection<CacheGroupContext> grps)
compress
- True
if possible to compress message (properly work only if prepareMarshall/
finishUnmarshall methods are called).newCntrMap
- True
if possible to use CachePartitionFullCountersMap
.exchId
- Non-null exchange ID if message is created for exchange.lastVer
- Last version.partHistSuppliers
- Partition history suppliers map.partsToReload
- Partitions to reload map.grps
- Selected cache groups.public GridDhtPartitionsSingleMessage createPartitionsSingleMessage(@Nullable @Nullable GridDhtPartitionExchangeId exchangeId, boolean clientOnlyExchange, boolean sndCounters, boolean newCntrMap, ExchangeActions exchActions)
exchangeId
- Exchange ID.clientOnlyExchange
- Client exchange flag.sndCounters
- True
if need send partition update counters.newCntrMap
- True
if possible to use CachePartitionPartialCountersMap
.public GridDhtPartitionsSingleMessage createPartitionsSingleMessage(@Nullable @Nullable GridDhtPartitionExchangeId exchangeId, boolean clientOnlyExchange, boolean sndCounters, boolean newCntrMap, ExchangeActions exchActions, Collection<CacheGroupContext> grps)
exchangeId
- Exchange ID.clientOnlyExchange
- Client exchange flag.sndCounters
- True
if need send partition update counters.newCntrMap
- True
if possible to use CachePartitionPartialCountersMap
.grps
- Selected cache groups.public void onExchangeDone(AffinityTopologyVersion topVer, AffinityTopologyVersion initTopVer, @Nullable @Nullable Throwable err)
topVer
- Exchange result topology version.initTopVer
- Exchange initial version.err
- Error.public void processFullPartitionUpdate(ClusterNode node, GridDhtPartitionsFullMessage msg)
node
- Sender cluster node.msg
- Message.public ExchangeLatchManager latch()
public void dumpDebugInfo(@Nullable @Nullable GridDhtPartitionsExchangeFuture exchFut) throws Exception
exchFut
- Optional current exchange future.Exception
- If failed.public void checkRebalanceState()
public void dumpLongRunningOperations(long timeout)
timeout
- Operation timeout.public void mergeExchangesTestWaitVersion(AffinityTopologyVersion exchMergeTestWaitVer, @Nullable @Nullable List mergedEvtsForTest)
exchMergeTestWaitVer
- Version to wait for.mergedEvtsForTest
- List to collect discovery events with merged exchanges.public void rebalanceDelay(long delay)
delay
- Rebalance delay.public AffinityTopologyVersion mergeExchangesTestWaitVersion()
public boolean mergeExchanges(GridDhtPartitionsExchangeFuture curFut, GridDhtPartitionsFullMessage msg) throws IgniteInterruptedCheckedException
curFut
- Current exchange future.msg
- Message.True
if node is stopping.IgniteInterruptedCheckedException
- If interrupted.public boolean mergeExchangesOnCoordinator(GridDhtPartitionsExchangeFuture curFut, @Nullable @Nullable AffinityTopologyVersion threshold)
curFut
- Current active exchange future.False
if need wait messages for merged exchanges.public void exchangerUpdateHeartbeat()
GridWorker.updateHeartbeat()
for exchange worker.public void exchangerBlockingSectionBegin()
GridWorker.blockingSectionBegin()
for exchange worker.
Should be called from exchange worker thread.public void exchangerBlockingSectionEnd()
GridWorker.blockingSectionEnd()
for exchange worker.
Should be called from exchange worker thread.public boolean affinityChanged(AffinityTopologyVersion from, AffinityTopologyVersion to)
public HistogramMetricImpl durationHistogram()
public HistogramMetricImpl blockingDurationHistogram()
public BooleanMetricImpl clusterRebalancedMetric()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021