Class DynamicSemaphore

java.lang.Object
org.apache.drill.exec.rpc.DynamicSemaphore

public class DynamicSemaphore extends Object
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 Details

    • DynamicSemaphore

      public DynamicSemaphore()
  • Method Details

    • acquire

      public void acquire() throws InterruptedException
      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 -