Package org.jgroups.protocols.relay
Class RandomSiteMasterPicker
- java.lang.Object
-
- org.jgroups.protocols.relay.RandomSiteMasterPicker
-
- All Implemented Interfaces:
SiteMasterPicker
- Direct Known Subclasses:
StickySiteMasterPicker
public class RandomSiteMasterPicker extends java.lang.Object implements SiteMasterPicker
Implementation ofSiteMasterPickerwhich picks random site masters / routes to site masters- Since:
- 5.3.1
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Supplier<Address>addr_supplierprotected booleanverbose
-
Constructor Summary
Constructors Constructor Description RandomSiteMasterPicker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SiteMasterPickeraddressSupplier(java.util.function.Supplier<Address> s)RoutepickRoute(java.lang.String site, java.util.List<Route> routes, Address original_sender)Picks a route to a given remote site from a list of routes.AddresspickSiteMaster(java.util.List<Address> site_masters, Address original_sender)Needs to pick a member from a list of addresses of site mastersbooleanverbose()SiteMasterPickerverbose(boolean b)
-
-
-
Field Detail
-
verbose
protected boolean verbose
-
addr_supplier
protected java.util.function.Supplier<Address> addr_supplier
-
-
Method Detail
-
verbose
public boolean verbose()
-
verbose
public SiteMasterPicker verbose(boolean b)
-
addressSupplier
public SiteMasterPicker addressSupplier(java.util.function.Supplier<Address> s)
-
pickSiteMaster
public Address pickSiteMaster(java.util.List<Address> site_masters, Address original_sender)
Description copied from interface:SiteMasterPickerNeeds to pick a member from a list of addresses of site masters- Specified by:
pickSiteMasterin interfaceSiteMasterPicker- Parameters:
site_masters- The list of site mastersoriginal_sender- The address of the original member sending a message- Returns:
- The address of the site master (in the local cluster) to be used to forward the message to
-
pickRoute
public Route pickRoute(java.lang.String site, java.util.List<Route> routes, Address original_sender)
Description copied from interface:SiteMasterPickerPicks a route to a given remote site from a list of routes.- Specified by:
pickRoutein interfaceSiteMasterPicker- Parameters:
site- The name of the target (remote) site. Added for informational purposes; may or may not be used as selection criterium.routes- The list of routes. A route can be picked for example by using the address of the remote site master:Route.siteMaster()original_sender- The address of the original sender- Returns:
- A route
-
-