public interface FlowControl
Modifier and Type | Method and Description |
---|---|
int |
calculateResponse(AckSignalFlag flag,
int taskId)
Calculate/Build the response to piggyback with acknowledgement
|
AckSignalFlag |
getAckSignalFlag(int response)
Decode the acknowledgement signal from the response after an open request
is completed
|
int |
getNumberOfUnsentRequests() |
void |
logInfo()
Log the status of the flow control
|
void |
messageAckReceived(int taskId,
long requestId,
int response)
Notify the flow control policy that an open request is completed.
|
void |
sendRequest(int destTaskId,
WritableRequest request)
This method is called by a network client for all requests that should be
handled by a *remote* task.
|
void |
waitAllRequests()
There may be requests in possession of the flow control mechanism, as the
mechanism controls whether a task should send a request or not.
|
void sendRequest(int destTaskId, WritableRequest request)
destTaskId
- id of the worker to send the request torequest
- request to sendvoid messageAckReceived(int taskId, long requestId, int response)
taskId
- id of the task to which the open request is completedrequestId
- id of the open request which is completedresponse
- the response heard from the clientAckSignalFlag getAckSignalFlag(int response)
response
- the response heard after completion of a requestvoid waitAllRequests()
int getNumberOfUnsentRequests()
int calculateResponse(AckSignalFlag flag, int taskId)
flag
- indicating the status of processing of the request (whether it
was a new request or it was a duplicate)taskId
- id of the task the acknowledgement is forvoid logInfo()
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.