Class GridDhtPartitionsSingleMessage
- 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.GridDhtPartitionsSingleMessage
-
- All Implemented Interfaces:
Serializable,Message
public class GridDhtPartitionsSingleMessage extends GridDhtPartitionsAbstractMessage
Information about partitions of a single node.
Sent in response toGridDhtPartitionsSingleRequestand during processing partitions exchange future.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionsAbstractMessage
flags
-
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 GridDhtPartitionsSingleMessage()Required byExternalizable.GridDhtPartitionsSingleMessage(GridDhtPartitionExchangeId exchId, boolean client, @Nullable GridCacheVersion lastVer, boolean compress)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLocalPartitionMap(int cacheId, GridDhtPartitionMap locMap, @Nullable Integer dupDataCache)voidaddPartitionSizes(int grpId, Map<Integer,Long> partSizesMap)Adds partition sizes map for specifiedgrpIdto the current message.voidaddPartitionUpdateCounters(int grpId, Object cntrMap)@Nullable Collection<Integer>cacheGroupsAffinityRequest()booleanclient()shortdirectType()Gets message type.longexchangeStartTime()Start time of exchange on node which sent this message.voidexchangeStartTime(long exchangeStartTime)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.@Nullable ExceptiongetError()inthandlerId()voidpartitionHistoryCounters(int grpId, Map<Integer,Long> cntrMap)Map<Integer,GridDhtPartitionMap>partitions()Map<Integer,Long>partitionSizes(int grpId)Returns partition sizes map for specifiedgrpId.CachePartitionPartialCountersMappartitionUpdateCounters(int grpId, int partsCnt)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.voidsetError(Exception ex)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, topologyVersion, transferExpiryPolicy, unmarshalCollection, unmarshalInfo, unmarshalInfos, unmarshalInvokeArguments, unmarshalTx
-
-
-
-
Constructor Detail
-
GridDhtPartitionsSingleMessage
public GridDhtPartitionsSingleMessage()
Required byExternalizable.
-
GridDhtPartitionsSingleMessage
public GridDhtPartitionsSingleMessage(GridDhtPartitionExchangeId exchId, boolean client, @Nullable @Nullable GridCacheVersion lastVer, boolean compress)
- Parameters:
exchId- Exchange ID.client- Client message flag.lastVer- Last version.compress-Trueif it is possible to use compression for message.
-
-
Method Detail
-
cacheGroupsAffinityRequest
@Nullable public @Nullable Collection<Integer> cacheGroupsAffinityRequest()
- Returns:
- Cache groups to get affinity for (affinity is requested when node joins cluster).
-
handlerId
public int handlerId()
- Specified by:
handlerIdin classGridCacheMessage- Returns:
- ID to distinguish message handlers for the same messages but for different caches/cache groups.
-
client
public boolean client()
- Returns:
Trueif sent from client node.
-
addLocalPartitionMap
public void addLocalPartitionMap(int cacheId, GridDhtPartitionMap locMap, @Nullable @Nullable Integer dupDataCache)- Parameters:
cacheId- Cache ID to add local partition for.locMap- Local partition map.dupDataCache- Optional ID of cache with the same partition state map.
-
addPartitionUpdateCounters
public void addPartitionUpdateCounters(int grpId, Object cntrMap)- Parameters:
grpId- Cache group ID.cntrMap- Partition update counters.
-
partitionUpdateCounters
public CachePartitionPartialCountersMap partitionUpdateCounters(int grpId, int partsCnt)
- Parameters:
grpId- Cache group ID.partsCnt- Total cache partitions.- Returns:
- Partition update counters.
-
addPartitionSizes
public void addPartitionSizes(int grpId, Map<Integer,Long> partSizesMap)Adds partition sizes map for specifiedgrpIdto the current message.- Parameters:
grpId- Group id.partSizesMap- Partition sizes map.
-
partitionSizes
public Map<Integer,Long> partitionSizes(int grpId)
Returns partition sizes map for specifiedgrpId.- Parameters:
grpId- Group id.- Returns:
- Partition sizes map (partId, partSize).
-
partitionHistoryCounters
public void partitionHistoryCounters(int grpId, Map<Integer,Long> cntrMap)- Parameters:
grpId- Cache group ID.cntrMap- Partition history counters.
-
partitions
public Map<Integer,GridDhtPartitionMap> partitions()
- Returns:
- Local partitions.
-
setError
public void setError(Exception ex)
- Parameters:
ex- Exception.
-
getError
@Nullable public @Nullable Exception getError()
- Returns:
- Not null exception if exchange processing failed.
-
exchangeStartTime
public long exchangeStartTime()
Start time of exchange on node which sent this message.
-
exchangeStartTime
public void exchangeStartTime(long exchangeStartTime)
- Parameters:
exchangeStartTime- Start time of exchange.
-
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.
-
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
-
-