Class PreferAvailabilityStrategy
- java.lang.Object
-
- org.infinispan.partitionhandling.impl.PreferAvailabilityStrategy
-
- All Implemented Interfaces:
AvailabilityStrategy
public class PreferAvailabilityStrategy extends Object implements AvailabilityStrategy
-
-
Constructor Summary
Constructors Constructor Description PreferAvailabilityStrategy(org.infinispan.util.logging.events.EventLogManager eventLogManager, PersistentUUIDManager persistentUUIDManager, LostDataCheck lostDataCheck)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheTopology
computePreferredTopology(Map<Address,CacheStatusResponse> statusResponseMap)
Ignore the AvailabilityStrategyContext and only compute the preferred topology for testing.void
onClusterViewChange(AvailabilityStrategyContext context, List<Address> clusterMembers)
Called when the cluster view changed (e.g.void
onGracefulLeave(AvailabilityStrategyContext context, Address leaver)
Called when a node leaves gracefully.void
onJoin(AvailabilityStrategyContext context, Address joiner)
Called when a node joins.void
onManualAvailabilityChange(AvailabilityStrategyContext context, AvailabilityMode newAvailabilityMode)
Called when the administrator manually changes the availability status.void
onPartitionMerge(AvailabilityStrategyContext context, Map<Address,CacheStatusResponse> statusResponseMap)
Called when two or more partitions merge, to compute the stable and current cache topologies for the merged cluster.void
onRebalanceEnd(AvailabilityStrategyContext context)
Called when a rebalance ends.
-
-
-
Constructor Detail
-
PreferAvailabilityStrategy
public PreferAvailabilityStrategy(org.infinispan.util.logging.events.EventLogManager eventLogManager, PersistentUUIDManager persistentUUIDManager, LostDataCheck lostDataCheck)
-
-
Method Detail
-
onJoin
public void onJoin(AvailabilityStrategyContext context, Address joiner)
Description copied from interface:AvailabilityStrategy
Called when a node joins.- Specified by:
onJoin
in interfaceAvailabilityStrategy
-
onGracefulLeave
public void onGracefulLeave(AvailabilityStrategyContext context, Address leaver)
Description copied from interface:AvailabilityStrategy
Called when a node leaves gracefully.- Specified by:
onGracefulLeave
in interfaceAvailabilityStrategy
-
onClusterViewChange
public void onClusterViewChange(AvailabilityStrategyContext context, List<Address> clusterMembers)
Description copied from interface:AvailabilityStrategy
Called when the cluster view changed (e.g. because one or more nodes left abruptly).- Specified by:
onClusterViewChange
in interfaceAvailabilityStrategy
-
onPartitionMerge
public void onPartitionMerge(AvailabilityStrategyContext context, Map<Address,CacheStatusResponse> statusResponseMap)
Description copied from interface:AvailabilityStrategy
Called when two or more partitions merge, to compute the stable and current cache topologies for the merged cluster.- Specified by:
onPartitionMerge
in interfaceAvailabilityStrategy
-
computePreferredTopology
public CacheTopology computePreferredTopology(Map<Address,CacheStatusResponse> statusResponseMap)
Ignore the AvailabilityStrategyContext and only compute the preferred topology for testing.- Returns:
- The preferred topology, or
null
if there is no preferred topology.
-
onRebalanceEnd
public void onRebalanceEnd(AvailabilityStrategyContext context)
Description copied from interface:AvailabilityStrategy
Called when a rebalance ends. Can be used to re-assess the state of the cache and apply pending changes.- Specified by:
onRebalanceEnd
in interfaceAvailabilityStrategy
-
onManualAvailabilityChange
public void onManualAvailabilityChange(AvailabilityStrategyContext context, AvailabilityMode newAvailabilityMode)
Description copied from interface:AvailabilityStrategy
Called when the administrator manually changes the availability status.- Specified by:
onManualAvailabilityChange
in interfaceAvailabilityStrategy
-
-