Packages

trait MultiDomainEventLog extends AutoCloseable

The multi domain event log merges the events from several SingleDimensionEventLogs to a single event stream.

The underlying SingleDimensionEventLog either refer to a domain ("domain event log") or to the underlying participant ("participant event log").

Ordering guarantees: 1. Events belonging to the same SingleDimensionEventLog have the same relative order in the MultiDomainEventLog 2. Events are globally ordered such that any two (unpruned) events appear in the same relative order in different subscriptions and lookups.

Self Type
MultiDomainEventLog with NamedLogging
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MultiDomainEventLog
  2. AutoCloseable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def close(): Unit
    Definition Classes
    AutoCloseable
    Annotations
    @throws(classOf[java.lang.Exception])
  2. implicit abstract def executionContext: ExecutionContext
    Attributes
    protected
  3. abstract def fetchUnpublished(id: EventLogId, upToInclusiveO: Option[LocalOffset])(implicit traceContext: TraceContext): Future[Seq[PendingPublish]]

    Finds unpublished events in the single dimension event log.

    Finds unpublished events in the single dimension event log. More precisely, finds all events from id with:

    • local offset strictly greater than the local offset of the last published event from id
    • local offset smaller than or equal to upToInclusiveO (if defined).
  4. abstract def flush(): Future[Unit]

    Returns a future that completes after all publications have happened whose publish future has completed before the call to flush.

  5. abstract def getOffsetByTimeAtOrAfter(fromInclusive: CantonTimestamp)(implicit traceContext: TraceContext): OptionT[Future, (GlobalOffset, EventLogId, LocalOffset)]

    Yields the smallest global offset whose publication time is at or after fromInclusive, if any.

    Yields the smallest global offset whose publication time is at or after fromInclusive, if any. The publication time is measured on the participant's local clock.

  6. abstract def getOffsetByTimeUpTo(upToInclusive: CantonTimestamp)(implicit traceContext: TraceContext): OptionT[Future, GlobalOffset]

    Yields the largest global offset whose publication time is before or at upToInclusive, if any.

    Yields the largest global offset whose publication time is before or at upToInclusive, if any. The publication time is measured on the participant's local clock.

  7. abstract def globalOffsetFor(eventLogId: EventLogId, localOffset: LocalOffset)(implicit traceContext: TraceContext): Future[Option[(GlobalOffset, CantonTimestamp)]]

    Returns the com.digitalasset.canton.participant.GlobalOffset under which the given local offset of the given event log was published, if any, along with its publication time

  8. abstract def indexedStringStore: IndexedStringStore
  9. abstract def lastGlobalOffset(upToInclusive: GlobalOffset = Long.MaxValue)(implicit traceContext: TraceContext): OptionT[Future, GlobalOffset]

    Yields the highest global offset up to the given bound, if any.

  10. abstract def lastLocalOffset(id: EventLogId)(implicit traceContext: TraceContext): Future[Option[LocalOffset]]

    Returns the last linearized com.digitalasset.canton.participant.LocalOffset for the SingleDimensionEventLog id, if any

  11. abstract def lastLocalOffsetBeforeOrAt(eventLogId: EventLogId, upToInclusive: GlobalOffset, timestampInclusive: CantonTimestamp)(implicit traceContext: TraceContext): Future[Option[LocalOffset]]

    Returns the greatest local offset of the SingleDimensionEventLog given by eventLogId, if any, such that the following holds:

    Returns the greatest local offset of the SingleDimensionEventLog given by eventLogId, if any, such that the following holds:

    • The assigned global offset is below or at upToInclusive.
    • The record time of the event is below or at timestampInclusive
  12. abstract def locateOffset(deltaFromBeginning: Long)(implicit traceContext: TraceContext): OptionT[Future, GlobalOffset]

    Yields the deltaFromBeginning-lowest global offset (if it exists).

    Yields the deltaFromBeginning-lowest global offset (if it exists). I.e., locateOffset(0) yields the smallest offset, localOffset(1) the second smallest offset, and so on.

  13. abstract def lookupByEventIds(eventIds: Seq[EventId])(implicit traceContext: TraceContext): Future[Map[EventId, (GlobalOffset, TimestampedEventAndCausalChange, CantonTimestamp)]]

    Yields the global offset, event and publication time for all the published events with the given IDs.

    Yields the global offset, event and publication time for all the published events with the given IDs. Unpublished events are ignored.

  14. abstract def lookupEventRange(upToInclusive: Option[GlobalOffset], limit: Option[Int])(implicit traceContext: TraceContext): Future[Seq[(GlobalOffset, TimestampedEventAndCausalChange)]]

    Yields all events with offset up to upToInclusive.

  15. abstract def lookupOffset(globalOffset: GlobalOffset)(implicit traceContext: TraceContext): OptionT[Future, (EventLogId, LocalOffset, CantonTimestamp)]

    Returns the data associated with the given offset, if any

  16. abstract def lookupTransactionDomain(transactionId: LedgerTransactionId)(implicit traceContext: TraceContext): OptionT[Future, DomainId]

    Find the domain of a committed transaction.

  17. abstract def prune(upToInclusive: GlobalOffset)(implicit traceContext: TraceContext): Future[Unit]

    Removes all events with offset up to upToInclusive.

  18. abstract def publicationTimeLowerBound: CantonTimestamp

    Returns a lower bound on the latest publication time of a published event.

    Returns a lower bound on the latest publication time of a published event. All events published later will receive the same or higher publication time. Increases monotonically, even across restarts.

  19. abstract def publish(data: PublicationData): Future[Unit]

    Appends a new event to the event log.

    Appends a new event to the event log.

    The new event must already have been published in the SingleDimensionEventLog with id MultiDomainEventLog.PublicationData.eventLogId at offset MultiDomainEventLog.PublicationData.localOffset.

    The method is idempotent, i.e., it does nothing, if it is called twice with the same com.digitalasset.canton.participant.store.EventLogId and com.digitalasset.canton.participant.LocalOffset.

    The returned future completes already when the event has been successfully inserted into the internal (in-memory) inbox. Events will be persisted asynchronously. Actual publication has happened before a subsequent flush call's future completes.

    The caller must await completion of the returned future before calling the method again. Otherwise, the method may fail with an exception or return a failed future. (This restriction arises, because some implementations will offer the event to an Akka source queue, and the number of concurrent offers for such queues is bounded.)

    The event log will stall, i.e., log an error and refuse to publish further events in the following cases:

    • If an event cannot be persisted, even after retrying.
    • If events are published out of order, i.e., publish(id, o2).flatMap(_ => publish(id, o1)) with o1 < o2. Exception: The event log will not stall in case of republication of previously published events, i.e., publish(id, o1).flatMap(_ => publish(id, o2).flatMap(_ => publish(id, o1))) will not stall the event log.
  20. abstract def subscribe(beginWith: Option[GlobalOffset])(implicit traceContext: TraceContext): Source[(GlobalOffset, Traced[LedgerSyncEvent]), NotUsed]

    Yields an akka source with all stored events, optionally starting from a given offset.

    Yields an akka source with all stored events, optionally starting from a given offset.

    Exceptions thrown

    java.lang.IllegalArgumentException if beginWith is lower than MultiDomainEventLog.ledgerFirstOffset.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def lastDomainOffsetsBeforeOrAtGlobalOffset(upToInclusive: GlobalOffset, domainIds: List[DomainId], participantEventLogId: ParticipantEventLogId)(implicit traceContext: TraceContext): Future[(Map[DomainId, LocalOffset], Option[LocalOffset])]

    Yields the greatest local offsets for the underlying SingleDimensionEventLog with global offset less than or equal to upToInclusive.

    Yields the greatest local offsets for the underlying SingleDimensionEventLog with global offset less than or equal to upToInclusive.

    returns

    (domainLastOffsets, participantLastOffset), where domainLastOffsets maps the domains in domainIds to the greatest offset of the corresponding domain event log (if it exists) and participantLastOffset is the greatest participant offset.

  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def notifyOnPublish(published: Seq[Publication])(implicit traceContext: TraceContext): Unit
    Attributes
    protected
  16. val onPublish: AtomicReference[OnPublish]
    Attributes
    protected
  17. def setOnPublish(newOnPublish: OnPublish): Unit

    Sets the listener to be called whenever events are published to the multi-domain event log.

  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped