class ReassignmentCache extends ReassignmentLookup with NamedLogging with FlagCloseable

Adds an in-memory cache of pending completions on top of a store.ReassignmentStore. Completions appear atomic to reassignment lookups that go through the cache, even if they are written to the store only later.

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReassignmentCache
  2. FlagCloseable
  3. PerformUnlessClosing
  4. HasSynchronizeWithReaders
  5. OnShutdownRunner
  6. HasRunOnClosing
  7. HasUnlessClosing
  8. AutoCloseable
  9. NamedLogging
  10. ReassignmentLookup
  11. AnyRef
  12. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new ReassignmentCache(reassignmentStore: ReassignmentStore, futureSupervisor: FutureSupervisor, timeouts: ProcessingTimeout, loggerFactory: NamedLoggerFactory)(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 addReader(reader: String)(implicit traceContext: TraceContext): UnlessShutdown[ReaderHandle]

    TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more

    TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more

    Attributes
    protected[this]
    Definition Classes
    HasSynchronizeWithReaders
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. 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
  8. def closingTimeout: FiniteDuration
    Attributes
    protected
    Definition Classes
    FlagCloseablePerformUnlessClosing
  9. def completeReassignment(reassignmentId: ReassignmentId, tsCompletion: CantonTimestamp)(implicit traceContext: TraceContext): CheckedT[FutureUnlessShutdown, Nothing, ReassignmentStoreError, Unit]

    Completes the given reassignment with the given tsCompletion.

    Completes the given reassignment with the given tsCompletion. Completion appears atomic to reassignment lookups that go through the cache.

    returns

    The future completes when this completion or a completion of the same reassignment by an earlier request has been written to the underlying store.ReassignmentStore.

  10. implicit val ec: ExecutionContext
  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. def findAfter(requestAfter: Option[(CantonTimestamp, Source[SynchronizerId])], limit: Int)(implicit traceContext: TraceContext): FutureUnlessShutdown[Seq[UnassignmentData]]

    Find utility to look for in-flight reassignments.

    Find utility to look for in-flight reassignments. Reassignments are ordered by the tuple (request timestamp, source synchronizer id), ie reassignments are ordered by request timestamps and ties are broken with lexicographic ordering on synchronizer ids.

    The ordering here has been chosen to allow a participant to fetch all the pending reassignments. The ordering has to be consistent accross calls and uniquely identify a pending reassignment, but is otherwise arbitrary.

    requestAfter

    optionally, specify a strict lower bound for the reassignments returned, according to the (request timestamp, source synchronizer id) ordering

    limit

    limit the number of results

    Definition Classes
    ReassignmentCacheReassignmentLookup
  15. def findContractReassignmentId(contractIds: Seq[LfContractId], sourceSynchronizer: Option[Source[SynchronizerId]], unassignmentTs: Option[CantonTimestamp], completionTs: Option[CantonTimestamp])(implicit traceContext: TraceContext): FutureUnlessShutdown[Map[LfContractId, Seq[ReassignmentId]]]

    Queries the reassignment ids for the given contract ids.

    Queries the reassignment ids for the given contract ids. Optional filtering by unassignment and completion (assignment) timestamps, and by source synchronizer.

    Definition Classes
    ReassignmentCacheReassignmentLookup
  16. def findEarliestIncomplete()(implicit traceContext: TraceContext): FutureUnlessShutdown[Option[(Offset, ReassignmentId, Target[SynchronizerId])]]

    Find utility to look for the earliest incomplete reassignment w.r.t.

    Find utility to look for the earliest incomplete reassignment w.r.t. the ledger end. If an incomplete reassignment exists, the method returns the global offset of the incomplete reassignment for either the unassignment or the assignment, whichever of these is not null, the reassignment id and the target synchronizer id. It returns None if there is no incomplete reassignment (either because all reassignments are complete or are in-flight, or because there are no reassignments), or the reassignment table is empty.

    Definition Classes
    ReassignmentCacheReassignmentLookup
  17. def findIncomplete(sourceSynchronizer: Option[Source[SynchronizerId]], validAt: Offset, stakeholders: Option[NonEmpty[Set[LfPartyId]]], limit: NonNegativeInt)(implicit traceContext: TraceContext): FutureUnlessShutdown[Seq[IncompleteReassignmentData]]

    unassignment/assignment global offsets will be updated upon publication on Ledger API Indexer, when the global offset is assigned to the event.

    unassignment/assignment global offsets will be updated upon publication on Ledger API Indexer, when the global offset is assigned to the event. In order to avoid race conditions, the multi-synchronizer event log will wait for the calls to ReassignmentStore.addReassignmentOffsets to complete before updating ledger end. Hence, we don't need additional synchronization here and we can directly query the store.

    sourceSynchronizer

    if empty, select only reassignments whose source synchronizer matches the given one

    validAt

    select only reassignments that are successfully unassigned

    stakeholders

    if non-empty, select only reassignments of contracts whose set of stakeholders intersects stakeholders.

    limit

    limit the number of results

    Definition Classes
    ReassignmentCacheReassignmentLookup
  18. def findReassignmentEntry(reassignmentId: ReassignmentId)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, UnknownReassignmentId, ReassignmentEntry]
  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  21. def isClosing: Boolean

    Check whether we're closing.

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

    Definition Classes
    OnShutdownRunnerHasUnlessClosing
  22. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  23. def keepTrackOfReaderCallStack: Boolean

    Set this to true to get detailed information about all futures that did not complete during shutdown.

    Set this to true to get detailed information about all futures that did not complete during shutdown.

    Attributes
    protected[this]
    Definition Classes
    PerformUnlessClosingHasSynchronizeWithReaders
  24. def listInFlightReassignmentIds()(implicit traceContext: TraceContext): FutureUnlessShutdown[Seq[ReassignmentId]]
  25. def logger: TracedLogger
    Attributes
    protected
    Definition Classes
    NamedLogging
  26. val loggerFactory: NamedLoggerFactory
    Definition Classes
    ReassignmentCacheNamedLogging
  27. def lookup(reassignmentId: ReassignmentId)(implicit traceContext: TraceContext): EitherT[FutureUnlessShutdown, ReassignmentLookupError, UnassignmentData]

    Looks up the given in-flight reassignment and returns the data associated with the reassignment.

    Looks up the given in-flight reassignment and returns the data associated with the reassignment.

    returns

    scala.Left$(ReassignmentStore.UnknownReassignmentId) if the reassignment is unknown; scala.Left$(ReassignmentStore.ReassignmentCompleted) if the reassignment has already been completed.

    Definition Classes
    ReassignmentCacheReassignmentLookup
  28. 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
  29. def nameInternal: String
    Attributes
    protected[this]
    Definition Classes
    PerformUnlessClosingHasSynchronizeWithReaders
  30. implicit def namedLoggingContext(implicit traceContext: TraceContext): NamedLoggingContext
    Attributes
    protected
    Definition Classes
    NamedLogging
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. def noTracingLogger: Logger
    Attributes
    protected
    Definition Classes
    NamedLogging
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  35. def onCloseFailure(e: Throwable): Unit
    Attributes
    protected
    Definition Classes
    PerformUnlessClosing
  36. def onClosed(): Unit
  37. 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()
  38. 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. DO NOT PUT retries, especially indefinite ones, inside f.

    f

    The task to perform

    returns

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

    Definition Classes
    PerformUnlessClosing
  39. 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
  40. def performUnlessClosingCheckedUST[A, N, R](name: String, onClosing: => Checked[A, N, R])(etf: => CheckedT[FutureUnlessShutdown, A, N, R])(implicit ec: ExecutionContext, traceContext: TraceContext): CheckedT[FutureUnlessShutdown, A, N, R]
    Definition Classes
    PerformUnlessClosing
  41. 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. DO NOT PUT retries, especially indefinite ones, inside f.

    etf

    The task to perform

    Definition Classes
    PerformUnlessClosing
  42. def performUnlessClosingEitherU[E, R](name: String)(etf: => EitherT[Future, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
    Definition Classes
    PerformUnlessClosing
  43. def performUnlessClosingEitherUSF[E, R](name: String)(etf: => EitherT[FutureUnlessShutdown, E, R])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]
    Definition Classes
    PerformUnlessClosing
  44. def performUnlessClosingEitherUSFAsync[E, R](name: String)(etf: => EitherT[FutureUnlessShutdown, E, R])(asyncResultToWaitForF: (R) => FutureUnlessShutdown[_])(implicit ec: ExecutionContext, traceContext: TraceContext): EitherT[FutureUnlessShutdown, E, R]

    Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.

    Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.

    etf

    closing of this object will wait for all such spawned Futures to finish

    asyncResultToWaitForF

    closing of this object will wait also wait for all such asynchronous Futures to finish too

    returns

    the future spawned by etf

    Definition Classes
    PerformUnlessClosing
  45. 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. DO NOT PUT retries, especially indefinite ones, inside f.

    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
  46. def performUnlessClosingOptionUSF[R](name: String)(otf: => OptionT[FutureUnlessShutdown, R])(implicit ec: ExecutionContext, traceContext: TraceContext): OptionT[FutureUnlessShutdown, R]
    Definition Classes
    PerformUnlessClosing
  47. def performUnlessClosingUSF[A](name: String)(f: => FutureUnlessShutdown[A])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]
    Definition Classes
    PerformUnlessClosing
  48. def performUnlessClosingUSFAsync[A](name: String)(f: => FutureUnlessShutdown[A])(asyncResultToWaitForF: (A) => FutureUnlessShutdown[_])(implicit ec: ExecutionContext, traceContext: TraceContext): FutureUnlessShutdown[A]

    Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.

    Use this method if closing/shutdown of the object should wait for asynchronous computation to finish too.

    f

    closing of this object will wait for all such spawned Futures to finish

    asyncResultToWaitForF

    closing of this object will wait also wait for all such asynchronous Futures to finish too

    returns

    the future spawned by f

    Definition Classes
    PerformUnlessClosing
  49. def remainingReaders(): Seq[String]
    Attributes
    protected[this]
    Definition Classes
    HasSynchronizeWithReaders
  50. def removeReader(handle: ReaderHandle): Unit

    TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more

    TODO(#16601) Make this method private once PerformUnlessClosing doesn't need it any more

    Attributes
    protected[this]
    Definition Classes
    HasSynchronizeWithReaders
  51. def runOnClose(task: RunOnClosing): UnlessShutdown[LifeCycleRegistrationHandle]

    Schedules the given task to be run upon closing.

    Schedules the given task to be run upon closing.

    returns

    An com.digitalasset.canton.lifecycle.UnlessShutdown.Outcome indicates that the task will have been run when the LifeCycleManager's closeAsync method completes or when AutoCloseable's close method returns, unless the returned LifeCycleRegistrationHandle was used to cancel the task or the task has been done beforehand. com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown if the task is not run due to closing. This always happens if isClosing returns true.

    Definition Classes
    OnShutdownRunnerHasRunOnClosing
  52. def runOnOrAfterClose(task: RunOnClosing)(implicit traceContext: TraceContext): LifeCycleRegistrationHandle

    Register a task to run when closing is initiated, or run it immediately if closing is already ongoing.

    Register a task to run when closing is initiated, or run it immediately if closing is already ongoing. Unlike runOnClose, this method does not guarantee that this task will have run by the time the LifeCycleManager's closeAsync method completes or AutoCloseable's close returns. This is because the task is run immediately if the component has already been closed.

    Definition Classes
    HasRunOnClosing
  53. final def runOnOrAfterClose_(task: RunOnClosing)(implicit traceContext: TraceContext): Unit

    Variant of runOnOrAfterClose that does not return a com.digitalasset.canton.lifecycle.LifeCycleRegistrationHandle.

  54. def runTaskUnlessDone(task: RunOnClosing)(implicit traceContext: TraceContext): Unit
    Attributes
    protected[this]
    Definition Classes
    OnShutdownRunnerHasRunOnClosing
  55. def synchronizeWithClosingPatience: FiniteDuration
    Attributes
    protected[this]
    Definition Classes
    PerformUnlessClosingHasSynchronizeWithReaders
  56. def synchronizeWithReaders()(implicit traceContext: TraceContext): Boolean
    Attributes
    protected[this]
    Definition Classes
    HasSynchronizeWithReaders
  57. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  58. val timeouts: ProcessingTimeout
    Attributes
    protected
    Definition Classes
    ReassignmentCacheFlagCloseable
  59. def toString(): String
    Definition Classes
    AnyRef → Any
  60. final def unlessClosing[F[_], A](fa: => F[A])(implicit F: CanAbortDueToShutdown[F]): F[A]

    Runs the computation fa unless isClosing returns true.

    Runs the computation fa unless isClosing returns true.

    This method does not delay the closing while fa is running, unlike the methods in HasSynchronizeWithClosing. Accordingly, this method is useful for intermittent checks whether the result of the computation is still relevant.

    returns

    The result of fa or com.digitalasset.canton.lifecycle.UnlessShutdown.AbortedDueToShutdown if isClosing is true

    Definition Classes
    HasUnlessClosing
    Annotations
    @inline()
  61. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  62. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  63. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  64. def withReader[F[_], A](name: String)(f: => F[A])(implicit traceContext: TraceContext, F: Thereafter[F]): UnlessShutdown[F[A]]
    Attributes
    protected[this]
    Definition Classes
    HasSynchronizeWithReaders

Deprecated Value Members

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

    (Since version 9)

Inherited from FlagCloseable

Inherited from PerformUnlessClosing

Inherited from OnShutdownRunner

Inherited from HasRunOnClosing

Inherited from HasUnlessClosing

Inherited from AutoCloseable

Inherited from NamedLogging

Inherited from ReassignmentLookup

Inherited from AnyRef

Inherited from Any

Ungrouped