@GridToStringExclude public class GridDhtPartitionTopologyImpl extends Object implements GridDhtPartitionTopology
| Constructor and Description |
|---|
GridDhtPartitionTopologyImpl(GridCacheSharedContext ctx,
CacheGroupContext grp) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
afterExchange(GridDhtPartitionsExchangeFuture exchFut)
Post-initializes this topology.
|
void |
applyUpdateCounters(Map<Integer,T2<Long,Long>> cntrMap) |
void |
beforeExchange(GridDhtPartitionsExchangeFuture exchFut,
boolean affReady)
Pre-initializes this topology.
|
Iterable<GridDhtLocalPartition> |
currentLocalPartitions() |
boolean |
detectLostPartitions(DiscoveryEvent discoEvt)
Checks if there is at least one owner for each partition in the cache topology.
|
int |
groupId() |
boolean |
hasMovingPartitions() |
void |
initPartitions(GridDhtPartitionsExchangeFuture exchFut) |
GridDhtLocalPartition |
localPartition(int part) |
GridDhtLocalPartition |
localPartition(int p,
AffinityTopologyVersion topVer,
boolean create) |
GridDhtLocalPartition |
localPartition(int p,
AffinityTopologyVersion topVer,
boolean create,
boolean showRenting) |
GridDhtPartitionMap |
localPartitionMap() |
List<GridDhtLocalPartition> |
localPartitions() |
Collection<Integer> |
lostPartitions() |
List<ClusterNode> |
moving(int p) |
List<ClusterNode> |
nodes(int p,
AffinityAssignment affAssignment,
List<ClusterNode> affNodes) |
List<ClusterNode> |
nodes(int p,
AffinityTopologyVersion topVer) |
void |
onCacheStopped(int cacheId) |
void |
onEvicted(GridDhtLocalPartition part,
boolean updateSeq) |
void |
onExchangeDone(AffinityAssignment assignment)
Callback on exchange done.
|
void |
onReconnected() |
void |
onRemoved(GridDhtCacheEntry e) |
boolean |
own(GridDhtLocalPartition part) |
List<ClusterNode> |
owners(int p) |
List<ClusterNode> |
owners(int p,
AffinityTopologyVersion topVer) |
GridDhtPartitionFullMap |
partitionMap(boolean onlyActive) |
GridDhtPartitionMap |
partitions(UUID nodeId) |
GridDhtPartitionState |
partitionState(UUID nodeId,
int part) |
void |
printMemoryStats(int threshold)
Prints memory stats.
|
void |
readLock()
Locks the topology, usually during mapping on locks or transactions.
|
void |
readUnlock()
Unlocks topology locked by
GridDhtPartitionTopology.readLock() method. |
boolean |
rebalanceFinished(AffinityTopologyVersion topVer) |
void |
releasePartitions(int... parts) |
void |
resetLostPartitions()
Resets the state of all LOST partitions to OWNING.
|
Set<UUID> |
setOwners(int p,
Set<UUID> owners,
boolean haveHistory,
boolean updateSeq)
Make nodes from provided set owners for a given partition.
|
boolean |
stopping() |
AffinityTopologyVersion |
topologyVersion()
Topology version.
|
GridDhtTopologyFuture |
topologyVersionFuture()
Gets a future that will be completed when partition exchange map for this
particular topology version is done.
|
boolean |
update(AffinityTopologyVersion exchangeVer,
GridDhtPartitionFullMap partMap,
Map<Integer,T2<Long,Long>> cntrMap,
Set<Integer> partsToReload) |
boolean |
update(GridDhtPartitionExchangeId exchId,
GridDhtPartitionMap parts) |
Map<Integer,T2<Long,Long>> |
updateCounters(boolean skipZeros) |
long |
updateSequence() |
void |
updateTopologyVersion(GridDhtTopologyFuture exchFut,
DiscoCache discoCache,
long updSeq,
boolean stopping)
Updates topology version.
|
public GridDhtPartitionTopologyImpl(GridCacheSharedContext ctx, CacheGroupContext grp)
ctx - Cache shared context.grp - Cache group.public int groupId()
groupId in interface GridDhtPartitionTopologypublic void onReconnected()
public void readLock()
readLock in interface GridDhtPartitionTopologypublic void readUnlock()
GridDhtPartitionTopology.readLock() method.readUnlock in interface GridDhtPartitionTopologypublic void updateTopologyVersion(GridDhtTopologyFuture exchFut, DiscoCache discoCache, long updSeq, boolean stopping) throws IgniteInterruptedCheckedException
updateTopologyVersion in interface GridDhtPartitionTopologyexchFut - Exchange future.discoCache - Discovery data cache.updSeq - Update sequence.stopping - Stopping flag.IgniteInterruptedCheckedException - If interrupted.public AffinityTopologyVersion topologyVersion()
topologyVersion in interface GridDhtPartitionTopologypublic GridDhtTopologyFuture topologyVersionFuture()
topologyVersionFuture in interface GridDhtPartitionTopologypublic boolean stopping()
stopping in interface GridDhtPartitionTopologyTrue if cache is being stopped.public void initPartitions(GridDhtPartitionsExchangeFuture exchFut) throws IgniteInterruptedCheckedException
initPartitions in interface GridDhtPartitionTopologyexchFut - Exchange future.IgniteInterruptedCheckedException - If interrupted.public void beforeExchange(GridDhtPartitionsExchangeFuture exchFut, boolean affReady) throws IgniteCheckedException
beforeExchange in interface GridDhtPartitionTopologyexchFut - Exchange future.affReady - Affinity ready flag.IgniteCheckedException - If failed.public boolean afterExchange(GridDhtPartitionsExchangeFuture exchFut) throws IgniteCheckedException
afterExchange in interface GridDhtPartitionTopologyexchFut - Exchange future.True if mapping was changed.IgniteCheckedException - If failed.@Nullable public GridDhtLocalPartition localPartition(int p, AffinityTopologyVersion topVer, boolean create) throws GridDhtInvalidPartitionException
localPartition in interface GridDhtPartitionTopologyp - Partition ID.topVer - Topology version at the time of creation.create - If true, then partition will be created if it's not there.GridDhtInvalidPartitionException - If partition is evicted or absent and
does not belong to this node.@Nullable public GridDhtLocalPartition localPartition(int p, AffinityTopologyVersion topVer, boolean create, boolean showRenting) throws GridDhtInvalidPartitionException
localPartition in interface GridDhtPartitionTopologyp - Partition ID.topVer - Topology version at the time of creation.create - If true, then partition will be created if it's not there.GridDhtInvalidPartitionException - If partition is evicted or absent and
does not belong to this node.public void releasePartitions(int... parts)
releasePartitions in interface GridDhtPartitionTopologyparts - Partitions to release (should be reserved before).public GridDhtLocalPartition localPartition(int part)
localPartition in interface GridDhtPartitionTopologypart - Partition number.public List<GridDhtLocalPartition> localPartitions()
localPartitions in interface GridDhtPartitionTopologypublic Iterable<GridDhtLocalPartition> currentLocalPartitions()
currentLocalPartitions in interface GridDhtPartitionTopologypublic void onRemoved(GridDhtCacheEntry e)
onRemoved in interface GridDhtPartitionTopologye - Entry removed from cache.public GridDhtPartitionMap localPartitionMap()
localPartitionMap in interface GridDhtPartitionTopologypublic GridDhtPartitionState partitionState(UUID nodeId, int part)
partitionState in interface GridDhtPartitionTopologynodeId - Node ID.part - Partition.@Nullable public List<ClusterNode> nodes(int p, AffinityAssignment affAssignment, List<ClusterNode> affNodes)
nodes in interface GridDhtPartitionTopologyp - Partition ID.affAssignment - Assignments.affNodes - Node assigned for given partition by affinity.public List<ClusterNode> nodes(int p, AffinityTopologyVersion topVer)
nodes in interface GridDhtPartitionTopologyp - Partition ID.topVer - Topology version.public List<ClusterNode> owners(int p, AffinityTopologyVersion topVer)
owners in interface GridDhtPartitionTopologyp - Partition ID.topVer - Topology version.own this partition.public List<ClusterNode> owners(int p)
owners in interface GridDhtPartitionTopologyp - Partition ID.own this partition.public List<ClusterNode> moving(int p)
moving in interface GridDhtPartitionTopologyp - Partition ID.are preloading this partition.public long updateSequence()
updateSequence in interface GridDhtPartitionTopologypublic GridDhtPartitionFullMap partitionMap(boolean onlyActive)
partitionMap in interface GridDhtPartitionTopologyonlyActive - If true, then only active partitions will be returned.public boolean update(@Nullable
AffinityTopologyVersion exchangeVer,
GridDhtPartitionFullMap partMap,
@Nullable
Map<Integer,T2<Long,Long>> cntrMap,
Set<Integer> partsToReload)
update in interface GridDhtPartitionTopologyexchangeVer - Exchange version.partMap - Update partition map.cntrMap - Partition update counters.True if local state was changed.public void applyUpdateCounters(Map<Integer,T2<Long,Long>> cntrMap)
applyUpdateCounters in interface GridDhtPartitionTopologycntrMap - Counters map.public boolean update(@Nullable
GridDhtPartitionExchangeId exchId,
GridDhtPartitionMap parts)
update in interface GridDhtPartitionTopologyexchId - Exchange ID.parts - Partitions.True if local state was changed.public void onExchangeDone(AffinityAssignment assignment)
onExchangeDone in interface GridDhtPartitionTopologyassignment - New affinity assignment.public boolean detectLostPartitions(DiscoveryEvent discoEvt)
This method should be called on topology coordinator after all partition messages are received.
detectLostPartitions in interface GridDhtPartitionTopologydiscoEvt - Discovery event for which we detect lost partitions.True if partitions state got updated.public void resetLostPartitions()
resetLostPartitions in interface GridDhtPartitionTopologypublic Collection<Integer> lostPartitions()
lostPartitions in interface GridDhtPartitionTopologypublic Set<UUID> setOwners(int p, Set<UUID> owners, boolean haveHistory, boolean updateSeq)
setOwners in interface GridDhtPartitionTopologyp - Partition ID.owners - Set of new owners.updateSeq - If should increment sequence when updated.public boolean own(GridDhtLocalPartition part)
own in interface GridDhtPartitionTopologypart - Partition to own.True if owned.public void onEvicted(GridDhtLocalPartition part, boolean updateSeq)
onEvicted in interface GridDhtPartitionTopologypart - Evicted partition.updateSeq - Update sequence increment flag.@Nullable public GridDhtPartitionMap partitions(UUID nodeId)
partitions in interface GridDhtPartitionTopologynodeId - Node to get partitions for.public Map<Integer,T2<Long,Long>> updateCounters(boolean skipZeros)
updateCounters in interface GridDhtPartitionTopologyskipZeros - If true then filters out zero counters.public boolean rebalanceFinished(AffinityTopologyVersion topVer)
rebalanceFinished in interface GridDhtPartitionTopologytopVer - Topology version.True if rebalance process finished.public boolean hasMovingPartitions()
hasMovingPartitions in interface GridDhtPartitionTopologyTrue If one of cache nodes has partitions in GridDhtPartitionState.MOVING state.public void onCacheStopped(int cacheId)
cacheId - Cache ID.public void printMemoryStats(int threshold)
printMemoryStats in interface GridDhtPartitionTopologythreshold - Threshold for number of entries.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017