|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.cache.buddyreplication.NextMemberBuddyLocator
@ThreadSafe public class NextMemberBuddyLocator
This buddy locator uses a next-in-line algorithm to select buddies for a buddy group. This algorithm allows for the following properties, all of which are optional.
Constructor Summary | |
---|---|
NextMemberBuddyLocator()
|
Method Summary | |
---|---|
BuddyReplicationConfig.BuddyLocatorConfig |
getConfig()
Gets the configuration for this BuddyLocator. |
void |
init(BuddyReplicationConfig.BuddyLocatorConfig buddyLocatorConfig)
Initialize this BuddyLocator . |
protected boolean |
isColocated(org.jgroups.Address candidate,
org.jgroups.Address dataOwner)
|
protected boolean |
isInSameBuddyPool(java.util.Map<org.jgroups.Address,java.lang.String> buddyPoolMap,
org.jgroups.Address candidate,
org.jgroups.Address dataOwner)
|
java.util.List<org.jgroups.Address> |
locateBuddies(java.util.Map<org.jgroups.Address,java.lang.String> buddyPoolMap,
java.util.List<org.jgroups.Address> currentMembership,
org.jgroups.Address dataOwner)
Choose a set of buddies for the given node. |
void |
setChannel(org.jgroups.Channel channel)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NextMemberBuddyLocator()
Method Detail |
---|
public BuddyReplicationConfig.BuddyLocatorConfig getConfig()
BuddyLocator
getConfig
in interface BuddyLocator
null
. If BuddyLocator.init(org.jboss.cache.config.BuddyReplicationConfig.BuddyLocatorConfig)
has not been called or null
was passed to it, the
returned value should be the default config for the
given BuddyLocator implementation.public void setChannel(org.jgroups.Channel channel)
public void init(BuddyReplicationConfig.BuddyLocatorConfig buddyLocatorConfig)
BuddyLocator
BuddyLocator
.
init
in interface BuddyLocator
buddyLocatorConfig
- configuration for this BuddyLocator
. May be
null
, in which case the implementation should
use its default configuration.public java.util.List<org.jgroups.Address> locateBuddies(java.util.Map<org.jgroups.Address,java.lang.String> buddyPoolMap, java.util.List<org.jgroups.Address> currentMembership, org.jgroups.Address dataOwner)
BuddyLocator
locateBuddies
in interface BuddyLocator
buddyPoolMap
- Map mapping nodes in the cluster to
the "buddy pool" they have identified themselves as
belonging too. A BuddyLocator implementation can use
this information to preferentially assign buddies from
the same buddy pool as dataOwner
. May be
null
if buddy pools aren't configured.currentMembership
- List of the current cluster membersdataOwner
- Address of the node for which buddies should be selected
dataOwner
. Will not be null
, may
be empty.protected boolean isInSameBuddyPool(java.util.Map<org.jgroups.Address,java.lang.String> buddyPoolMap, org.jgroups.Address candidate, org.jgroups.Address dataOwner)
protected boolean isColocated(org.jgroups.Address candidate, org.jgroups.Address dataOwner)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |