public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapter implements Comparable<GridDhtPartitionsExchangeFuture>, CachePartitionExchangeWorkerTask, IgniteDiagnosticAware
GridDhtTopologyFutureAdapter.CacheValidation| Modifier and Type | Field and Description |
|---|---|
static String |
EXCHANGE_LOG |
clusterIsActive, grpValidRes| Constructor and Description |
|---|
GridDhtPartitionsExchangeFuture(GridCacheSharedContext cctx,
ReadWriteLock busyLock,
GridDhtPartitionExchangeId exchId,
ExchangeActions exchActions,
CacheAffinityChangeMessage affChangeMsg) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
activateCluster() |
void |
addDiagnosticRequest(IgniteDiagnosticPrepareContext diagCtx) |
boolean |
addOrMergeDelayedFullMessage(ClusterNode node,
GridDhtPartitionsFullMessage fullMsg)
Add or merge updates received from coordinator while exchange in progress.
|
void |
affinityChangeMessage(CacheAffinityChangeMessage affChangeMsg)
Sets affinity change message associated with the exchange.
|
boolean |
cacheAddedOnExchange(int cacheId,
UUID rcvdFrom) |
boolean |
cacheGroupAddedOnExchange(int grpId,
UUID rcvdFrom) |
boolean |
changedBaseline() |
void |
cleanUp()
Cleans up resources to avoid excessive memory usage.
|
int |
compareTo(GridDhtPartitionsExchangeFuture fut) |
ExchangeContext |
context() |
boolean |
dynamicCacheGroupStarted(int grpId) |
boolean |
equals(Object o) |
ExchangeDiscoveryEvents |
events() |
ExchangeActions |
exchangeActions()
Gets exchanges actions (such as cache start or stop) associated with the exchange future.
|
void |
exchangeActions(ExchangeActions exchActions)
Sets exchange actions associated with the exchange future (such as cache start or stop).
|
boolean |
exchangeDone()
Ready affinity future (
GridCachePartitionExchangeManager.affinityReadyFuture(AffinityTopologyVersion)
is completed before GridFutureAdapter.onDone(Object, Throwable) is called on
GridDhtPartitionsExchangeFuture, it is guaranteed that this method will return true
if affinity ready future is finished. |
GridDhtPartitionExchangeId |
exchangeId() |
boolean |
fastReplyOnSingleMessage(ClusterNode node,
GridDhtPartitionsSingleMessage msg)
Tries to fast reply with
GridDhtPartitionsFullMessage on received single message
in case of exchange future has already completed. |
void |
finishMerged()
Finish merged future to allow GridCachePartitionExchangeManager.ExchangeFutureSet cleanup.
|
DiscoveryEvent |
firstEvent() |
DiscoCache |
firstEventCache() |
void |
forceClientReconnect(ClusterNode node,
GridDhtPartitionsSingleMessage msg)
Method is called on coordinator in situation when initial ExchangeFuture created on client join event was preempted
from exchange history because of IGNITE_EXCHANGE_HISTORY_SIZE property.
|
boolean |
hasCachesToStart() |
int |
hashCode() |
void |
init(boolean newCrd)
Starts activity.
|
AffinityTopologyVersion |
initialVersion()
Gets the affinity topology version for which this exchange was created.
|
boolean |
localJoinExchange() |
boolean |
mergeJoinExchange(GridDhtPartitionsExchangeFuture fut)
Merges this exchange with given one.
|
GridDhtPartitionsSingleMessage |
mergeJoinExchangeOnDone(GridDhtPartitionsExchangeFuture fut) |
Object |
mutex() |
static long |
nextDumpTimeout(int step,
long timeout) |
boolean |
onAdded() |
void |
onAffinityChangeMessage(ClusterNode node,
CacheAffinityChangeMessage msg)
Affinity change message callback, processed from the same thread as
onNodeLeft(org.apache.ignite.cluster.ClusterNode). |
boolean |
onDone(AffinityTopologyVersion res,
Throwable err)
Callback to notify that future is finished.
|
void |
onDynamicCacheChangeFail(ClusterNode node,
DynamicCacheChangeFailureMessage msg)
Cache change failure message callback, processed from the discovery thread.
|
void |
onEvent(GridDhtPartitionExchangeId exchId,
DiscoveryEvent discoEvt,
DiscoCache discoCache)
Event callback.
|
void |
onNodeLeft(ClusterNode node)
Node left callback, processed from the same thread as
onAffinityChangeMessage(org.apache.ignite.cluster.ClusterNode, org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage). |
void |
onReceiveFullMessage(ClusterNode node,
GridDhtPartitionsFullMessage msg) |
void |
onReceivePartitionRequest(ClusterNode node,
GridDhtPartitionsSingleRequest msg) |
void |
onReceiveSingleMessage(ClusterNode node,
GridDhtPartitionsSingleMessage msg)
Processing of received single message.
|
boolean |
partitionChangesInProgress() |
UUID |
partitionHistorySupplier(int grpId,
int partId,
long cntrSince)
Retreives the node which has WAL history since
cntrSince. |
boolean |
reconnectOnError(Throwable e) |
boolean |
serverNodeDiscoveryEvent() |
GridCacheSharedContext |
sharedContext() |
String |
shortInfo() |
boolean |
skipForExchangeMerge() |
AffinityTopologyVersion |
topologyVersion()
Gets result topology version of this future.
|
String |
toString() |
void |
waitAndReplyToNode(UUID nodeId,
GridDhtPartitionsSingleMessage msg) |
validateCache, validateCacheGroupcancel, chain, chain, error, get, get, get, getUninterruptibly, ignoreInterrupts, isCancelled, isDone, isFailed, listen, logger, onCancelled, onDone, onDone, onDone, onDone, reset, resultclone, finalize, getClass, notify, notifyAll, wait, wait, waitcancel, chain, chain, error, get, get, get, getUninterruptibly, isCancelled, isDone, listen, resultpublic static final String EXCHANGE_LOG
public GridDhtPartitionsExchangeFuture(GridCacheSharedContext cctx, ReadWriteLock busyLock, GridDhtPartitionExchangeId exchId, ExchangeActions exchActions, CacheAffinityChangeMessage affChangeMsg)
cctx - Cache context.busyLock - Busy lock.exchId - Exchange ID.exchActions - Cache change requests.affChangeMsg - Affinity change message.public Object mutex()
public GridCacheSharedContext sharedContext()
public boolean skipForExchangeMerge()
skipForExchangeMerge in interface CachePartitionExchangeWorkerTaskFalse if exchange merge should stop if this task is found in exchange worker queue.public ExchangeContext context()
public void exchangeActions(ExchangeActions exchActions)
evtLatch be armed.exchActions - Exchange actions.@Nullable public ExchangeActions exchangeActions()
null (for example, if the exchange is created for topology
change event).public void affinityChangeMessage(CacheAffinityChangeMessage affChangeMsg)
affChangeMsg - Affinity change message.public AffinityTopologyVersion initialVersion()
initialVersion in interface GridDhtTopologyFuturepublic AffinityTopologyVersion topologyVersion()
This method should be called only for finished topology future since result version is not known before exchange finished.
topologyVersion in interface GridDhtTopologyFuture@Nullable public UUID partitionHistorySupplier(int grpId, int partId, long cntrSince)
cntrSince.grpId - Cache group ID.partId - Partition ID.cntrSince - Partition update counter since history supplying is requested.public boolean cacheAddedOnExchange(int cacheId,
UUID rcvdFrom)
cacheId - Cache ID.rcvdFrom - Node ID cache was received from.True if cache was added during this exchange.public boolean cacheGroupAddedOnExchange(int grpId,
UUID rcvdFrom)
grpId - Cache group ID.rcvdFrom - Node ID cache group was received from.True if cache group was added during this exchange.public boolean dynamicCacheGroupStarted(int grpId)
grpId - Cache group ID.True if non-client cache group was added during this exchange.public boolean onAdded()
Truepublic void onEvent(GridDhtPartitionExchangeId exchId, DiscoveryEvent discoEvt, DiscoCache discoCache)
exchId - Exchange ID.discoEvt - Discovery event.discoCache - Discovery data cache.public boolean activateCluster()
True if activate cluster exchange.public boolean changedBaseline()
public boolean hasCachesToStart()
True if there are caches to start.public DiscoveryEvent firstEvent()
public DiscoCache firstEventCache()
public ExchangeDiscoveryEvents events()
public GridDhtPartitionExchangeId exchangeId()
public void init(boolean newCrd)
throws IgniteInterruptedCheckedException
newCrd - True if node become coordinator on this exchange.IgniteInterruptedCheckedException - If interrupted.public boolean localJoinExchange()
True if exchange for local node join.public boolean serverNodeDiscoveryEvent()
True if exchange triggered by server node join or fail.public boolean exchangeDone()
GridCachePartitionExchangeManager.affinityReadyFuture(AffinityTopologyVersion)
is completed before GridFutureAdapter.onDone(Object, Throwable) is called on
GridDhtPartitionsExchangeFuture, it is guaranteed that this method will return true
if affinity ready future is finished.
Also this method returns false for merged exchange futures.
exchangeDone in interface GridDhtTopologyFutureTrue if exchange is finished and result topology version can be used.public void finishMerged()
public boolean onDone(@Nullable
AffinityTopologyVersion res,
@Nullable
Throwable err)
null exception is passed in
the result value will be ignored.onDone in class GridFutureAdapter<AffinityTopologyVersion>res - Optional result.err - Optional error.True if result was set by this call.public void cleanUp()
public boolean mergeJoinExchange(GridDhtPartitionsExchangeFuture fut)
fut - Current exchange to merge with.True if need wait for message from joined server node.@Nullable public GridDhtPartitionsSingleMessage mergeJoinExchangeOnDone(GridDhtPartitionsExchangeFuture fut)
fut - Current future.public void forceClientReconnect(ClusterNode node, GridDhtPartitionsSingleMessage msg)
node - Client node that should try to reconnect to the cluster.msg - Single message received from the client which didn't find original ExchangeFuture.public void onReceiveSingleMessage(ClusterNode node, GridDhtPartitionsSingleMessage msg)
initDone()node - Sender node.msg - Single partition info.public boolean fastReplyOnSingleMessage(ClusterNode node, GridDhtPartitionsSingleMessage msg)
GridDhtPartitionsFullMessage on received single message
in case of exchange future has already completed.node - Cluster node which sent single message.msg - Single message.true if fast reply succeed.public void waitAndReplyToNode(UUID nodeId, GridDhtPartitionsSingleMessage msg)
nodeId - Node ID.msg - Client's message.public void onReceiveFullMessage(ClusterNode node, GridDhtPartitionsFullMessage msg)
node - Sender node.msg - Full partition info.public void onReceivePartitionRequest(ClusterNode node, GridDhtPartitionsSingleRequest msg)
node - Sender node.msg - Message with full partition info.public void onDynamicCacheChangeFail(ClusterNode node, DynamicCacheChangeFailureMessage msg)
node - Message sender node.msg - Failure message.public void onAffinityChangeMessage(ClusterNode node, CacheAffinityChangeMessage msg)
onNodeLeft(org.apache.ignite.cluster.ClusterNode).node - Message sender node.msg - Message.public void onNodeLeft(ClusterNode node)
onAffinityChangeMessage(org.apache.ignite.cluster.ClusterNode, org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage).node - Left node.public boolean reconnectOnError(Throwable e)
e - Exception.True if local node should try reconnect in case of error.public boolean partitionChangesInProgress()
True If partition changes triggered by receiving Single/Full messages are not finished yet.public boolean addOrMergeDelayedFullMessage(ClusterNode node, GridDhtPartitionsFullMessage fullMsg)
fullMsg - Full message with exchangeId = null.True if message should be ignored and processed after exchange is done.public int compareTo(GridDhtPartitionsExchangeFuture fut)
compareTo in interface Comparable<GridDhtPartitionsExchangeFuture>public void addDiagnosticRequest(IgniteDiagnosticPrepareContext diagCtx)
addDiagnosticRequest in interface IgniteDiagnosticAwarediagCtx - Context.public String shortInfo()
public String toString()
toString in class GridFutureAdapter<AffinityTopologyVersion>public static long nextDumpTimeout(int step,
long timeout)
step - Exponent coefficient.timeout - Base timeout.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.5 Release Date : June 4 2019