Package org.jgroups.protocols.relay
Class StickySiteMasterPicker
java.lang.Object
org.jgroups.protocols.relay.RandomSiteMasterPicker
org.jgroups.protocols.relay.StickySiteMasterPicker
- All Implemented Interfaces:
SiteMasterPicker
Picks a local site master or a route based on the sender and caches the decision. Next time, the same local site
master or route will be returned. If no route exists yet, a random local site master or route is picked.
- Since:
- 5.3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class org.jgroups.protocols.relay.RandomSiteMasterPicker
addr_supplier, verbose -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPicks a route to a given remote site from a list of routes.pickSiteMaster(List<Address> site_masters, Address original_sender) Needs to pick a member from a list of addresses of site mastersMethods inherited from class org.jgroups.protocols.relay.RandomSiteMasterPicker
addressSupplier, verbose, verbose
-
Field Details
-
local_sm_cache
-
route_cache
-
-
Constructor Details
-
StickySiteMasterPicker
public StickySiteMasterPicker()
-
-
Method Details
-
pickSiteMaster
Description copied from interface:SiteMasterPickerNeeds to pick a member from a list of addresses of site masters- Specified by:
pickSiteMasterin interfaceSiteMasterPicker- Overrides:
pickSiteMasterin classRandomSiteMasterPicker- 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
Description copied from interface:SiteMasterPickerPicks a route to a given remote site from a list of routes.- Specified by:
pickRoutein interfaceSiteMasterPicker- Overrides:
pickRoutein classRandomSiteMasterPicker- 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
-