Packages

class DbSequencerStateManagerStore extends SequencerStateManagerStore with DbStore

Database store for server side sequencer data. If you need more than one sequencer running on the same db, you can isolate them using different sequencerStoreIds. This is useful for tests and for sequencer applications that implement multiple domains.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DbSequencerStateManagerStore
  2. DbStore
  3. HasCloseContext
  4. PromiseUnlessShutdownFactory
  5. NamedLogging
  6. FlagCloseable
  7. PerformUnlessClosing
  8. OnShutdownRunner
  9. AutoCloseable
  10. SequencerStateManagerStore
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DbSequencerStateManagerStore(storage: DbStorage, protocolVersion: ProtocolVersion, timeouts: ProcessingTimeout, loggerFactory: NamedLoggerFactory, maxBatchSize: Int = 1000)(implicit ec: ExecutionContext)

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. def acknowledge(member: Member, timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[Unit]

    Write an acknowledgement that member has processed earlier timestamps.

    Write an acknowledgement that member has processed earlier timestamps. Only the latest timestamp needs to be stored. Earlier timestamps can be overwritten. Acknowledgements of earlier timestamps should be ignored.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  5. def acknowledgeDBIO(member: Member, timestamp: CantonTimestamp): WriteOnly[Unit]
  6. def addEvents(events: Map[Member, OrdinarySerializedEvent], trafficSate: Map[Member, TrafficState])(implicit traceContext: TraceContext): Future[Unit]

    Add a new events to the sequencer store.

    Add a new events to the sequencer store. Callers must ensure that all members receiving a counter update have been registered and that the counter values are correct. Callers must also ensure that the timestamp is correct and later than all prior events as this is also not validated by all store implementations. Counter updates for invalid counter values (<0) will cause a java.lang.IllegalArgumentException to be throw. Implementations may throw a java.lang.IllegalArgumentException if a counter update is incorrect (not following the current head), but may not if this is not possible to efficiently do (like with database persistence that would require executing a query to check). Implementations should ensure that all events are written atomically (or none written if a failure is hit).

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  7. def addEventsDBIO(trafficState: Map[Member, TrafficState])(events: Map[Member, OrdinarySerializedEvent])(implicit batchTraceContext: TraceContext): All[Unit]
  8. def addInFlightAggregationUpdates(updates: InFlightAggregationUpdates)(implicit traceContext: TraceContext): Future[Unit]

    Updates the in-flight aggregations for the given aggregation IDs.

    Updates the in-flight aggregations for the given aggregation IDs. Only adds or updates aggregations, but never removes them.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
    See also

    expireInFlightAggregations for removing in-flight aggregations

  9. def addMember(member: Member, addedAt: CantonTimestamp)(implicit traceContext: TraceContext): Future[Unit]

    Adds a new member to the sequencer.

    Adds a new member to the sequencer. Callers are expected to ensure that the member is not already registered.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  10. def addMemberDBIO(member: Member, addedAt: CantonTimestamp)(implicit traceContext: TraceContext): All[Unit]
  11. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  12. def cancelShutdownTask(token: Long): Unit

    Removes a shutdown task from the list using a token returned by runOnShutdown

    Removes a shutdown task from the list using a token returned by runOnShutdown

    Definition Classes
    OnShutdownRunner
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  14. final def close(): Unit

    Blocks until all earlier tasks have completed and then prevents further tasks from being run.

    Blocks until all earlier tasks have completed and then prevents further tasks from being run.

    Definition Classes
    FlagCloseableOnShutdownRunner → AutoCloseable
  15. implicit val closeContext: CloseContext
    Definition Classes
    HasCloseContext
  16. def closingTimeout: FiniteDuration
    Attributes
    protected
    Definition Classes
    FlagCloseablePerformUnlessClosing
  17. def containsShutdownTask(token: Long): Boolean
    Definition Classes
    OnShutdownRunner
  18. def disableMember(member: Member)(implicit traceContext: TraceContext): Future[Unit]

    Prevents member from sending and reading from the sequencer, and allows unread data for this member to be pruned.

    Prevents member from sending and reading from the sequencer, and allows unread data for this member to be pruned. It however won't stop any sends addressed to this member.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  19. def disableMemberDBIO(member: Member): WriteOnly[Unit]
  20. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  22. implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  23. def fetchLowerBound()(implicit traceContext: TraceContext): Future[Option[CantonTimestamp]]

    Fetch the lower bound of events that can be read.

    Fetch the lower bound of events that can be read. Returns None if all events can be read.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  25. def getInitialTopologySnapshotTimestamp(implicit traceContext: TraceContext): Future[Option[CantonTimestamp]]

    Retrieve the timestamp of the initial topology snapshot if available.

    Retrieve the timestamp of the initial topology snapshot if available.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  26. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  27. def internalPerformUnlessClosingF[A](name: String)(f: => Future[A])(implicit ec: ExecutionContext, traceContext: TraceContext): UnlessShutdown[Future[A]]
    Attributes
    protected
    Definition Classes
    PerformUnlessClosing
  28. def isClosing: Boolean

    Check whether we're closing.

    Check whether we're closing. Susceptible to race conditions; unless you're using using this as a flag to the retry lib or you really know what you're doing, prefer performUnlessClosing and friends.

    Definition Classes
    OnShutdownRunner
  29. def isEnabled(member: Member)(implicit traceContext: TraceContext): Future[Boolean]

    Check whether the member is enabled.

    Check whether the member is enabled. Currently used when receiving a request for reading.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def keepTrackOfOpenFutures: Boolean

    track running futures on shutdown

    track running futures on shutdown

    set to true to get detailed information about all futures that did not complete during shutdown. if set to false, we don't do anything.

    Attributes
    protected
    Definition Classes
    PerformUnlessClosing
  32. def latestAcknowledgements()(implicit traceContext: TraceContext): Future[Map[Member, CantonTimestamp]]

    Return the latest acknowledgements for all members

    Return the latest acknowledgements for all members

    Attributes
    protected[state]
    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  33. def logger: TracedLogger
    Attributes
    protected
    Definition Classes
    NamedLogging
  34. val loggerFactory: NamedLoggerFactory
    Attributes
    protected
    Definition Classes
    DbSequencerStateManagerStoreNamedLogging
  35. def maxSleepMillis: Long

    How often to poll to check that all tasks have completed.

    How often to poll to check that all tasks have completed.

    Attributes
    protected
    Definition Classes
    PerformUnlessClosing
  36. def mkPromise[A](description: String, futureSupervisor: FutureSupervisor, logAfter: Duration = 10.seconds, logLevel: Level = Level.DEBUG)(implicit elc: ErrorLoggingContext, ec: ExecutionContext): PromiseUnlessShutdown[A]

    Use this method to create a PromiseUnlessShutdown that will automatically be cancelled when the close context is closed.

    Use this method to create a PromiseUnlessShutdown that will automatically be cancelled when the close context is closed. This allows proper clean up of stray promises when the node is transitioning to a passive state.

    Note: you should *not* invoke success on the returned promise but rather use trySuccess. The reason is that the call to success may fail in case of shutdown.

    Definition Classes
    PromiseUnlessShutdownFactory
  37. implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  38. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. def noTracingLogger: Logger
    Attributes
    protected
    Definition Classes
    NamedLogging
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. def numberOfEvents()(implicit traceContext: TraceContext): Future[Long]
    Attributes
    protected[state]
    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  43. def onCloseFailure(e: Throwable): Unit
    Attributes
    protected
    Definition Classes
    PerformUnlessClosing
  44. def onClosed(): Unit
    Attributes
    protected
    Definition Classes
    PerformUnlessClosing
  45. final def onFirstClose(): Unit

    Blocks until all earlier tasks have completed and then prevents further tasks from being run.

    Blocks until all earlier tasks have completed and then prevents further tasks from being run.

    Definition Classes
    PerformUnlessClosingOnShutdownRunner
    Annotations
    @SuppressWarnings()
  46. def performUnlessClosing[A](name: String)(f: => A)(implicit traceContext: TraceContext): UnlessShutdown[A]

    Performs the task given by f unless a shutdown has been initiated.

    Performs the task given by f unless a shutdown has been initiated. The shutdown will only begin after f completes, but other tasks may execute concurrently with f, if started using this function, or one of the other variants (performUnlessClosingF and performUnlessClosingEitherT). The tasks are assumed to take less than closingTimeout to complete.

    DO NOT CALL this.close as part of f, because it will result in a deadlock.

    f

    The task to perform

    returns

    scala.None$ if a shutdown has been initiated. Otherwise the result of the task.

    Definition Classes
    PerformUnlessClosing
  47. def performUnlessClosingCheckedT[A, N, R](name: String, onClosing: => Checked[A, N, R])(etf: => CheckedT[Future, A, N, R])(implicit ec: ExecutionContext, traceContext: TraceContext): CheckedT[Future, A, N, R]
    Definition Classes
    PerformUnlessClosing
  48. def performUnlessClosingEitherT[E, R](name: String, onClosing: => E)(etf: => EitherT[Future, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[Future, E, R]

    Performs the EitherT[Future] given by etf unless a shutdown has been initiated, in which case the provided error is returned instead.

    Performs the EitherT[Future] given by etf unless a shutdown has been initiated, in which case the provided error is returned instead. Both etf and the error are lazy; etf is only evaluated if there is no shutdown, the error only if we're shutting down. The shutdown will only begin after etf completes, but other tasks may execute concurrently with etf, if started using this function, or one of the other variants (performUnlessClosing and performUnlessClosingF). The tasks are assumed to take less than closingTimeout to complete.

    DO NOT CALL this.close as part of etf, because it will result in a deadlock.

    etf

    The task to perform

    Definition Classes
    PerformUnlessClosing
  49. def performUnlessClosingEitherTF[E, R](name: String, onClosing: => E)(etf: => EitherT[Future, E, Future[R]])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[Future, E, Future[R]]
    Definition Classes
    PerformUnlessClosing
  50. def performUnlessClosingEitherU[E, R](name: String)(etf: => EitherT[Future, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
    Definition Classes
    PerformUnlessClosing
  51. def performUnlessClosingEitherUSF[E, R](name: String)(etf: => EitherT[FutureUnlessShutdown, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
    Definition Classes
    PerformUnlessClosing
  52. def performUnlessClosingF[A](name: String)(f: => Future[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]

    Performs the Future given by f unless a shutdown has been initiated.

    Performs the Future given by f unless a shutdown has been initiated. The future is lazy and not evaluated during shutdown. The shutdown will only begin after f completes, but other tasks may execute concurrently with f, if started using this function, or one of the other variants (performUnlessClosing and performUnlessClosingEitherT). The tasks are assumed to take less than closingTimeout to complete.

    DO NOT CALL this.close as part of f, because it will result in a deadlock.

    f

    The task to perform

    returns

    The future completes with com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown if a shutdown has been initiated. Otherwise the result of the task wrapped in com.digitalasset.canton.lifecycle.UnlessShutdown.Outcome.

    Definition Classes
    PerformUnlessClosing
  53. def performUnlessClosingUSF[A](name: String)(f: => FutureUnlessShutdown[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
    Definition Classes
    PerformUnlessClosing
  54. def prune(requestedTimestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[PruningResult]
  55. def pruneExpiredInFlightAggregations(upToInclusive: CantonTimestamp)(implicit traceContext: TraceContext): Future[Unit]

    Removes all in-flight aggregations that have expired before or at the given timestamp

    Removes all in-flight aggregations that have expired before or at the given timestamp

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  56. def readAtBlockTimestamp(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[EphemeralState]

    Rehydrate the sequencer EphemeralState from the backing persisted store

    Rehydrate the sequencer EphemeralState from the backing persisted store

    timestamp

    The timestamp for which the EphemeralState is computed

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  57. def readAtBlockTimestampDBIO(timestamp: CantonTimestamp): resource.DbStorage.Profile.DbStorageAPI.DBIOAction[EphemeralState, resource.DbStorage.Profile.DbStorageAPI.NoStream, Read with Transactional]

    Compute the state up until (inclusive) the given timestamp.

  58. def readRange(member: Member, startInclusive: SequencerCounter, endExclusive: SequencerCounter)(implicit traceContext: TraceContext): Source[OrdinarySerializedEvent, NotUsed]

    Extract a range of events for a member.

    Extract a range of events for a member. It is expected that the sequencer will validate requests against its current state so read requests for unregistered members or counter ranges that do not exist should just return an empty source.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
    Exceptions thrown

    java.lang.IllegalArgumentException if startInclusive is not less than endExclusive

  59. def runOnShutdown[T](task: RunOnShutdown)(implicit traceContext: TraceContext): Long

    Same as runOnShutdown_ but returns a token that allows you to remove the task explicitly from being run using cancelShutdownTask

    Same as runOnShutdown_ but returns a token that allows you to remove the task explicitly from being run using cancelShutdownTask

    Definition Classes
    OnShutdownRunner
  60. def runOnShutdown_[T](task: RunOnShutdown)(implicit traceContext: TraceContext): Unit

    Register a task to run when shutdown is initiated.

    Register a task to run when shutdown is initiated.

    You can use this for example to register tasks that cancel long-running computations, whose termination you can then wait for in "closeAsync".

    Definition Classes
    OnShutdownRunner
  61. def runStateChanged(waitingState: Boolean = false): Unit
    Attributes
    protected
    Definition Classes
    OnShutdownRunner
    Annotations
    @VisibleForTesting()
  62. def saveLowerBound(ts: CantonTimestamp, maybeOnboardingTopologyTimestamp: Option[CantonTimestamp])(implicit traceContext: TraceContext): EitherT[Future, SaveLowerBoundError, Unit]

    Save an updated lower bound of events that can be read along with the optional timestamp of the initial onboarding topology snapshot.

    Save an updated lower bound of events that can be read along with the optional timestamp of the initial onboarding topology snapshot.

    The lower bound of events ts must be equal or greater than any prior set lower bound. The value of maybeOnboardingTopologyTimestamp is only set if nonEmpty and only on the initial call.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  63. def saveLowerBoundDBIO(eventsReadableStartingAt: CantonTimestamp, maybeOnboardingTopologyTimestamp: Option[CantonTimestamp] = None): All[Either[SaveLowerBoundError, Unit]]
  64. def status()(implicit traceContext: TraceContext): Future[InternalSequencerPruningStatus]

    Build a status object representing the current state of the sequencer.

    Build a status object representing the current state of the sequencer.

    Definition Classes
    DbSequencerStateManagerStoreSequencerStateManagerStore
  65. val storage: DbStorage
    Attributes
    protected
    Definition Classes
    DbSequencerStateManagerStoreDbStore
  66. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  67. val timeouts: ProcessingTimeout
    Attributes
    protected
    Definition Classes
    DbSequencerStateManagerStoreFlagCloseable
  68. def toString(): String
    Definition Classes
    AnyRef → Any
  69. def unregisterUnauthenticatedMember(member: UnauthenticatedMemberId): WriteOnly[Unit]
  70. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  71. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  72. 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
    Deprecated

Inherited from DbStore

Inherited from HasCloseContext

Inherited from NamedLogging

Inherited from FlagCloseable

Inherited from PerformUnlessClosing

Inherited from OnShutdownRunner

Inherited from AutoCloseable

Inherited from AnyRef

Inherited from Any

Ungrouped