com.digitalasset.canton.participant.store
StoredContractManager
Companion object StoredContractManager
class StoredContractManager extends NamedLogging with ContractLookup
Manages a contract store by keeping pending contracts in memory. ContractLookup.lookup finds these pending contracts in addition to those in the backing ContractStore. A contract ceases to be pending as soon as first request writes it to the backing store using StoredContractManager.commitIfPending.
Unlike ExtendedContractLookup, the pending contracts can be updated and committed to the backing store, concurrently with other contract lookups and additions.
- Alphabetic
- By Inheritance
- StoredContractManager
- ContractLookup
- NamedLogging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new StoredContractManager(store: ContractStore, loggerFactory: NamedLoggerFactory)(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
- def addPendingContracts(requestCounter: RequestCounter, contracts: Seq[WithTransactionId[SerializableContract]])(implicit traceContext: TraceContext): Future[Set[StoredContract]]
Adds the given contracts as pending, unless they are already in the store with a request counter.
Adds the given contracts as pending, unless they are already in the store with a request counter. If they are already pending, the request will be added only if the com.digitalasset.canton.protocol.SerializableContracts are the same.
Checking the contracts in the store is not atomic with adding them as pending.
- returns
The contracts whose com.digitalasset.canton.protocol.SerializableContract or creating com.digitalasset.canton.protocol.TransactionId differs from what is stored in the backing ContractStore with a request counter or among the pending contracts. In particular, this implies that those contracts are already pending or in the backing ContractStore with a request counter.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def commitIfPending(requestCounter: RequestCounter, contracts: Map[LfContractId, Boolean])(implicit traceContext: TraceContext): Future[Unit]
Writes the contracts mapped to
true
to the contract store provided that they are still pending and removes them from pending.Writes the contracts mapped to
true
to the contract store provided that they are still pending and removes them from pending. Marks contracts mapped tofalse
as not pending any more, unless another request still has marked them as pending. Does not check that the request has actually marked the contract as pending with addPendingContracts. - def deleteIfPending(requestCounter: RequestCounter, contracts: Set[LfContractId])(implicit traceContext: TraceContext): Future[Unit]
Removes given contracts from pending except if another contract has still marked them as pending.
- implicit val ec: ExecutionContext
- Attributes
- protected
- Definition Classes
- StoredContractManager → ContractLookup
- 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
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logger: TracedLogger
- Attributes
- protected[participant.store]
- Definition Classes
- StoredContractManager → ContractLookup → NamedLogging
- val loggerFactory: NamedLoggerFactory
- Definition Classes
- StoredContractManager → NamedLogging
- def lookup(id: LfContractId)(implicit traceContext: TraceContext): OptionT[Future, StoredContract]
Finds the contracts in the backing store and among the pending contracts.
Finds the contracts in the backing store and among the pending contracts.
- Definition Classes
- StoredContractManager → ContractLookup
- def lookupContract(id: LfContractId)(implicit traceContext: TraceContext): OptionT[Future, SerializableContract]
- Definition Classes
- ContractLookup
- def lookupContractE(id: LfContractId)(implicit traceContext: TraceContext): EitherT[Future, UnknownContract, SerializableContract]
- Definition Classes
- ContractLookup
- def lookupE(id: LfContractId)(implicit traceContext: TraceContext): EitherT[Future, UnknownContract, StoredContract]
- Definition Classes
- ContractLookup
- def lookupLfInstance(lfId: LfContractId)(implicit traceContext: TraceContext): OptionT[Future, LfContractInst]
Yields
None
(embedded in a Future) if the contract instance has not been stored or the id cannot be parsed.Yields
None
(embedded in a Future) if the contract instance has not been stored or the id cannot be parsed.Discards the serialization.
- Definition Classes
- ContractLookup
- def lookupManyUncached(ids: Seq[LfContractId])(implicit traceContext: TraceContext): Future[List[Option[StoredContract]]]
- Definition Classes
- ContractLookup
- def lookupStakeholders(ids: Set[LfContractId])(implicit traceContext: TraceContext): EitherT[Future, UnknownContracts, Map[LfContractId, Set[LfPartyId]]]
- Definition Classes
- StoredContractManager → ContractLookup
- 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
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def storeDivulgedContracts(requestCounter: RequestCounter, divulgences: Seq[SerializableContract])(implicit traceContext: TraceContext): EitherT[Future, NonEmptyChain[DuplicateContract], Unit]
Stores the given contracts as divulged in the contract store, checking them for consistency against pending contracts.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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])