public interface AvailabilityStrategyContext
AvailabilityStrategy
to proceed with a rebalance, a membership update, or an availability mode change.Modifier and Type | Method and Description |
---|---|
AvailabilityMode |
getAvailabilityMode() |
String |
getCacheName() |
CacheTopology |
getCurrentTopology() |
List<Address> |
getExpectedMembers()
The members of the cache.
|
CacheTopology |
getStableTopology()
Whenever a new cache topology without a
pendingCH and with at least numOwners owners for each
segment is installed, and the cache is AvailabilityMode.AVAILABLE , the current cache topology is marked
as the stable topology. |
void |
queueRebalance(List<Address> newMembers)
Queue (or start) a rebalance.
|
void |
updateAvailabilityMode(List<Address> actualMembers,
AvailabilityMode mode,
boolean cancelRebalance)
Enter a new availability mode.
|
void |
updateCurrentTopology(List<Address> newMembers)
Use the configured
ConsistentHashFactory to create a new CH
with the given members , but do not start a rebalance. |
void |
updateTopologiesAfterMerge(CacheTopology currentTopology,
CacheTopology stableTopology,
AvailabilityMode availabilityMode)
Updates both the stable and the current topologies.
|
String getCacheName()
CacheTopology getCurrentTopology()
CacheTopology getStableTopology()
pendingCH
and with at least numOwners
owners for each
segment is installed, and the cache is AvailabilityMode.AVAILABLE
, the current cache topology is marked
as the stable topology.
The same happens when a rebalance is scheduled to start, but it doesn't do anything because the current
topology is already balanced.null
.AvailabilityMode getAvailabilityMode()
List<Address> getExpectedMembers()
CacheTopology
.
Does not include nodes which have left the cluster (either gracefully or abruptly) but are still in the
current topology.void queueRebalance(List<Address> newMembers)
ConsistentHashFactory
to create a new balanced consistent hash
with the given members.
If there is no rebalance in progress, start a rebalance right away.
If there is a rebalance in progress, queue another rebalance.
If there is a rebalance in the queue as well, it will be replaced with the new one.
If newConsistentHash == null
, remove any queued rebalance.void updateCurrentTopology(List<Address> newMembers)
ConsistentHashFactory
to create a new CH
with the given members
, but do not start a rebalance.
Members missing from the current topology are ignored.void updateAvailabilityMode(List<Address> actualMembers, AvailabilityMode mode, boolean cancelRebalance)
void updateTopologiesAfterMerge(CacheTopology currentTopology, CacheTopology stableTopology, AvailabilityMode availabilityMode)
Copyright © 2023 JBoss, a division of Red Hat. All rights reserved.