com.digitalasset.canton.participant.protocol.submission
WatermarkTracker
Companion object WatermarkTracker
class WatermarkTracker[Mark] extends WatermarkLookup[Mark] with NamedLogging
Keeps track of a boundary WatermarkTracker.highWatermark that increases monotonically. Clients can do one of the following:
- Use the WatermarkTracker to execute a task associated with a given mark
mark
> WatermarkTracker.highWatermark. Ifmark
<= WatermarkTracker.highWatermark, the task will be rejected. - Use the tracker to increase the WatermarkTracker.highWatermark.
Notify the caller as soon as all tasks with
mark
<= WatermarkTracker.highWatermark have finished.
The WatermarkTracker is effectively used to enforce mutual exclusion between two types of tasks.
- Tasks of type 1 act on data with
mark
> WatermarkTracker.highWatermark. - Tasks of type 2 act on data with
mark
<= WatermarkTracker.highWatermark.
- Alphabetic
- By Inheritance
- WatermarkTracker
- NamedLogging
- WatermarkLookup
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new WatermarkTracker(initialWatermark: Mark, loggerFactory: NamedLoggerFactory)(implicit arg0: Pretty[Mark], ordering: Ordering[Mark])
- initialWatermark
The initial value for WatermarkTracker.highWatermark
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def highWatermark: Mark
Returns the current value of the watermark.
Returns the current value of the watermark.
- Definition Classes
- WatermarkTracker → WatermarkLookup
- def increaseWatermark(mark: Mark): Future[Unit]
Increases the highWatermark to
mark
unless it was higher previously.Increases the highWatermark to
mark
unless it was higher previously.- returns
The future completes after there are no running tasks with marks up to
mark
inclusive.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Attributes
- protected
- Definition Classes
- WatermarkTracker → NamedLogging
- implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noTracingLogger: Logger
- Attributes
- protected
- Definition Classes
- NamedLogging
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def runIfAboveWatermark[F[_], Context[_], A](mark: Mark, register: => F[A])(implicit ec: ExecutionContext, traceContext: TraceContext, F: Thereafter[F, Context]): Either[MarkTooLow[Mark], F[A]]
Run a task
task
ifmark
> highWatermark.Run a task
task
ifmark
> highWatermark.- returns
scala.Left$ if
mark
is not higher than highWatermark. Otherwise returns the result of runningtask
as scala.Right$.
- Exceptions thrown
java.lang.IllegalStateException
if there are alreadyInt.MaxValue
tasks running formark
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])