Class SegmentDropLatch
java.lang.Object
org.apache.druid.server.coordination.SegmentDropLatch
Latch held by
SegmentLoadDropHandler.segmentDropLatches when a drop is scheduled or actively happening.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCancels this latch if the drop has not yet begun to execute.voidSets this latch toSegmentDropLatch.State.DONEstate, if it was inSegmentDropLatch.State.DROPPING.booleanSets this latch toSegmentDropLatch.State.DROPPINGstate, if it was inSegmentDropLatch.State.PENDING.
-
Constructor Details
-
SegmentDropLatch
public SegmentDropLatch()
-
-
Method Details
-
startDropping
public boolean startDropping()Sets this latch toSegmentDropLatch.State.DROPPINGstate, if it was inSegmentDropLatch.State.PENDING.- Returns:
- whether the original state was
SegmentDropLatch.State.PENDING
-
doneDropping
public void doneDropping()Sets this latch toSegmentDropLatch.State.DONEstate, if it was inSegmentDropLatch.State.DROPPING. Otherwise does nothing. -
cancelOrAwait
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
-