Package org.apache.drill.exec.rpc
Class DynamicSemaphore
java.lang.Object
org.apache.drill.exec.rpc.DynamicSemaphore
Dynamic credit based flow control:
The sender initially sends batch to the sender by the initial static credit (3).
The receiver will calculate a runtime credit value while sampling some received batches. The runtime
generated credit value will be sent to the receiver as an ack value. The sender will change to the
runtime generated credit value while received the ack credit value.
The ack credit value has three type numeric value with different meaning:
0 : meaning no explicit credit value to the sender, just keep the initial static credit based fc.
-1: meaning the receiver has gone to wrong to solve the query.
value greater than 0: meaning a runtime generated credit value for the sender to change to.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
acquire()
void
release()
void
tryToIncreaseCredit
(int suggestedSemaphoreVal) received an advice credit to transfer from the initial static value
-
Constructor Details
-
DynamicSemaphore
public DynamicSemaphore()
-
-
Method Details
-
acquire
- Throws:
InterruptedException
-
release
public void release() -
tryToIncreaseCredit
public void tryToIncreaseCredit(int suggestedSemaphoreVal) received an advice credit to transfer from the initial static value- Parameters:
suggestedSemaphoreVal
-
-