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:
Samir Talwar 2021-08-26 13:56:22 +02:00 committed by GitHub
parent 2aa632e3aa
commit b5f9be3fbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 14 deletions

View File

@ -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(

View File

@ -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(

View File

@ -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,
)
}

View File

@ -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")

View File

@ -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 {