mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
participant-integration-api: Standardize tracker retention naming. (#10682)
Let's be clear that the "retention period" is for tracking. CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
2aa632e3aa
commit
b5f9be3fbc
@ -240,7 +240,7 @@ private[daml] object ApiServices {
|
||||
ledgerId,
|
||||
commandConfig.inputBufferSize,
|
||||
commandConfig.maxCommandsInFlight,
|
||||
commandConfig.retentionPeriod,
|
||||
commandConfig.trackerRetentionPeriod,
|
||||
),
|
||||
// Using local services skips the gRPC layer, improving performance.
|
||||
ApiCommandService.LocalServices(
|
||||
|
@ -164,7 +164,7 @@ private[apiserver] object ApiCommandService {
|
||||
loggingContext: LoggingContext,
|
||||
): CommandServiceGrpc.CommandService with GrpcApiService = {
|
||||
val submissionTracker = new TrackerMap.SelfCleaning(
|
||||
configuration.retentionPeriod,
|
||||
configuration.trackerRetentionPeriod,
|
||||
Tracking.getTrackerKey,
|
||||
Tracking.newTracker(configuration, services, ledgerConfigurationSubscription, metrics),
|
||||
trackerCleanupInterval,
|
||||
@ -184,7 +184,7 @@ private[apiserver] object ApiCommandService {
|
||||
ledgerId: LedgerId,
|
||||
inputBufferSize: Int,
|
||||
maxCommandsInFlight: Int,
|
||||
retentionPeriod: FiniteDuration,
|
||||
trackerRetentionPeriod: FiniteDuration,
|
||||
)
|
||||
|
||||
final case class LocalServices(
|
||||
|
@ -19,16 +19,16 @@ import scala.concurrent.duration.{DurationInt, FiniteDuration}
|
||||
* transaction has been shipped via the WriteService.
|
||||
* @param maxCommandsInFlight
|
||||
* Maximum number of submitted commands waiting to be completed for each party.
|
||||
* @param retentionPeriod
|
||||
* For how long the command service will keep an active command tracker for a given party.
|
||||
* A longer retention period allows to not instantiate a new tracker for a party that seldom acts.
|
||||
* A shorter retention period allows to quickly remove unused trackers.
|
||||
* @param trackerRetentionPeriod
|
||||
* The duration that the command service will keep an active command tracker for a given set
|
||||
* of parties. A longer period cuts down on the tracker instantiation cost for a party that
|
||||
* seldom acts. A shorter period causes a quick removal of unused trackers.
|
||||
*/
|
||||
final case class CommandConfiguration(
|
||||
inputBufferSize: Int,
|
||||
maxParallelSubmissions: Int,
|
||||
maxCommandsInFlight: Int,
|
||||
retentionPeriod: FiniteDuration,
|
||||
trackerRetentionPeriod: FiniteDuration,
|
||||
)
|
||||
|
||||
object CommandConfiguration {
|
||||
@ -39,6 +39,6 @@ object CommandConfiguration {
|
||||
inputBufferSize = 512,
|
||||
maxParallelSubmissions = 512,
|
||||
maxCommandsInFlight = 256,
|
||||
retentionPeriod = DefaultTrackerRetentionPeriod,
|
||||
trackerRetentionPeriod = DefaultTrackerRetentionPeriod,
|
||||
)
|
||||
}
|
||||
|
@ -372,13 +372,17 @@ object Config {
|
||||
opt[Duration]("tracker-retention-period")
|
||||
.optional()
|
||||
.action((value, config) =>
|
||||
config.copy(commandConfig =
|
||||
config.commandConfig
|
||||
.copy(retentionPeriod = FiniteDuration(value.getSeconds, TimeUnit.SECONDS))
|
||||
config.copy(
|
||||
commandConfig = config.commandConfig.copy(
|
||||
trackerRetentionPeriod = FiniteDuration(value.getSeconds, TimeUnit.SECONDS)
|
||||
)
|
||||
)
|
||||
)
|
||||
.text(
|
||||
s"How long will the command service keep an active command tracker for a given party. A longer period cuts down on the tracker instantiation cost for a party that seldom acts. A shorter period causes a quick removal of unused trackers. Default is ${CommandConfiguration.DefaultTrackerRetentionPeriod}."
|
||||
"The duration that the command service will keep an active command tracker for a given set of parties." +
|
||||
" A longer period cuts down on the tracker instantiation cost for a party that seldom acts." +
|
||||
" A shorter period causes a quick removal of unused trackers." +
|
||||
s" Default is ${CommandConfiguration.DefaultTrackerRetentionPeriod}."
|
||||
)
|
||||
|
||||
opt[Int]("max-inbound-message-size")
|
||||
|
@ -118,7 +118,7 @@ final class ConfigSpec
|
||||
)
|
||||
.getOrElse(parsingFailure())
|
||||
|
||||
config.commandConfig.retentionPeriod should be(expectedPeriod)
|
||||
config.commandConfig.trackerRetentionPeriod should be(expectedPeriod)
|
||||
}
|
||||
|
||||
it should "set the client-auth parameter when provided" in {
|
||||
|
Loading…
Reference in New Issue
Block a user