use of org.apache.ignite.internal.util.GridPartitionStateMap in project ignite by apache.
the class GridDhtPartitionTopologyImpl method localPartitionMap.
/**
* {@inheritDoc}
*/
@Override
public GridDhtPartitionMap localPartitionMap() {
GridPartitionStateMap map = new GridPartitionStateMap(locParts.length());
lock.readLock().lock();
try {
for (int i = 0; i < locParts.length(); i++) {
GridDhtLocalPartition part = locParts.get(i);
if (part == null)
continue;
map.put(i, part.state());
}
GridDhtPartitionMap locPartMap = node2part != null ? node2part.get(ctx.localNodeId()) : null;
return new GridDhtPartitionMap(ctx.localNodeId(), updateSeq.get(), locPartMap != null ? locPartMap.topologyVersion() : readyTopVer, map, true);
} finally {
lock.readLock().unlock();
}
}
use of org.apache.ignite.internal.util.GridPartitionStateMap in project ignite by apache.
the class GridDhtPartitionMap method readExternal.
/**
* {@inheritDoc}
*/
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
nodeId = U.readUuid(in);
updateSeq = in.readLong();
int size = in.readInt();
map = new GridPartitionStateMap();
for (int i = 0; i < size; i++) {
int ordinal = in.readUnsignedByte();
int part = in.readUnsignedShort();
put(part, GridDhtPartitionState.fromOrdinal(ordinal));
}
long ver = in.readLong();
int minorVer = in.readInt();
if (ver != 0)
top = new AffinityTopologyVersion(ver, minorVer);
}
Aggregations