class RequestJournal extends RequestJournalReader with NamedLogging
The request journal records the committed com.digitalasset.canton.participant.protocol.RequestJournal.RequestState! associated with particular requests. The request journal is only written to by the com.digitalasset.canton.participant.protocol.ProtocolProcessors. In particular, reads of request journal state are used for maintaining consistency in reads from contract stores. The request journal is also used for bookkeeping and recovery. The only exception to the writing rule is the com.digitalasset.canton.participant.store.RequestJournalStore.prune method, which may be user-triggered, though the call's pre-conditions must be respected.
For every request, which is identified by a participant-local request counter, the request journal records the com.digitalasset.canton.participant.protocol.RequestJournal.RequestState associated with the request counter.
The request journal also stores the timestamp associated with the request. The assumption is made that every request is associated with only one timestamp. However, several requests may have the same timestamp.
- Alphabetic
- By Inheritance
- RequestJournal
- NamedLogging
- RequestJournalReader
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new RequestJournal(store: RequestJournalStore, metrics: ConnectedSynchronizerMetrics, loggerFactory: NamedLoggerFactory, initRc: RequestCounter)(implicit ec: ExecutionContext)
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]) @IntrinsicCandidate() @native()
- 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
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def insert(rc: RequestCounter, requestTimestamp: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[Unit]
Insert a new request into the request journal.
Insert a new request into the request journal. The insertion will become visible immediately. The request has the initial state RequestJournal.RequestState.Pending.
Preconditions:
- The request counter must not have been previously inserted.
- The request counter must be at least the front value of
pendingCursor
. - The request counter must not be
Long.MaxValue
.
- rc
The request counter for the request.
- requestTimestamp
The timestamp on the request message.
- returns
A future that will terminate as soon as the request has been stored or fail if a precondition is violated.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Attributes
- protected
- Definition Classes
- RequestJournal → 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
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def numberOfDirtyRequests: Int
Yields the number of requests that are currently not in state clean.
Yields the number of requests that are currently not in state clean.
The number may be incorrect, if previous calls to
insert
orterminate
have failed with an exception. This can be tolerated, as the ConnectedSynchronizer should be restarted after such an exception and that will reset the request journal. - def query(rc: RequestCounter)(implicit traceContext: TraceContext): OptionT[FutureUnlessShutdown, RequestData]
Returns the RequestJournal.RequestData associated with the given request counter, if any.
Returns the RequestJournal.RequestData associated with the given request counter, if any. Modifications done through the RequestJournal interface show up eventually, not necessarily immediately.
- Definition Classes
- RequestJournal → RequestJournalReader
- def size(start: CantonTimestamp = CantonTimestamp.Epoch, end: Option[CantonTimestamp] = None)(implicit traceContext: TraceContext): FutureUnlessShutdown[Int]
Counts requests whose timestamps lie between the given timestamps (inclusive).
Counts requests whose timestamps lie between the given timestamps (inclusive).
- start
Count all requests after or at the given timestamp
- end
Count all requests before or at the given timestamp; use None to impose no upper limit
- Annotations
- @VisibleForTesting()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def terminate(rc: RequestCounter, requestTimestamp: CantonTimestamp, commitTime: CantonTimestamp)(implicit traceContext: TraceContext): FutureUnlessShutdown[Unit]
Moves the given request to RequestJournal.RequestState.Clean and sets the commit time.
Moves the given request to RequestJournal.RequestState.Clean and sets the commit time. Does nothing if the request was already clean.
Preconditions:
- requestTimestamp
The timestamp assigned to the request counter
- returns
A future that completes as soon as the state change has been persisted or fails if a precondition is violated. The future itself contains a future that completes as soon as the clean cursor reaches
rc
.
- 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])