com.digitalasset.canton.sequencing.traffic
TrafficConsumedManager
Companion object TrafficConsumedManager
class TrafficConsumedManager extends NamedLogging
Holds the traffic consumed state of a member. This is used by the sequencer to keep track of the traffic consumed by its members, as well as by the members themselves in the TrafficStateController to keep track of their own traffic consumed.
- Alphabetic
- By Inheritance
- TrafficConsumedManager
- NamedLogging
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TrafficConsumedManager(member: Member, initValue: TrafficConsumed, loggerFactory: NamedLoggerFactory, metrics: TrafficConsumptionMetrics)
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def canConsumeAt(params: TrafficControlParameters, cost: NonNegativeLong, timestamp: CantonTimestamp, trafficPurchasedO: Option[TrafficPurchased])(implicit traceContext: TraceContext): Either[NotEnoughTraffic, Unit]
Validate that the event cost is below the traffic limit at the provided timestamp.
Validate that the event cost is below the traffic limit at the provided timestamp. DOES NOT debit the cost from the traffic state.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def consumeIfEnoughTraffic(params: TrafficControlParameters, eventCost: NonNegativeLong, timestamp: CantonTimestamp, trafficPurchasedO: Option[TrafficPurchased])(implicit traceContext: TraceContext, metricsContext: MetricsContext): Either[NotEnoughTraffic, TrafficConsumed]
Consume the event cost at the given timestamp if enough traffic is available.
Consume the event cost at the given timestamp if enough traffic is available. This MUST be called sequentially.
- 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
- @IntrinsicCandidate() @native()
- def getTrafficConsumed: TrafficConsumed
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logger: TracedLogger
- Attributes
- protected
- Definition Classes
- NamedLogging
- val loggerFactory: NamedLoggerFactory
- Definition Classes
- TrafficConsumedManager → NamedLogging
- val member: Member
- 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
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def updateAt(timestamp: CantonTimestamp, params: TrafficControlParameters, logger: TracedLogger)(implicit traceContext: TraceContext, metricsContext: MetricsContext): TrafficConsumed
Update the traffic consumed state to the given timestamp, including updating base rate remainder, ONLY if it's not already up to date.
- def updateWithReceipt(trafficReceipt: TrafficReceipt, timestamp: CantonTimestamp)(implicit metricsContext: MetricsContext): Boolean
Update the traffic consumed state with the provided receipt only if it is more recent.
Update the traffic consumed state with the provided receipt only if it is more recent.
- returns
true if the state was updated.
- 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])