Class CacheAffinityChangeMessage
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.CacheAffinityChangeMessage
-
- All Implemented Interfaces:
Serializable,DiscoveryCustomMessage
public class CacheAffinityChangeMessage extends Object implements DiscoveryCustomMessage
CacheAffinityChangeMessage represent a message that switches to a new affinity assignmentafter rebalance is finished. This message should not be mutated in any way outside the "disco-notifier-worker" thread.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CacheAffinityChangeMessage(AffinityTopologyVersion topVer, Map<Integer,IgniteUuid> cacheDeploymentIds)Constructor used when message is created after cache rebalance finished.CacheAffinityChangeMessage(GridDhtPartitionExchangeId exchId, GridDhtPartitionsFullMessage partsMsg, Map<Integer,Map<Integer,List<UUID>>> assignmentChange)Constructor used when message is created to finish exchange.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable DiscoveryCustomMessageackMessage()Called when custom message has been handled by all nodes.@Nullable Map<Integer,Map<Integer,List<UUID>>>assignmentChange()Map<Integer,IgniteUuid>cacheDeploymentIds()@Nullable DiscoCachecreateDiscoCache(GridDiscoveryManager mgr, AffinityTopologyVersion topVer, DiscoCache discoCache)Creates new discovery cache if message caused topology version change.@Nullable GridDhtPartitionExchangeIdexchangeId()booleanexchangeNeeded()voidexchangeNeeded(boolean exchangeNeeded)IgniteUuidid()booleanisMutable()GridDhtPartitionsFullMessagepartitionsMessage()booleanstopProcess()voidstopProcess(boolean stopProc)Sets stop processing flag.AffinityTopologyVersiontopologyVersion()StringtoString()
-
-
-
Constructor Detail
-
CacheAffinityChangeMessage
public CacheAffinityChangeMessage(AffinityTopologyVersion topVer, Map<Integer,IgniteUuid> cacheDeploymentIds)
Constructor used when message is created after cache rebalance finished.- Parameters:
topVer- Topology version.cacheDeploymentIds- Cache deployment ID.
-
CacheAffinityChangeMessage
public CacheAffinityChangeMessage(GridDhtPartitionExchangeId exchId, GridDhtPartitionsFullMessage partsMsg, Map<Integer,Map<Integer,List<UUID>>> assignmentChange)
Constructor used when message is created to finish exchange.- Parameters:
exchId- Exchange ID.partsMsg- Partitions messages.assignmentChange- Assignment change.
-
-
Method Detail
-
cacheDeploymentIds
public Map<Integer,IgniteUuid> cacheDeploymentIds()
- Returns:
- Cache deployment IDs.
-
exchangeNeeded
public boolean exchangeNeeded()
- Returns:
Trueif request should trigger partition exchange.
-
exchangeNeeded
public void exchangeNeeded(boolean exchangeNeeded)
- Parameters:
exchangeNeeded-Trueif request should trigger partition exchange.
-
partitionsMessage
public GridDhtPartitionsFullMessage partitionsMessage()
- Returns:
- Partitions message.
-
assignmentChange
@Nullable public @Nullable Map<Integer,Map<Integer,List<UUID>>> assignmentChange()
- Returns:
- Affinity assignments.
-
exchangeId
@Nullable public @Nullable GridDhtPartitionExchangeId exchangeId()
- Returns:
- Exchange version.
-
topologyVersion
public AffinityTopologyVersion topologyVersion()
- Returns:
- Topology version.
-
id
public IgniteUuid id()
- Specified by:
idin interfaceDiscoveryCustomMessage- Returns:
- Unique custom message ID.
-
ackMessage
@Nullable public @Nullable DiscoveryCustomMessage ackMessage()
Called when custom message has been handled by all nodes.- Specified by:
ackMessagein interfaceDiscoveryCustomMessage- Returns:
- Ack message or
nullif ack is not required.
-
isMutable
public boolean isMutable()
- Specified by:
isMutablein interfaceDiscoveryCustomMessage- Returns:
Trueif message can be modified during listener notification. Changes will be sent to next nodes.
-
stopProcess
public boolean stopProcess()
- Specified by:
stopProcessin interfaceDiscoveryCustomMessage- Returns:
Trueif message should not be sent to others nodes after it was processed on coordinator.
-
stopProcess
public void stopProcess(boolean stopProc)
Sets stop processing flag. If this flag istruethen this message is not passed to other nodes after the coordinator node notitied its own listner. If methodackMessage()returns non-null ack message, it is sent to all nodes. This flag is used when discovery SPI does not support mutable custom messages. SeeDiscoverySpiMutableCustomMessageSupport.- Parameters:
stopProc- Iftruethen this message is not passed to other nodes.
-
createDiscoCache
@Nullable public @Nullable DiscoCache createDiscoCache(GridDiscoveryManager mgr, AffinityTopologyVersion topVer, DiscoCache discoCache)
Creates new discovery cache if message caused topology version change.- Specified by:
createDiscoCachein interfaceDiscoveryCustomMessage- Parameters:
mgr- Discovery manager.topVer- New topology version.discoCache- Current discovery cache.- Returns:
- Reused discovery cache.
-
-