Interface CountDownLatchInjection

All Superinterfaces:
AutoCloseable, AutoCloseables.Closeable
All Known Implementing Classes:
CountDownLatchInjectionImpl

public interface CountDownLatchInjection extends AutoCloseables.Closeable
This class is used internally for tracking injected countdown latches. These latches are specified via ExecConstants.DRILLBIT_CONTROL_INJECTIONS session option. This injection is useful in the case where a thread spawns multiple threads. The parent thread initializes the latch with the expected number of countdown and awaits. The child threads count down on the same latch (same site class and same descriptor), and once there are enough, the parent thread continues.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted.
    void
    Await without interruption.
    void
    Close the latch.
    void
    Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
    void
    initialize(int count)
    Initializes the underlying latch
  • Method Details

    • initialize

      void initialize(int count)
      Initializes the underlying latch
      Parameters:
      count - the number of times countDown() must be invoke before threads can pass through await()
    • await

      void await() throws InterruptedException
      Causes the current thread to wait until the latch has counted down to zero, unless the thread is interrupted.
      Throws:
      InterruptedException
    • awaitUninterruptibly

      void awaitUninterruptibly()
      Await without interruption. In the case of interruption, log a warning and continue to wait.
    • countDown

      void countDown()
      Decrements the count of the latch, releasing all waiting threads if the count reaches zero.
    • close

      void close()
      Close the latch.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface AutoCloseables.Closeable