public class StaticFlowControl extends Object implements FlowControl, ResetSuperstepMetricsObserver
Modifier and Type | Field and Description |
---|---|
static FloatConfOption |
FRACTION_OF_REQUESTS_TO_CLOSE_BEFORE_PROCEEDING
After pausing a thread due to too large number of open requests,
which fraction of these requests need to be closed before we continue
|
static IntConfOption |
MAX_NUMBER_OF_OPEN_REQUESTS
Maximum number of requests without confirmation we should have
|
Constructor and Description |
---|
StaticFlowControl(ImmutableClassesGiraphConfiguration conf,
NettyClient nettyClient)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
calculateResponse(AckSignalFlag alreadyDone,
int clientId)
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 |
newSuperstep(SuperstepMetricsRegistry metrics)
Starting a new superstep.
|
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.
|
public static final IntConfOption MAX_NUMBER_OF_OPEN_REQUESTS
public static final FloatConfOption FRACTION_OF_REQUESTS_TO_CLOSE_BEFORE_PROCEEDING
public StaticFlowControl(ImmutableClassesGiraphConfiguration conf, NettyClient nettyClient)
conf
- configurationnettyClient
- netty clientpublic void newSuperstep(SuperstepMetricsRegistry metrics)
ResetSuperstepMetricsObserver
newSuperstep
in interface ResetSuperstepMetricsObserver
metrics
- SuperstepMetricsRegistry being used.public void sendRequest(int destTaskId, WritableRequest request)
FlowControl
sendRequest
in interface FlowControl
destTaskId
- id of the worker to send the request torequest
- request to sendpublic void messageAckReceived(int taskId, long requestId, int response)
FlowControl
messageAckReceived
in interface FlowControl
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 clientpublic AckSignalFlag getAckSignalFlag(int response)
FlowControl
getAckSignalFlag
in interface FlowControl
response
- the response heard after completion of a requestpublic int calculateResponse(AckSignalFlag alreadyDone, int clientId)
FlowControl
calculateResponse
in interface FlowControl
alreadyDone
- indicating the status of processing of the request (whether it
was a new request or it was a duplicate)clientId
- id of the task the acknowledgement is forpublic void logInfo()
FlowControl
logInfo
in interface FlowControl
public void waitAllRequests()
FlowControl
waitAllRequests
in interface FlowControl
public int getNumberOfUnsentRequests()
getNumberOfUnsentRequests
in interface FlowControl
Copyright © 2011-2020 The Apache Software Foundation. All Rights Reserved.