org.apache.ignite.internal.processors.cache.distributed.dht.preloader

## 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 all `GridDhtPartitionsSingleMessage`s were received.
May be also compacted as part of `CacheAffinityChangeMessage` for 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 and Description
`GridDhtPartitionsFullMessage()` Required by `Externalizable`.
`GridDhtPartitionsFullMessage(@Nullable GridDhtPartitionExchangeId id, @Nullable GridCacheVersion lastVer, @NotNull AffinityTopologyVersion topVer, @Nullable IgniteDhtPartitionHistorySuppliersMap partHistSuppliers, @Nullable IgniteDhtPartitionsToReloadMap partsToReload)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addFullPartitionsMap(int grpId, GridDhtPartitionFullMap fullMap, @Nullable Integer dupDataCache)`
`void` `addPartitionUpdateCounters(int grpId, CachePartitionFullCountersMap cntrMap)`
`void` `addPartitionUpdateCounters(int grpId, Map<Integer,T2<Long,Long>> cntrMap)`
`void` `cleanUp()` Cleans up resources to avoid excessive memory usage.
`boolean` `containsGroup(int grpId)`
`short` `directType()` Gets message type.
`byte` `fieldsCount()` Gets fields count.
`void` `finishUnmarshal(GridCacheSharedContext ctx, ClassLoader ldr)` This method is called after the message is deserialized and is responsible for unmarshalling state marshalled in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.
`int` `handlerId()`
`@Nullable Map<Integer,CacheGroupAffinityMessage>` `idealAffinityDiff()`
`@Nullable Map<Integer,CacheGroupAffinityMessage>` `joinedNodeAffinity()`
`void` `merge(GridDhtPartitionsFullMessage other, GridDiscoveryManager discovery)` Merges (replaces with newer) partitions map from given `other` full message.
`IgniteDhtPartitionHistorySuppliersMap` `partitionHistorySuppliers()`
`Map<Integer,GridDhtPartitionFullMap>` `partitions()`
`Map<Integer,Map<Integer,Long>>` `partitionSizes(GridCacheSharedContext ctx)` Returns partition sizes map for all cache groups.
`void` `partitionSizes(GridCacheSharedContext ctx, Map<Integer,Map<Integer,Long>> partsSizes)` Supplies partition sizes map for all cache groups.
`CachePartitionFullCountersMap` `partitionUpdateCounters(int grpId, int partsCnt)`
`Set<Integer>` `partsToReload(UUID nodeId, int grpId)`
`void` `prepareMarshal(GridCacheSharedContext ctx)` This method is called before the whole message is serialized and is responsible for pre-marshalling state.
`boolean` `readFrom(ByteBuffer buf, MessageReader reader)` Reads this message from provided byte buffer.
`boolean` `rebalanced()` Rebalance finished.
`void` `rebalanced(boolean rebalanced)`
`AffinityTopologyVersion` `resultTopologyVersion()`
`void` `resultTopologyVersion(AffinityTopologyVersion resTopVer)`
`AffinityTopologyVersion` `topologyVersion()` Gets topology version or -1 in case of topology version is not required for this message.
`void` `topologyVersion(AffinityTopologyVersion topVer)`
`String` `toString()`
`boolean` `writeTo(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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### GridDhtPartitionsFullMessage

    public GridDhtPartitionsFullMessage()

Required by `Externalizable`.

#### 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 be `AffinityTopologyVersion.NONE`.
  `partHistSuppliers` -
  `partsToReload` -

### Method Detail

#### 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:
  `handlerId` in class `GridCacheMessage`
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:
  `True` if 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.

#### 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()

#### partsToReload

    public Set<Integer> partsToReload(UUID nodeId,
                                      int grpId)

#### 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` - `True` if 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:
  `prepareMarshal` in class `GridCacheMessage`
Parameters:
  `ctx` - Cache context.
Throws:
  `IgniteCheckedException` - If failed.

#### topologyVersion

    public AffinityTopologyVersion topologyVersion()

Description copied from class: `GridCacheMessage`
Gets topology version or -1 in case of topology version is not required for this message.

Overrides:
  `topologyVersion` in class `GridCacheMessage`
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 in `GridCacheMessage.prepareMarshal(GridCacheSharedContext)` method.

Overrides:
  `finishUnmarshal` in class `GridCacheMessage`
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:
  `writeTo` in interface `Message`
Overrides:
  `writeTo` in class `GridDhtPartitionsAbstractMessage`
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:
  `readFrom` in interface `Message`
Overrides:
  `readFrom` in class `GridDhtPartitionsAbstractMessage`
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:
  `fieldsCount` in interface `Message`
Overrides:
  `fieldsCount` in class `GridDhtPartitionsAbstractMessage`
Returns:
  Fields count.

#### toString

    public String toString()

Overrides:
  `toString` in class `GridDhtPartitionsAbstractMessage`

#### merge

    public void merge(GridDhtPartitionsFullMessage other,
                      GridDiscoveryManager discovery)

Merges (replaces with newer) partitions map from given `other` full message.

Parameters:
  `other` - Other full message.

#### cleanUp

    public void cleanUp()

Cleans up resources to avoid excessive memory usage.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.8.1
Release Date | : May 21 2020