|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.buddyreplication.BuddyManager
public class BuddyManager
Class that manages buddy replication groups.
Nested Class Summary | |
---|---|
class |
BuddyManager.ViewChangeListener
|
Field Summary | |
---|---|
static java.lang.String |
BUDDY_BACKUP_SUBTREE
Constants representng the buddy backup subtree |
static Fqn |
BUDDY_BACKUP_SUBTREE_FQN
|
Constructor Summary | |
---|---|
BuddyManager(BuddyReplicationConfig config)
|
Method Summary | |
---|---|
protected BuddyLocator |
createBuddyLocator(BuddyReplicationConfig.BuddyLocatorConfig config)
|
protected BuddyLocator |
createDefaultBuddyLocator()
|
byte[] |
generateState(Fqn fqn,
long timeout,
boolean force,
boolean suppressErrors)
Returns the state for the portion of the cache named by fqn . |
static Fqn |
getActualFqn(Fqn fqn)
|
static Fqn |
getBackupFqn(org.jgroups.Address dataOwnerAddress,
Fqn origFqn)
Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the data owner's Address. |
Fqn |
getBackupFqn(Fqn originalFqn)
Assumes the backup Fqn if the current instance is the data owner |
static Fqn |
getBackupFqn(Fqn buddyGroupRoot,
Fqn origFqn)
Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the backup subtree for the buddy group in question |
static Fqn |
getBackupFqn(java.lang.String buddyGroupName,
Fqn origFqn)
Utility method that retrieves a buddy backup Fqn given the actual Fqn of some data and the buddy group name. |
java.util.List<org.jgroups.Address> |
getBuddyAddresses()
Returns a list of buddies for which this instance is Data Owner. |
int |
getBuddyCommunicationTimeout()
|
java.lang.String |
getBuddyPoolName()
|
BuddyReplicationConfig |
getConfig()
|
static java.lang.String |
getGroupNameFromAddress(java.lang.Object address)
|
void |
handleAssignToBuddyGroup(BuddyGroup newGroup,
java.util.Map<Fqn,byte[]> state)
Called by CacheImpl._remoteAssignToBuddyGroup(BuddyGroup g) when a method call for this is received from a remote cache. |
void |
handlePoolNameBroadcast(org.jgroups.Address address,
java.lang.String poolName)
Called by CacheImpl._remoteAnnounceBuddyPoolName(Address address, String buddyPoolName) when a view change occurs and caches need to inform the cluster of which buddy pool it is in. |
void |
handleRemoveFromBuddyGroup(java.lang.String groupName)
Called by CacheImpl._remoteRemoveFromBuddyGroup(String groupName) when a method call for this is received from a remote cache. |
void |
init(CacheImpl cache)
|
boolean |
isAutoDataGravitation()
|
static boolean |
isBackupFqn(Fqn name)
|
boolean |
isDataGravitationRemoveOnFind()
|
boolean |
isDataGravitationSearchBackupTrees()
|
boolean |
isEnabled()
|
void |
stop()
Stops the buddy manager and the related async thread. |
MethodCall |
transformFqns(MethodCall call)
Introspects method call for Fqns and changes them such that they are under the current buddy group's backup subtree (e.g., /_buddy_backup_/my_host:7890/) rather than the root (/). |
MethodCall |
transformFqns(MethodCall call,
boolean transformForCurrentCall)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String BUDDY_BACKUP_SUBTREE
public static final Fqn BUDDY_BACKUP_SUBTREE_FQN
Constructor Detail |
---|
public BuddyManager(BuddyReplicationConfig config)
Method Detail |
---|
public BuddyReplicationConfig getConfig()
protected BuddyLocator createBuddyLocator(BuddyReplicationConfig.BuddyLocatorConfig config) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
protected BuddyLocator createDefaultBuddyLocator()
public boolean isEnabled()
public java.lang.String getBuddyPoolName()
public static java.lang.String getGroupNameFromAddress(java.lang.Object address)
public void stop()
public void init(CacheImpl cache) throws CacheException
CacheException
public boolean isAutoDataGravitation()
public boolean isDataGravitationRemoveOnFind()
public boolean isDataGravitationSearchBackupTrees()
public int getBuddyCommunicationTimeout()
public void handlePoolNameBroadcast(org.jgroups.Address address, java.lang.String poolName)
public void handleRemoveFromBuddyGroup(java.lang.String groupName) throws BuddyNotInitException
BuddyNotInitException
public void handleAssignToBuddyGroup(BuddyGroup newGroup, java.util.Map<Fqn,byte[]> state) throws java.lang.Exception
newGroup
- the buddy groupstate
- Mapnull
.
java.lang.Exception
public static Fqn getBackupFqn(org.jgroups.Address dataOwnerAddress, Fqn origFqn)
dataOwnerAddress
- the JGroups Address
of the data ownerorigFqn
- the original Fqn
public static Fqn getBackupFqn(java.lang.String buddyGroupName, Fqn origFqn)
buddyGroupName
- the buddy group nameorigFqn
- the original Fqn
public static Fqn getBackupFqn(Fqn buddyGroupRoot, Fqn origFqn)
buddyGroupRoot
- the subtree under which data for a particular buddy is backed uporigFqn
- the original Fqn
public static boolean isBackupFqn(Fqn name)
public java.util.List<org.jgroups.Address> getBuddyAddresses()
public MethodCall transformFqns(MethodCall call)
public MethodCall transformFqns(MethodCall call, boolean transformForCurrentCall)
public byte[] generateState(Fqn fqn, long timeout, boolean force, boolean suppressErrors) throws java.lang.Throwable
fqn
.
State returned is a serialized byte[][], element 0 is the transient state
(or null), and element 1 is the persistent state (or null).
fqn
- Fqn indicating the uppermost node in the
portion of the cache whose state should be returned.timeout
- max number of ms this method should wait to acquire
a read lock on the nodes being transferredforce
- if a read lock cannot be acquired after
timeout
ms, should the lock acquisition
be forced, and any existing transactions holding locks
on the nodes be rolled back? NOTE:
In release 1.2.4, this parameter has no effect.suppressErrors
- should any Throwable thrown be suppressed?
java.lang.Throwable
public Fqn getBackupFqn(Fqn originalFqn)
originalFqn
-
public static Fqn getActualFqn(Fqn fqn)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |