Class OpOrder.Barrier
java.lang.Object
org.apache.cassandra.utils.concurrent.OpOrder.Barrier
- Enclosing class:
- OpOrder
This class represents a synchronisation point providing ordering guarantees on operations started
against the enclosing OpOrder. When issue() is called upon it (may only happen once per Barrier), the
Barrier atomically partitions new operations from those already running (by expiring the current Group),
and activates its isAfter() method
which indicates if an operation was started before or after this partition. It offers methods to
determine, or block until, all prior operations have finished, and a means to indicate to those operations
that they are blocking forward progress. See
OpOrder for idiomatic usage.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidawait()wait for all operations started prior to issuing the barrier to completereturns the Group we are waiting on - any Group with.compareTo(getSyncPoint()) <= 0must complete before await() returnsbooleanisAfter(OpOrder.Group group) voidissue()Issues (seals) the barrier, meaning no new operations may be issued against it, and expires the current Group.voidMark all prior operations as blocking, potentially signalling them to more aggressively make progress
-
Constructor Details
-
Barrier
public Barrier()
-
-
Method Details
-
isAfter
- Returns:
- true if @param group was started prior to the issuing of the barrier. (Until issue is called, always returns true, but if you rely on this behavior you are probably Doing It Wrong.)
-
issue
public void issue()Issues (seals) the barrier, meaning no new operations may be issued against it, and expires the current Group. Must be called before await() for isAfter() to be properly synchronised. -
markBlocking
public void markBlocking()Mark all prior operations as blocking, potentially signalling them to more aggressively make progress -
await
public void await()wait for all operations started prior to issuing the barrier to complete -
getSyncPoint
returns the Group we are waiting on - any Group with.compareTo(getSyncPoint()) <= 0must complete before await() returns
-