Class GridDhtPartitionMap
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.distributed.dht.preloader.GridDhtPartitionMap
-
- All Implemented Interfaces:
Externalizable,Serializable,Comparable<GridDhtPartitionMap>
public class GridDhtPartitionMap extends Object implements Comparable<GridDhtPartitionMap>, Externalizable
Partition map from single node.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected GridPartitionStateMapmapprotected UUIDnodeIdNode ID.protected AffinityTopologyVersiontopTopology version.protected longupdateSeqUpdate sequence number.
-
Constructor Summary
Constructors Constructor Description GridDhtPartitionMap()Empty constructor required forExternalizable.GridDhtPartitionMap(UUID nodeId, long updateSeq, AffinityTopologyVersion top, GridPartitionStateMap m, boolean onlyActive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(GridDhtPartitionMap o)booleancontainsKey(Integer part)GridDhtPartitionMapemptyCopy()Set<Map.Entry<Integer,GridDhtPartitionState>>entrySet()booleanequals(Object o)GridDhtPartitionStateget(int part)inthashCode()booleanhasMovingPartitions()Set<Integer>keySet()GridPartitionStateMapmap()UUIDnodeId()voidput(Integer part, GridDhtPartitionState state)voidreadExternal(ObjectInput in)intsize()StringtoFullString()AffinityTopologyVersiontopologyVersion()StringtoString()longupdateSequence()longupdateSequence(long updateSeq, AffinityTopologyVersion topVer)voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
nodeId
protected UUID nodeId
Node ID.
-
updateSeq
protected long updateSeq
Update sequence number.
-
top
protected AffinityTopologyVersion top
Topology version.
-
map
protected GridPartitionStateMap map
-
-
Constructor Detail
-
GridDhtPartitionMap
public GridDhtPartitionMap()
Empty constructor required forExternalizable.
-
GridDhtPartitionMap
public GridDhtPartitionMap(UUID nodeId, long updateSeq, AffinityTopologyVersion top, GridPartitionStateMap m, boolean onlyActive)
- Parameters:
nodeId- Node ID.updateSeq- Update sequence number.top- Topology version.m- Map to copy.onlyActive- Iftrue, then only active states will be included.
-
-
Method Detail
-
emptyCopy
public GridDhtPartitionMap emptyCopy()
- Returns:
- Copy with empty partition state map.
-
put
public void put(Integer part, GridDhtPartitionState state)
- Parameters:
part- Partition.state- Partition state.
-
hasMovingPartitions
public boolean hasMovingPartitions()
- Returns:
trueIf partition map contains moving partitions.
-
get
public GridDhtPartitionState get(int part)
- Parameters:
part- Partition.- Returns:
- Partition state.
-
containsKey
public boolean containsKey(Integer part)
- Parameters:
part- Partition.- Returns:
Trueif contains given partition.
-
entrySet
public Set<Map.Entry<Integer,GridDhtPartitionState>> entrySet()
- Returns:
- Entries.
-
size
public int size()
- Returns:
- Map size.
-
map
public GridPartitionStateMap map()
- Returns:
- Underlying map.
-
nodeId
public UUID nodeId()
- Returns:
- Node ID.
-
updateSequence
public long updateSequence()
- Returns:
- Update sequence.
-
updateSequence
public long updateSequence(long updateSeq, AffinityTopologyVersion topVer)- Parameters:
updateSeq- New update sequence value.topVer- Current topology version.- Returns:
- Old update sequence value.
-
topologyVersion
public AffinityTopologyVersion topologyVersion()
- Returns:
- Topology version.
-
compareTo
public int compareTo(GridDhtPartitionMap o)
- Specified by:
compareToin interfaceComparable<GridDhtPartitionMap>
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
toFullString
public String toFullString()
- Returns:
- Full string representation.
-
-