Class SegmentDropLatch

java.lang.Object
org.apache.druid.server.coordination.SegmentDropLatch

public class SegmentDropLatch extends Object
Latch held by SegmentLoadDropHandler.segmentDropLatches when a drop is scheduled or actively happening.
  • Constructor Details

    • SegmentDropLatch

      public SegmentDropLatch()
  • Method Details

    • startDropping

      public boolean startDropping()
      Sets this latch to SegmentDropLatch.State.DROPPING state, if it was in SegmentDropLatch.State.PENDING.
      Returns:
      whether the original state was SegmentDropLatch.State.PENDING
    • doneDropping

      public void doneDropping()
      Sets this latch to SegmentDropLatch.State.DONE state, if it was in SegmentDropLatch.State.DROPPING. Otherwise does nothing.
    • cancelOrAwait

      public void cancelOrAwait() throws InterruptedException
      Cancels this latch if the drop has not yet begun to execute. Otherwise, waits for the drop to finish. Once this method returns, the drop is definitely no longer scheduled (it has either been canceled, or has already happened).
      Throws:
      InterruptedException