All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----JavaGroups.GroupRequest
When started an array of responses, correlating to the membership, is created. Each response
is added to the corresponding field in the array. When all fields have been set, the algorithm
terminates.
This algorithm can optionally use a suspicion service (failure detector) to detect (and
exclude from the membership) fauly members. If no suspicion service is available, timeouts
can be used instead (see Execute
). When done, a list of suspected members
can be retrieved.
Because a channel might deliver requests, and responses to different requests, the
GroupRequest
class cannot itself receive and process requests/responses from the
channel. A mechanism outside this class has to do this; it has to determine what the responses
are for the message sent by the Execute
method and call ReceiveResponse
to do so.
Requirements: lossless delivery, e.g. acknowledgement-based message confirmation.
public static final int GET_FIRSTGET_ALL
public static final int GET_ALLGET_MAJORITY
public static final int GET_MAJORITYGET_ABS_MAJORITY
public static final int GET_ABS_MAJORITYGET_N
public static final int GET_NGET_NONE
public static final int GET_NONE
public GroupRequest(Message m, RequestCorrelator corr, Vector members, int rsp_mode)
GroupRequest
uses it instead of a Transport
is
that multiple requests/responses might be sent/received concurrently.
GET_ALL
: wait for all responses from non-suspected members.
A suspicion service might warn
us when a member from which a response is outstanding has crashed, so it can
be excluded from the responses. If no suspision service is available, a
timeout can be used (a value of 0 means wait forever). If a timeout of
0 is used, no suspicion service is available and a member from which we
expect a response has crashed, this methods blocks forever !.
GET_FIRST
: wait for the first available response.
GET_MAJORITY
: wait for the majority of all responses. The
majority is re-computed when a member is suspected.
GET_ABS_MAJORITY
: wait for the majority of
all members.
This includes failed members, so it may block if no timeout is specified.
GET_N
: wait for N members.
Return if n is >= membership+suspects.
GET_NONE
: don't wait for any response. Essentially send an
asynchronous message to the group members.
public GroupRequest(Message m, RequestCorrelator corr, Vector members, int rsp_mode, long timeout, int expected_mbrs)
public synchronized boolean Execute()
public void Reset(Message m, int mode, long timeout)
public void Reset(Message m, Vector members, int rsp_mode, long timeout, int expected_rsps)Reset
public void Reset(Vector members)ReceiveResponse
public void ReceiveResponse(Message m)
Execute
returns.
public void Suspect(Object suspected_member)
GroupRequest
that a member is reported as faulty (suspected).
This method would probably be called when getting a suspect message from a failure detector
(where available). It is used to exclude faulty members from the response list.
public void ViewChange(View new_view)
public RspList GetResults()
public String toString()
public int GetNumSuspects()GetSuspects
public Vector GetSuspects()IsDone
public boolean IsDone()
All Packages Class Hierarchy This Package Previous Next Index