@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,
DiscoveryEvent discoEvt)
Checks if there is at least one owner for each partition in the cache topology.
|
GridDhtLocalPartition |
forceCreatePartition(int p)
Unconditionally creates partition during restore of persisted partition state.
|
CachePartitionFullCountersMap |
fullUpdateCounters() |
int |
groupId() |
boolean |
hasMovingPartitions() |
boolean |
initPartitionsWhenAffinityReady(AffinityTopologyVersion affVer,
GridDhtPartitionsExchangeFuture exchFut) |
AffinityTopologyVersion |
lastTopologyChangeVersion() |
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() |
CachePartitionPartialCountersMap |
localUpdateCounters(boolean skipZeros) |
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 |
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 topVer)
Owns all moving partitions for the given topology version.
|
GridDhtPartitionFullMap |
partitionMap(boolean onlyActive) |
int |
partitions() |
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> haveHistory)
Calculates nodes and partitions which have non-actual state 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(AffinityTopologyVersion exchangeResVer,
GridDhtPartitionFullMap partMap,
CachePartitionFullCountersMap cntrMap,
Set<Integer> partsToReload,
AffinityTopologyVersion msgTopVer) |
boolean |
update(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.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.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 - 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 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 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 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 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
AffinityTopologyVersion exchangeResVer,
GridDhtPartitionFullMap partMap,
@Nullable
CachePartitionFullCountersMap cntrMap,
Set<Integer> partsToReload,
@Nullable
AffinityTopologyVersion msgTopVer)
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.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'.True if local state was changed.boolean update(@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, DiscoveryEvent discoEvt)
This method should be called on topology coordinator after all partition messages are received.
resTopVer - Exchange result version.discoEvt - Discovery event for which we detect lost partitions.True if partitions state got updated.void resetLostPartitions(AffinityTopologyVersion resTopVer)
resTopVer - Exchange result version.Collection<Integer> lostPartitions()
CachePartitionFullCountersMap fullUpdateCounters()
CachePartitionPartialCountersMap localUpdateCounters(boolean skipZeros)
boolean own(GridDhtLocalPartition part)
part - Partition to own.True if owned.void ownMoving(AffinityTopologyVersion topVer)
topVer - Topology version.void onEvicted(GridDhtLocalPartition part, boolean updateSeq)
part - Evicted partition.updateSeq - Update sequence increment flag.@Nullable GridDhtPartitionMap partitions(UUID nodeId)
nodeId - Node to get partitions for.void printMemoryStats(int threshold)
threshold - Threshold for number of entries.boolean rebalanceFinished(AffinityTopologyVersion topVer)
topVer - Topology version.True if rebalance process finished.Map<UUID,Set<Integer>> resetOwners(Map<Integer,Set<UUID>> ownersByUpdCounters, Set<Integer> haveHistory)
ownersByUpdCounters will be reset to MOVING.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).haveHistory - Set of partitions which have WAL history to rebalance.void onExchangeDone(GridDhtPartitionsExchangeFuture fut, AffinityAssignment assignment, boolean updateRebalanceVer)
assignment - New affinity assignment.updateRebalanceVer - True if need check rebalance state.
Follow @ApacheIgnite
Ignite Fabric : ver. 2.5.0 Release Date : May 23 2018