public class MultiRequest extends Request
| Modifier and Type | Field and Description |
|---|---|
protected int |
expected_mbrs |
block_for_results, completed, corr, done, GET_ABS_MAJORITY, GET_ALL, GET_FIRST, GET_MAJORITY, GET_N, GET_NONE, listener, lock, log, options, req_id, REQUEST_ID, request_msg, transport| Constructor and Description |
|---|
MultiRequest(Message m,
RequestCorrelator corr,
Address target,
RequestOptions options,
int expected_mbrs) |
MultiRequest(Message m,
RequestCorrelator corr,
java.util.Collection<Address> mbrs,
RequestOptions options,
int expected_mbrs) |
MultiRequest(Message m,
Transport transport,
java.util.Collection<Address> mbrs,
RequestOptions options,
int expected_mbrs) |
| Modifier and Type | Method and Description |
|---|---|
RspList |
get() |
RspList |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
getAnycasting() |
RspList |
getResults()
Returns the results as a RspList
|
void |
receiveResponse(java.lang.Object response_value,
Address sender)
Callback (called by RequestCorrelator or Transport).
|
protected boolean |
responsesComplete() |
void |
sendRequest() |
void |
setAnycasting(boolean anycasting) |
void |
suspect(Address suspected_member)
Callback (called by RequestCorrelator or Transport).
|
java.lang.String |
toString() |
void |
viewChange(View new_view)
Any member of 'membership' that is not in the new view is flagged as
SUSPECTED.
|
cancel, checkCompletion, execute, getBlockForResults, getRequestId, getResponsesComplete, isCancelled, isDone, modeToString, responsesComplete, setBlockForResults, setListener, setResponseFilter, waitForResultspublic MultiRequest(Message m, RequestCorrelator corr, java.util.Collection<Address> mbrs, RequestOptions options, int expected_mbrs)
m - The message to be sentcorr - The request correlator to be used. A request correlator
sends requests tagged with a unique ID and notifies the
sender when matching responses are received. The reason
GroupRequest uses it instead of a
Transport is that multiple
requests/responses might be sent/received concurrently.mbrs - The initial membership. This value reflects the membership
to which the request is sent (and from which potential
responses are expected). Is reset by reset().options - The options to be passed to the requestpublic MultiRequest(Message m, RequestCorrelator corr, Address target, RequestOptions options, int expected_mbrs)
public MultiRequest(Message m, Transport transport, java.util.Collection<Address> mbrs, RequestOptions options, int expected_mbrs)
timeout - Time to wait for responses (ms). A value of <= 0 means wait indefinitely
(e.g. if a suspicion service is available; timeouts are not needed).public boolean getAnycasting()
public void setAnycasting(boolean anycasting)
public void sendRequest()
throws java.lang.Exception
sendRequest in class Requestjava.lang.Exceptionpublic void receiveResponse(java.lang.Object response_value,
Address sender)
execute() returns.receiveResponse in interface RspCollectorreceiveResponse in class Requestpublic void suspect(Address 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.suspect in interface RspCollectorsuspect in class Requestpublic void viewChange(View new_view)
viewChange in interface RspCollectorviewChange in class Requestpublic RspList getResults()
public RspList get() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic RspList get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException, java.util.concurrent.ExecutionException, java.util.concurrent.TimeoutException
java.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutExceptionprotected boolean responsesComplete()
responsesComplete in class RequestCopyright ? 1998-2009 Bela Ban / Red Hat. All Rights Reserved.