Class GridDhtPartitionsFullMessage
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.GridCacheMessage
-
- org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsAbstractMessage
-
- org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsFullMessage
-
- All Implemented Interfaces:
Serializable,Message
public class GridDhtPartitionsFullMessage extends GridDhtPartitionsAbstractMessage
Information about partitions of all nodes in topology.
Is sent by topology coordinator: when allGridDhtPartitionsSingleMessages were received.
May be also compacted as part ofCacheAffinityChangeMessagefor node left or failed case.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage
addDepInfo, CACHE_MSG_INDEX_FIELD_NAME, forceAddDepInfo, MAX_CACHE_MSG_LOOKUP_INDEX
-
Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message
DIRECT_TYPE_SIZE
-
-
Constructor Summary
Constructors Constructor Description GridDhtPartitionsFullMessage()Required byExternalizable.GridDhtPartitionsFullMessage(@Nullable GridDhtPartitionExchangeId id, @Nullable GridCacheVersion lastVer, @NotNull AffinityTopologyVersion topVer, @Nullable IgniteDhtPartitionHistorySuppliersMap partHistSuppliers, @Nullable IgniteDhtPartitionsToReloadMap partsToReload)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFullPartitionsMap(int grpId, GridDhtPartitionFullMap fullMap, @Nullable Integer dupDataCache)voidaddLostPartitions(int grpId, Collection<Integer> lostParts)voidaddPartitionUpdateCounters(int grpId, Map<Integer,T2<Long,Long>> cntrMap)voidaddPartitionUpdateCounters(int grpId, CachePartitionFullCountersMap cntrMap)voidcleanUp()Cleans up resources to avoid excessive memory usage.booleancontainsGroup(int grpId)GridDhtPartitionsFullMessagecopy()shortdirectType()Gets message type.bytefieldsCount()Gets fields count.voidfinishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)This method is called after the message is deserialized and is responsible for unmarshalling state marshalled inGridCacheMessage.prepareMarshal(GridCacheSharedContext)method.inthandlerId()@Nullable Map<Integer,CacheGroupAffinityMessage>idealAffinityDiff()@Nullable Map<Integer,CacheGroupAffinityMessage>joinedNodeAffinity()@Nullable Set<Integer>lostPartitions(int grpId)voidmerge(GridDhtPartitionsFullMessage other, GridDiscoveryManager discovery)Merges (replaces with newer) partitions map from givenotherfull message.IgniteDhtPartitionHistorySuppliersMappartitionHistorySuppliers()Map<Integer,GridDhtPartitionFullMap>partitions()Map<Integer,Map<Integer,Long>>partitionSizes(GridCacheSharedContext ctx)Returns partition sizes map for all cache groups.voidpartitionSizes(GridCacheSharedContext ctx, Map<Integer,Map<Integer,Long>> partsSizes)Supplies partition sizes map for all cache groups.CachePartitionFullCountersMappartitionUpdateCounters(int grpId, int partsCnt)Set<Integer>partsToReload(UUID nodeId, int grpId)voidprepareMarshal(GridCacheSharedContext ctx)This method is called before the whole message is serialized and is responsible for pre-marshalling state.booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.booleanrebalanced()Rebalance finished.voidrebalanced(boolean rebalanced)AffinityTopologyVersionresultTopologyVersion()voidresultTopologyVersion(AffinityTopologyVersion resTopVer)AffinityTopologyVersiontopologyVersion()Gets topology version or -1 in case of topology version is not required for this message.voidtopologyVersion(AffinityTopologyVersion topVer)StringtoString()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.-
Methods inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsAbstractMessage
addDeploymentInfo, cacheGroupMessage, compressed, compressed, exchangeId, exchangeId, lastVersion, partition, partitionExchangeMessage, restoreState
-
Methods inherited from class org.apache.ignite.internal.processors.cache.GridCacheMessage
appendFlag, classError, deployInfo, error, finishUnmarshalCacheObjects, finishUnmarshalCacheObjects, ignoreClassErrors, lastAffinityChangedTopologyVersion, lastAffinityChangedTopologyVersion, lookupIndex, marshalCollection, marshalInfo, marshalInfos, marshalInvokeArguments, marshalTx, messageId, messageLogger, nextIndexId, onAckReceived, onClassError, prepare, prepareMarshalCacheObject, prepareMarshalCacheObjects, prepareMarshalCacheObjects, prepareObject, prepareObject, transferExpiryPolicy, unmarshalCollection, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx
-
-
-
-
Constructor Detail
-
GridDhtPartitionsFullMessage
public GridDhtPartitionsFullMessage()
Required byExternalizable.
-
GridDhtPartitionsFullMessage
public GridDhtPartitionsFullMessage(@Nullable @Nullable GridDhtPartitionExchangeId id, @Nullable @Nullable GridCacheVersion lastVer, @NotNull @NotNull AffinityTopologyVersion topVer, @Nullable @Nullable IgniteDhtPartitionHistorySuppliersMap partHistSuppliers, @Nullable @Nullable IgniteDhtPartitionsToReloadMap partsToReload)- Parameters:
id- Exchange ID.lastVer- Last version.topVer- Topology version. For messages not related to exchange may beAffinityTopologyVersion.NONE.partHistSuppliers- Suppliers.partsToReload- Partitions to reload.
-
-
Method Detail
-
copy
public GridDhtPartitionsFullMessage copy()
- Returns:
- Message copy.
-
resultTopologyVersion
public void resultTopologyVersion(AffinityTopologyVersion resTopVer)
- Parameters:
resTopVer- Result topology version.
-
resultTopologyVersion
public AffinityTopologyVersion resultTopologyVersion()
- Returns:
- Result topology version.
-
joinedNodeAffinity
@Nullable public @Nullable Map<Integer,CacheGroupAffinityMessage> joinedNodeAffinity()
- Returns:
- Caches affinity for joining nodes.
-
idealAffinityDiff
@Nullable public @Nullable Map<Integer,CacheGroupAffinityMessage> idealAffinityDiff()
- Returns:
- Difference with ideal affinity.
-
handlerId
public int handlerId()
- Specified by:
handlerIdin classGridCacheMessage- Returns:
- ID to distinguish message handlers for the same messages but for different caches/cache groups.
-
partitions
public Map<Integer,GridDhtPartitionFullMap> partitions()
- Returns:
- Local partitions.
-
containsGroup
public boolean containsGroup(int grpId)
- Parameters:
grpId- Cache group ID.- Returns:
Trueif message contains full map for given cache.
-
addFullPartitionsMap
public void addFullPartitionsMap(int grpId, GridDhtPartitionFullMap fullMap, @Nullable @Nullable Integer dupDataCache)- Parameters:
grpId- Cache group ID.fullMap- Full partitions map.dupDataCache- Optional ID of cache with the same partition state map.
-
addPartitionUpdateCounters
public void addPartitionUpdateCounters(int grpId, Map<Integer,T2<Long,Long>> cntrMap)- Parameters:
grpId- Cache group ID.cntrMap- Partition update counters.
-
addPartitionUpdateCounters
public void addPartitionUpdateCounters(int grpId, CachePartitionFullCountersMap cntrMap)- Parameters:
grpId- Cache group ID.cntrMap- Partition update counters.
-
addLostPartitions
public void addLostPartitions(int grpId, Collection<Integer> lostParts)- Parameters:
grpId- Group id.lostParts- Lost parts.
-
lostPartitions
@Nullable public @Nullable Set<Integer> lostPartitions(int grpId)
- Parameters:
grpId- Group id.- Returns:
- Lost partitions for a group.
-
partitionUpdateCounters
public CachePartitionFullCountersMap partitionUpdateCounters(int grpId, int partsCnt)
- Parameters:
grpId- Cache group ID.partsCnt- Total cache partitions.- Returns:
- Partition update counters.
-
partitionHistorySuppliers
public IgniteDhtPartitionHistorySuppliersMap partitionHistorySuppliers()
-
partitionSizes
public void partitionSizes(GridCacheSharedContext ctx, Map<Integer,Map<Integer,Long>> partsSizes)
Supplies partition sizes map for all cache groups.- Parameters:
ctx- Cache context.partsSizes- Partitions sizes map.
-
partitionSizes
public Map<Integer,Map<Integer,Long>> partitionSizes(GridCacheSharedContext ctx)
Returns partition sizes map for all cache groups.- Parameters:
ctx- Cache context.- Returns:
- Partition sizes map (grpId, (partId, partSize)).
-
rebalanced
public boolean rebalanced()
Rebalance finished.
-
rebalanced
public void rebalanced(boolean rebalanced)
- Parameters:
rebalanced-Trueif data is fully rebalanced.
-
prepareMarshal
public void prepareMarshal(GridCacheSharedContext ctx) throws IgniteCheckedException
This method is called before the whole message is serialized and is responsible for pre-marshalling state.- Overrides:
prepareMarshalin classGridCacheMessage- Parameters:
ctx- Cache context.- Throws:
IgniteCheckedException- If failed.
-
topologyVersion
public AffinityTopologyVersion topologyVersion()
Description copied from class:GridCacheMessageGets topology version or -1 in case of topology version is not required for this message.- Overrides:
topologyVersionin classGridCacheMessage- Returns:
- Topology version.
-
topologyVersion
public void topologyVersion(AffinityTopologyVersion topVer)
- Parameters:
topVer- Topology version.
-
finishUnmarshal
public void finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr) throws IgniteCheckedException
This method is called after the message is deserialized and is responsible for unmarshalling state marshalled inGridCacheMessage.prepareMarshal(GridCacheSharedContext)method.- Overrides:
finishUnmarshalin classGridCacheMessage- Parameters:
ctx- Context.ldr- Class loader.- Throws:
IgniteCheckedException- If failed.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.- Specified by:
writeToin interfaceMessage- Overrides:
writeToin classGridDhtPartitionsAbstractMessage- Parameters:
buf- Byte buffer.writer- Writer.- Returns:
- Whether message was fully written.
-
readFrom
public boolean readFrom(ByteBuffer buf, MessageReader reader)
Reads this message from provided byte buffer.- Specified by:
readFromin interfaceMessage- Overrides:
readFromin classGridDhtPartitionsAbstractMessage- Parameters:
buf- Byte buffer.reader- Reader.- Returns:
- Whether message was fully read.
-
directType
public short directType()
Gets message type.- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Overrides:
fieldsCountin classGridDhtPartitionsAbstractMessage- Returns:
- Fields count.
-
toString
public String toString()
- Overrides:
toStringin classGridDhtPartitionsAbstractMessage
-
merge
public void merge(GridDhtPartitionsFullMessage other, GridDiscoveryManager discovery)
Merges (replaces with newer) partitions map from givenotherfull message.- Parameters:
other- Other full message.
-
cleanUp
public void cleanUp()
Cleans up resources to avoid excessive memory usage.
-
-