Packages

c

com.digitalasset.canton.domain.block.data.db

DbSequencerBlockStore

class DbSequencerBlockStore extends SequencerBlockStore with DbStore

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DbSequencerBlockStore
  2. DbStore
  3. HasCloseContext
  4. NamedLogging
  5. FlagCloseable
  6. AutoCloseable
  7. SequencerBlockStore
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DbSequencerBlockStore(storage: DbStorage, protocolVersion: ProtocolVersion, timeouts: ProcessingTimeout, checkedInvariant: Option[Member], loggerFactory: NamedLoggerFactory)(implicit executionContext: ExecutionContext)

    checkedInvariant

    Defines whether all methods should check the block invariant when they modify the state. Invariant checking is slow. It should only be enabled for testing and debugging. scala.Some$ defines the member under whom the sequencer's topology client subscribes.

Type Members

  1. case class ReaderState(count: Int, readers: MultiSet[String]) extends Product with Serializable
    Definition Classes
    FlagCloseable

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 addBlockUpdates(block: BlockInfo, newMembers: MemberTimestamps = Map.empty, events: Seq[MemberSignedEvents] = Seq.empty, acknowledgments: MemberTimestamps = Map.empty, membersDisabled: Seq[Member] = Seq.empty)(implicit traceContext: TraceContext): Future[Unit]

    Store all events that happened within the block with the given height.

    Store all events that happened within the block with the given height. Shorthand for partialBlockUpdate immediately followed by finalizeBlockUpdate.

    Definition Classes
    SequencerBlockStore
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def blockInvariant(topologyClientMember: Member, currentBlock: BlockInfo, prevBlockO: Option[BlockInfo], allEventsInBlock: Map[Member, NonEmpty[Seq[OrdinarySerializedEvent]]], newMembersInBlock: Iterable[(Member, CantonTimestamp)])(implicit loggingContext: ErrorLoggingContext): Unit

    Check the invariant for a block in the store:

    Check the invariant for a block in the store:

    topologyClientMember

    The member under whom the sequencer's topology client subscribes

    currentBlock

    The block info of the current block

    prevBlockO

    The block info of the block preceding the currentBlock, unless the current block is the initial state

    allEventsInBlock

    All events in the current block

    newMembersInBlock

    All member registrations that happened in the block

    Attributes
    protected
    Definition Classes
    SequencerBlockStore
    Exceptions thrown

    java.lang.IllegalStateException if the invariant is violated

  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  8. 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
    FlagCloseable → AutoCloseable
    Annotations
    @SuppressWarnings()
  9. implicit val closeContext: CloseContext
    Definition Classes
    HasCloseContext
  10. def closingTimeout: FiniteDuration
    Attributes
    protected
    Definition Classes
    FlagCloseable
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  13. implicit def errorLoggingContext(implicit traceContext: TraceContext): ErrorLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  14. implicit val executionContext: ExecutionContext
    Attributes
    protected
    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  15. def finalizeBlockUpdate(block: BlockInfo)(implicit traceContext: TraceContext): Future[Unit]

    Finalizes the current block whose updates have been added in the calls to partialBlockUpdate since the last call to finalizeBlockUpdate.

    Finalizes the current block whose updates have been added in the calls to partialBlockUpdate since the last call to finalizeBlockUpdate.

    This method must not be called concurrently with itself or partialBlockUpdate, and must be called for the blocks in monotonically increasing order of height.

    block

    The block information about the current block. It is the responsibility of the caller to ensure that the height increases monotonically by one

    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  17. def getInitialState(implicit traceContext: TraceContext): Future[BlockEphemeralState]

    Get initial state from which this sequencer node supports serving requests.

    Get initial state from which this sequencer node supports serving requests. The member counters returned as part of this initial state indicate the minimum counters that this sequencer supports serving requests from. If a member is not included in these counters, it means that this sequencer node supports serving requests from the com.digitalasset.canton.GenesisSequencerCounter for that member.

    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. def internalPerformUnlessClosingF[A](name: String)(f: => Future[A])(implicit ec: ExecutionContext, traceContext: TraceContext): UnlessShutdown[Future[A]]
    Attributes
    protected
    Definition Classes
    FlagCloseable
  20. 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
    FlagCloseable
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. 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
    FlagCloseable
  23. def logger: TracedLogger
    Attributes
    protected
    Definition Classes
    NamedLogging
  24. val loggerFactory: NamedLoggerFactory
    Attributes
    protected
    Definition Classes
    DbSequencerBlockStoreNamedLogging
  25. def maxSleepMillis: Long
    Attributes
    protected
    Definition Classes
    FlagCloseable
  26. implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def noTracingLogger: Logger
    Attributes
    protected
    Definition Classes
    NamedLogging
  29. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  30. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. def onClosed(): Unit
    Attributes
    protected
    Definition Classes
    FlagCloseable
  32. def partialBlockUpdate(newMembers: MemberTimestamps, events: Seq[MemberSignedEvents], acknowledgments: MemberTimestamps, membersDisabled: Seq[Member])(implicit traceContext: TraceContext): Future[Unit]

    Stores some updates that happen in a single block.

    Stores some updates that happen in a single block. May be called several times for the same block and the same update may be contained in several of the calls. Before adding updates of a subsequent block, finalizeBlockUpdate must be called to wrap up the current block.

    This method must not be called concurrently with itself or finalizeBlockUpdate.

    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  33. 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
    FlagCloseable
  34. 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
    FlagCloseable
  35. 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
    FlagCloseable
  36. def performUnlessClosingEitherU[E, R](name: String)(etf: => EitherT[Future, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
    Definition Classes
    FlagCloseable
  37. 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
    FlagCloseable
  38. def performUnlessClosingUSF[A](name: String)(f: => FutureUnlessShutdown[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
    Definition Classes
    FlagCloseable
  39. def prune(requestedTimestamp: CantonTimestamp)(implicit traceContext: TraceContext): Future[String]
  40. def pruningStatus()(implicit traceContext: TraceContext): Future[InternalSequencerPruningStatus]
  41. def readHead(implicit traceContext: TraceContext): Future[BlockEphemeralState]

    The current state of the sequencer, which can be used when the node is restarted to deterministically derive the following counters and timestamps.

    The current state of the sequencer, which can be used when the node is restarted to deterministically derive the following counters and timestamps.

    The state excludes updates of unfinalized blocks added with partialBlockUpdate.

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

    Serve events for member with the given counter range.

    Serve events for member with the given counter range.

    The returned range may include events added with partialBlockUpdate even before the corresponding block has been finalized with finalizeBlockUpdate. This ensures that com.digitalasset.canton.sequencing.client.SequencerClients can immediately read events when they are added. In particular, the sequencer's com.digitalasset.canton.topology.client.DomainTopologyClient will see such updates so that block processing can request a com.digitalasset.canton.topology.client.TopologySnapshot that includes the updates in a block while processing continues for the same block.

    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  43. def readStateForBlockContainingTimestamp(timestamp: CantonTimestamp)(implicit traceContext: TraceContext): EitherT[Future, InvalidTimestamp, BlockEphemeralState]

    The state at the end of the block that contains the given timestamp.

    The state at the end of the block that contains the given timestamp. This will typically be used to inform other sequencer nodes being initialized of the initial state they should use based on the timestamp they provide which is typically the timestamp of their signing key.

    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  44. def runOnShutdown[T](task: RunOnShutdown)(implicit traceContext: TraceContext): Unit

    Register a task that will run onClose after all "performUnlessShutdown" tasks have finished

    Register a task that will run onClose after all "performUnlessShutdown" tasks have finished

    Definition Classes
    FlagCloseable
  45. def runStateChanged(waitingState: Boolean = false): Unit
    Attributes
    protected
    Definition Classes
    FlagCloseable
    Annotations
    @VisibleForTesting()
  46. def setInitialState(initial: BlockEphemeralState)(implicit traceContext: TraceContext): Future[Unit]

    Set initial state of the sequencer node from which it supports serving requests.

    Set initial state of the sequencer node from which it supports serving requests. This should be called at most once. If not called, it means this sequencer node can server requests from genesis.

    Definition Classes
    DbSequencerBlockStoreSequencerBlockStore
  47. val storage: DbStorage
    Attributes
    protected
    Definition Classes
    DbSequencerBlockStoreDbStore
  48. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  49. val timeouts: ProcessingTimeout
    Attributes
    protected
    Definition Classes
    DbSequencerBlockStoreFlagCloseable
  50. def toString(): String
    Definition Classes
    AnyRef → Any
  51. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  52. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  53. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  54. object ReaderState extends Serializable
    Definition Classes
    FlagCloseable

Deprecated Value Members

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

Inherited from DbStore

Inherited from HasCloseContext

Inherited from NamedLogging

Inherited from FlagCloseable

Inherited from AutoCloseable

Inherited from SequencerBlockStore

Inherited from AnyRef

Inherited from Any

Ungrouped