Class CacheGroupAffinityMessage
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.distributed.dht.preloader.CacheGroupAffinityMessage
-
- All Implemented Interfaces:
Serializable,Message
public class CacheGroupAffinityMessage extends Object implements Message
Information about affinity assignment.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.ignite.plugin.extensions.communication.Message
DIRECT_TYPE_SIZE
-
-
Constructor Summary
Constructors Constructor Description CacheGroupAffinityMessage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<Integer,GridLongList>assignmentsDiff()static Map<Integer,CacheGroupAffinityMessage>createAffinityDiffMessages(Map<Integer,Map<Integer,List<Long>>> affDiff)List<List<ClusterNode>>createAssignments(Map<Long,ClusterNode> nodesByOrder, DiscoCache discoCache)@Nullable List<List<ClusterNode>>createIdealAssignments(Map<Long,ClusterNode> nodesByOrder, DiscoCache discoCache)shortdirectType()Gets message type.bytefieldsCount()Gets fields count.voidonAckReceived()Method called when ack message received.booleanreadFrom(ByteBuffer buf, MessageReader reader)Reads this message from provided byte buffer.static List<ClusterNode>toNodes(GridLongList assign, Map<Long,ClusterNode> nodesByOrder, DiscoCache discoCache)StringtoString()booleanwriteTo(ByteBuffer buf, MessageWriter writer)Writes this message to provided byte buffer.
-
-
-
Method Detail
-
createAffinityDiffMessages
public static Map<Integer,CacheGroupAffinityMessage> createAffinityDiffMessages(Map<Integer,Map<Integer,List<Long>>> affDiff)
- Parameters:
affDiff- Affinity diff.- Returns:
- Affinity diff messages.
-
toNodes
public static List<ClusterNode> toNodes(GridLongList assign, Map<Long,ClusterNode> nodesByOrder, DiscoCache discoCache)
- Parameters:
assign- Nodes orders.nodesByOrder- Nodes by order cache.discoCache- Discovery data cache.- Returns:
- Nodes list.
-
createIdealAssignments
@Nullable public @Nullable List<List<ClusterNode>> createIdealAssignments(Map<Long,ClusterNode> nodesByOrder, DiscoCache discoCache)
- Parameters:
nodesByOrder- Nodes by order cache.discoCache- Discovery data cache.- Returns:
- Nodes list.
-
createAssignments
public List<List<ClusterNode>> createAssignments(Map<Long,ClusterNode> nodesByOrder, DiscoCache discoCache)
- Parameters:
nodesByOrder- Nodes by order cache.discoCache- Discovery data cache.- Returns:
- Assignments.
-
assignmentsDiff
public Map<Integer,GridLongList> assignmentsDiff()
- Returns:
- Difference with ideal affinity assignment.
-
writeTo
public boolean writeTo(ByteBuffer buf, MessageWriter writer)
Writes this message to provided byte buffer.
-
readFrom
public boolean readFrom(ByteBuffer buf, MessageReader reader)
Reads this message from provided byte buffer.
-
directType
public short directType()
Gets message type.- Specified by:
directTypein interfaceMessage- Returns:
- Message type.
-
fieldsCount
public byte fieldsCount()
Gets fields count.- Specified by:
fieldsCountin interfaceMessage- Returns:
- Fields count.
-
onAckReceived
public void onAckReceived()
Method called when ack message received.- Specified by:
onAckReceivedin interfaceMessage
-
-