@GridToStringExclude public interface GridDhtPartitionTopology
| Modifier and Type | Method and Description |
|---|---|
boolean |
afterExchange(GridDhtPartitionsExchangeFuture exchFut)
Post-initializes this topology.
|
void |
afterStateRestored(AffinityTopologyVersion topVer)
Initializes local data structures after partitions are restored from persistence.
|
List<List<ClusterNode>> |
allOwners() |
void |
applyUpdateCounters()
Applies update counters collected during exchange on coordinator.
|
void |
beforeExchange(GridDhtPartitionsExchangeFuture exchFut,
boolean affReady,
boolean updateMoving)
Pre-initializes this topology.
|
void |
collectUpdateCounters(CachePartitionPartialCountersMap cntrMap)
Collects update counters collected during exchange.
|
Iterable<GridDhtLocalPartition> |
currentLocalPartitions() |
boolean |
detectLostPartitions(AffinityTopologyVersion resTopVer,
GridDhtPartitionsExchangeFuture fut)
Checks if there is at least one owner for each partition in the cache topology for a local node.
|
void |
finalizeUpdateCounters(Set<Integer> parts)
Pre-processes partition update counters before exchange.
|
GridDhtLocalPartition |
forceCreatePartition(int p)
Unconditionally creates partition during restore of persisted partition state.
|
CachePartitionFullCountersMap |
fullUpdateCounters() |
Map<Integer,Long> |
globalPartSizes() |
void |
globalPartSizes(@Nullable Map<Integer,Long> partSizes) |
int |
groupId() |
boolean |
hasMovingPartitions() |
boolean |
holdsLock() |
boolean |
initialized() |
boolean |
initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer,
GridDhtPartitionsExchangeFuture exchFut) |
AffinityTopologyVersion |
lastTopologyChangeVersion() |
@Nullable GridDhtLocalPartition |
localPartition(int part) |
@Nullable GridDhtLocalPartition |
localPartition(int p,
AffinityTopologyVersion topVer,
boolean create) |
@Nullable GridDhtLocalPartition |
localPartition(int p,
AffinityTopologyVersion topVer,
boolean create,
boolean showRenting) |
GridDhtPartitionMap |
localPartitionMap() |
List<GridDhtLocalPartition> |
localPartitions() |
CachePartitionPartialCountersMap |
localUpdateCounters(boolean skipZeros) |
Set<Integer> |
lostPartitions() |
List<ClusterNode> |
moving(int p) |
@Nullable List<ClusterNode> |
nodes(int p,
AffinityAssignment affAssignment,
List<ClusterNode> affNodes) |
List<ClusterNode> |
nodes(int p,
AffinityTopologyVersion topVer) |
void |
onEvicted(GridDhtLocalPartition part,
boolean updateSeq) |
void |
onExchangeDone(GridDhtPartitionsExchangeFuture fut,
AffinityAssignment assignment,
boolean updateRebalanceVer)
Callback on exchange done.
|
void |
onRemoved(GridDhtCacheEntry e) |
boolean |
own(GridDhtLocalPartition part) |
List<ClusterNode> |
owners(int p) |
List<ClusterNode> |
owners(int p,
AffinityTopologyVersion topVer) |
void |
ownMoving(AffinityTopologyVersion rebFinishedTopVer)
Owns all moving partitions for the given topology version.
|
GridDhtPartitionFullMap |
partitionMap(boolean onlyActive) |
int |
partitions() |
@Nullable GridDhtPartitionMap |
partitions(UUID nodeId) |
Map<Integer,Long> |
partitionSizes() |
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
readLock() method. |
AffinityTopologyVersion |
readyTopologyVersion() |
boolean |
rebalanceFinished(AffinityTopologyVersion topVer) |
void |
releasePartitions(int... parts) |
void |
resetLostPartitions(AffinityTopologyVersion resTopVer)
Resets the state of all LOST partitions to OWNING.
|
Map<UUID,Set<Integer>> |
resetOwners(Map<Integer,Set<UUID>> ownersByUpdCounters,
Set<Integer> haveHist,
GridDhtPartitionsExchangeFuture exchFut)
Calculates nodes and partitions which have non-actual state (based on LWM value) and must be rebalanced.
|
boolean |
stopping() |
GridDhtTopologyFuture |
topologyVersionFuture()
Gets a future that will be completed when partition exchange map for this
particular topology version is done.
|
boolean |
update(@Nullable AffinityTopologyVersion exchangeResVer,
GridDhtPartitionFullMap partMap,
@Nullable CachePartitionFullCountersMap cntrMap,
Set<Integer> partsToReload,
@Nullable Map<Integer,Long> partSizes,
@Nullable AffinityTopologyVersion msgTopVer,
@Nullable GridDhtPartitionsExchangeFuture exchFut,
@Nullable Set<Integer> lostParts) |
boolean |
update(@Nullable GridDhtPartitionExchangeId exchId,
GridDhtPartitionMap parts,
boolean force) |
long |
updateSequence() |
void |
updateTopologyVersion(GridDhtTopologyFuture exchFut,
DiscoCache discoCache,
long updateSeq,
boolean stopping)
Updates topology version.
|
int partitions()
void readLock()
void readUnlock()
readLock() method.boolean holdsLock()
True if locked by current thread.void updateTopologyVersion(GridDhtTopologyFuture exchFut, DiscoCache discoCache, long updateSeq, boolean stopping) throws IgniteInterruptedCheckedException
exchFut - Exchange future.discoCache - Discovery data cache.updateSeq - Update sequence.stopping - Stopping flag.IgniteInterruptedCheckedException - If interrupted.boolean initialized()
True If ready version initialized. False If not initialized.AffinityTopologyVersion readyTopologyVersion()
AffinityTopologyVersion lastTopologyChangeVersion()
GridDhtTopologyFuture topologyVersionFuture()
boolean stopping()
True if cache is being stopped.int groupId()
void beforeExchange(GridDhtPartitionsExchangeFuture exchFut, boolean affReady, boolean updateMoving) throws IgniteCheckedException
exchFut - Exchange future.affReady - Affinity ready flag.updateMoving - True to initialize partition maps with moving partitions.IgniteCheckedException - If failed.boolean initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer, GridDhtPartitionsExchangeFuture exchFut) throws IgniteInterruptedCheckedException
affVer - Affinity version.exchFut - Exchange future.True if partitions must be refreshed.IgniteInterruptedCheckedException - If interrupted.void afterStateRestored(AffinityTopologyVersion topVer)
topVer - Topology version.boolean afterExchange(GridDhtPartitionsExchangeFuture exchFut) throws IgniteCheckedException
exchFut - Exchange future.True if mapping was changed.IgniteCheckedException - If failed.@Nullable @Nullable GridDhtLocalPartition localPartition(int p, AffinityTopologyVersion topVer, boolean create) throws GridDhtInvalidPartitionException
topVer - Topology version at the time of creation.p - Partition ID.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.GridDhtLocalPartition forceCreatePartition(int p) throws IgniteCheckedException
p - Partition ID.IgniteCheckedException - If failed.@Nullable @Nullable GridDhtLocalPartition localPartition(int p, AffinityTopologyVersion topVer, boolean create, boolean showRenting) throws GridDhtInvalidPartitionException
topVer - Topology version at the time of creation.p - Partition ID.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.void releasePartitions(int... parts)
parts - Partitions to release (should be reserved before).@Nullable @Nullable GridDhtLocalPartition localPartition(int part) throws GridDhtInvalidPartitionException
part - Partition number.GridDhtInvalidPartitionException - If partition is evicted or absent and
does not belong to this node.List<GridDhtLocalPartition> localPartitions()
Iterable<GridDhtLocalPartition> currentLocalPartitions()
GridDhtPartitionMap localPartitionMap()
GridDhtPartitionState partitionState(UUID nodeId, int part)
nodeId - Node ID.part - Partition.long updateSequence()
List<ClusterNode> nodes(int p, AffinityTopologyVersion topVer)
p - Partition ID.topVer - Topology version.@Nullable @Nullable List<ClusterNode> nodes(int p, AffinityAssignment affAssignment, List<ClusterNode> affNodes)
p - Partition ID.affAssignment - Assignments.affNodes - Node assigned for given partition by affinity.List<ClusterNode> owners(int p)
p - Partition ID.own this partition.List<List<ClusterNode>> allOwners()
List<ClusterNode> owners(int p, AffinityTopologyVersion topVer)
p - Partition ID.topVer - Topology version.own this partition.List<ClusterNode> moving(int p)
p - Partition ID.are preloading this partition.GridDhtPartitionFullMap partitionMap(boolean onlyActive)
onlyActive - If true, then only active partitions will be returned.boolean hasMovingPartitions()
True If one of cache nodes has partitions in GridDhtPartitionState.MOVING state.void onRemoved(GridDhtCacheEntry e)
e - Entry removed from cache.boolean update(@Nullable
@Nullable AffinityTopologyVersion exchangeResVer,
GridDhtPartitionFullMap partMap,
@Nullable
@Nullable CachePartitionFullCountersMap cntrMap,
Set<Integer> partsToReload,
@Nullable
@Nullable Map<Integer,Long> partSizes,
@Nullable
@Nullable AffinityTopologyVersion msgTopVer,
@Nullable
@Nullable GridDhtPartitionsExchangeFuture exchFut,
@Nullable
@Nullable Set<Integer> lostParts)
exchangeResVer - Result topology version for exchange. Value should be greater than previously passed. Null value
means full map received is not related to exchangepartMap - Update partition map.cntrMap - Partition update counters.partsToReload - Set of partitions that need to be reloaded.partSizes - Global partition sizes.msgTopVer - Topology version from incoming message. This value is not null only for case message is not
related to exchange. Value should be not less than previous 'Topology version from exchange'.exchFut - Future which is not null for initial partition update on exchange.lostParts - Lost partitions.True if local state was changed.boolean update(@Nullable
@Nullable GridDhtPartitionExchangeId exchId,
GridDhtPartitionMap parts,
boolean force)
exchId - Exchange ID.parts - Partitions.force - True to skip stale update check.True if local state was changed.void collectUpdateCounters(CachePartitionPartialCountersMap cntrMap)
cntrMap - Counters map.void applyUpdateCounters()
boolean detectLostPartitions(AffinityTopologyVersion resTopVer, GridDhtPartitionsExchangeFuture fut)
resTopVer - Exchange result version.fut - Exchange futute for topology events to detect.True if partitions state got updated.void resetLostPartitions(AffinityTopologyVersion resTopVer)
resTopVer - Exchange result version.void finalizeUpdateCounters(Set<Integer> parts)
parts - Partitions.CachePartitionFullCountersMap fullUpdateCounters()
CachePartitionPartialCountersMap localUpdateCounters(boolean skipZeros)
skipZeros - True to exclude zero counters from map.boolean own(GridDhtLocalPartition part)
part - Partition to own.True if owned.void ownMoving(AffinityTopologyVersion rebFinishedTopVer)
rebFinishedTopVer - Topology version when rebalancing finished.void onEvicted(GridDhtLocalPartition part, boolean updateSeq)
part - Evicted partition.updateSeq - Update sequence increment flag.@Nullable @Nullable GridDhtPartitionMap partitions(UUID nodeId)
nodeId - Node to get partitions for.void printMemoryStats(int threshold)
threshold - Threshold for number of entries.Map<Integer,Long> globalPartSizes()
void globalPartSizes(@Nullable
@Nullable Map<Integer,Long> partSizes)
partSizes - Sizes of up-to-date partition versions in topology.boolean rebalanceFinished(AffinityTopologyVersion topVer)
topVer - Topology version.True if rebalance process finished.Map<UUID,Set<Integer>> resetOwners(Map<Integer,Set<UUID>> ownersByUpdCounters, Set<Integer> haveHist, GridDhtPartitionsExchangeFuture exchFut)
ownersByUpdCounters will be reset to MOVING.
Called on coordinator during assignment of partition states.ownersByUpdCounters - Map (partition, set of node IDs that have most actual state about partition
(update counter is maximal) and should hold OWNING state for such partition).haveHist - Set of partitions which have WAL history to rebalance.exchFut - Exchange future for operation.void onExchangeDone(GridDhtPartitionsExchangeFuture fut, AffinityAssignment assignment, boolean updateRebalanceVer)
assignment - New affinity assignment.updateRebalanceVer - True if need check rebalance state.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.9.0 Release Date : October 15 2020