|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjgroup.arm.ReplicaManagerImpl
public class ReplicaManagerImpl
This implementation of the replication manager interfaces make use
of a variant of the semi-active replication scheme, in which only
the leader RM replica receive and process the requests,
while the follower replicas receive state update messages
through the StateListener interface. This permits
that only the leader perform creation and removal of replicas at
hosts in the distributed system, ensuring that only one group is
created in response to a createGroup() request.
This is done to prevent problems of non-determinism due to
multithreading in the Correlator.
The RM leader replica communicate with ExecDaemon
(factory) objects at the hosts that are supposed to server replicas
of any type. The operations that can be performed on the
ExecDaemons are typically idempotent.
Other application-level layers (or even servers) may also
communicate arbitrary events to the replication manager. For instance,
the RecoveryLayer will provide ViewChangeEvent
notifications to the RM leader when the group assoicated with a
RecoveryLayer instance has installed a new view.
Furthermore, the RecoveryLayer also implements a lease
based liveness timer in case multiple replicas fail simultaneously.
The events that can be communicated to the replication manager must
implement the ARMEvent interface, and must handle its
own event when received at the replication manager.
The replication manager supports several different implementations of
the RecoveryStrategy interface, allowing different
applications to provide specific recovery needs. For instance, one
such recovery strategy is the KeepMinimalInPartition,
which does just that.
The replication manager also provide self-recovery, by reusing the
same infrastructure used by the application-level recovery. However,
there is no recovery in case all replication manager replicas has been
exhausted.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface jgroup.core.arm.ReplicationManager |
|---|
ReplicationManager.ManagementCallback |
| Nested classes/interfaces inherited from interface jgroup.core.MembershipListener |
|---|
MembershipListener.AllowDuplicateViews |
| Method Summary | |
|---|---|
int |
createGroup(AppConfig app)
Create a group for the specified application, with the applications required redundancy. |
java.lang.Object |
getState(MemberId[] dests)
Method getState is invoked when the member has been
selected as coordinator for the reconciliation protocol. |
void |
hasLeft()
Upcall that is invoked by Jgroup to acknowledge the fact that this object has left the group. |
static void |
main(java.lang.String[] argv)
|
void |
notifyEvent(ARMEvent event)
The notifyEvent method is used by components external
to the replication manager to notify it of important events, such
as the presence of a new host (ExecDaemon) or view
change events from the RecoveryLayer. |
void |
prepareChange()
Upcall that is invoked by the group membership service to notify that the current view is not valid any more, and the group membership service is trying to reach an agreement on a new view. |
void |
putState(java.lang.Object state,
MemberId[] sources)
Method putState is invoked to inform the member about
the state of other members belonging to different partitions. |
void |
removeGroup(AppConfig app)
Remove the group for the given application. |
void |
subscribe(ReplicationManager.ManagementCallback callback,
int gid)
Register to receive notifications for the given group. |
void |
unsubscribe(int gid)
Unregister to receive notifications for the given group. |
void |
updateGroup(AppConfig app)
Update the replication policy for the group for the given application. |
void |
viewChange(View view)
View change for the replication manager group; set the leader replica, and ensure that the grouptable is correctly updated with respect to this view change from the RM group. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
@Multicast
public void notifyEvent(ARMEvent event)
throws java.rmi.RemoteException,
java.lang.Exception
ReplicationManagernotifyEvent method is used by components external
to the replication manager to notify it of important events, such
as the presence of a new host (ExecDaemon) or view
change events from the RecoveryLayer.
The method takes arbitrary event types as long as they implement
the interface ARMEvent.
notifyEvent in interface ReplicationManagerevent - An event notification for the replication manager.
java.rmi.RemoteException - Raised if the remote operation failed.
java.lang.Exception
@Multicast
public int createGroup(AppConfig app)
throws java.rmi.RemoteException,
RedundancyException,
GroupExistsException
ReplicationManager
createGroup in interface ReplicationManagerapp - The application details required to create a group for it.
java.rmi.RemoteException - Raised if there was communication problems; only when invoked remotely.
RedundancyException - Raised if the specified redundancy could not be satisfied.
GroupExistsException - Raised if the specified group already exists.
@Multicast
public void removeGroup(AppConfig app)
throws java.rmi.RemoteException,
UnknownGroupException
ReplicationManager
removeGroup in interface ReplicationManagerapp - The application group to remove.
java.rmi.RemoteException - Raised if there was communication problems; only when invoked remotely.
UnknownGroupException - Raised if the specified application has no group in the system.@Multicast public void updateGroup(AppConfig app)
ReplicationManager
updateGroup in interface ReplicationManagerapp - The application group to remove.
@Multicast
public void subscribe(ReplicationManager.ManagementCallback callback,
int gid)
throws java.rmi.RemoteException,
UnknownGroupException
ReplicationManager
subscribe in interface ReplicationManagercallback - The callback server (typically a management client)gid - The group for which notifications are desired
java.rmi.RemoteException - Raised if there was communication problems; only when invoked remotely.
UnknownGroupException - Raised if the specified application has no group in the system.
@Multicast
public void unsubscribe(int gid)
throws java.rmi.RemoteException,
UnknownGroupException
ReplicationManager
unsubscribe in interface ReplicationManagergid - The group for which notifications are no longer desired
java.rmi.RemoteException - Raised if there was communication problems; only when invoked remotely.
UnknownGroupException - Raised if the specified application has no group in the system.public void viewChange(View view)
viewChange in interface MembershipListenerview - The new view that has been installed.MembershipServicepublic void hasLeft()
MembershipListenerleave method has been invoked on the group membership
service.
hasLeft in interface MembershipListenerMembershipServicepublic void prepareChange()
MembershipListener
prepareChange in interface MembershipListenerMembershipServicepublic java.lang.Object getState(MemberId[] dests)
MergingListenergetState is invoked when the member has been
selected as coordinator for the reconciliation protocol.
getState in interface MergingListenerdests - The destination set of the reconciliation message;
public void putState(java.lang.Object state,
MemberId[] sources)
MergingListenerputState is invoked to inform the member about
the state of other members belonging to different partitions.
putState in interface MergingListenerstate - The reconciliation messagesources - The state contained in status is already known by
members in sources.
public static void main(java.lang.String[] argv)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||