Skip to content

Commit

Permalink
Apply validation consistently for lambda timeout properties
Browse files Browse the repository at this point in the history
  • Loading branch information
patchwork01 committed Dec 13, 2024
1 parent 6cce7c3 commit df02e1a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public interface BatcherProperty {
UserDefinedInstanceProperty INGEST_BATCHER_SUBMITTER_TIMEOUT_IN_SECONDS = Index.propertyBuilder("sleeper.ingest.batcher.submitter.timeout.seconds")
.description("The timeout in seconds for the lambda that receives submitted requests to ingest files.")
.defaultValue("20")
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.INGEST)
.runCdkDeployWhenChanged(true).build();
UserDefinedInstanceProperty INGEST_BATCHER_JOB_CREATION_MEMORY_IN_MB = Index.propertyBuilder("sleeper.ingest.batcher.job.creation.memory.mb")
Expand All @@ -43,6 +44,7 @@ public interface BatcherProperty {
UserDefinedInstanceProperty INGEST_BATCHER_JOB_CREATION_TIMEOUT_IN_SECONDS = Index.propertyBuilder("sleeper.ingest.batcher.job.creation.timeout.seconds")
.description("The timeout in seconds for the lambda that creates ingest jobs from submitted file ingest requests.")
.defaultValue("900")
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.INGEST)
.runCdkDeployWhenChanged(true).build();
UserDefinedInstanceProperty INGEST_BATCHER_JOB_CREATION_LAMBDA_PERIOD_IN_MINUTES = Index.propertyBuilder("sleeper.ingest.batcher.job.creation.period.minutes")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public interface PartitionSplittingProperty {
UserDefinedInstanceProperty FIND_PARTITIONS_TO_SPLIT_TIMEOUT_IN_SECONDS = Index.propertyBuilder("sleeper.partition.splitting.finder.timeout.seconds")
.description("The timeout in seconds for the lambda function used to identify partitions that need to be split.")
.defaultValue("900")
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.PARTITION_SPLITTING)
.runCdkDeployWhenChanged(true).build();
UserDefinedInstanceProperty FIND_PARTITIONS_TO_SPLIT_LAMBDA_CONCURRENCY_RESERVED = Index.propertyBuilder("sleeper.partition.splitting.finder.concurrency.reserved")
Expand All @@ -76,6 +77,7 @@ public interface PartitionSplittingProperty {
UserDefinedInstanceProperty SPLIT_PARTITIONS_TIMEOUT_IN_SECONDS = Index.propertyBuilder("sleeper.partition.splitting.timeout.seconds")
.description("The timeout in seconds for the lambda function used to split partitions.")
.defaultValue("900")
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.PARTITION_SPLITTING)
.runCdkDeployWhenChanged(true).build();
UserDefinedInstanceProperty SPLIT_PARTITIONS_RESERVED_CONCURRENCY = Index.propertyBuilder("sleeper.partition.splitting.reserved.concurrency")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public interface QueryProperty {
UserDefinedInstanceProperty QUERY_PROCESSOR_LAMBDA_TIMEOUT_IN_SECONDS = Index.propertyBuilder("sleeper.query.processor.timeout.seconds")
.description("The timeout for the lambda that executes queries in seconds.")
.defaultValue("900")
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.QUERY)
.runCdkDeployWhenChanged(true).build();
UserDefinedInstanceProperty QUERY_PROCESSING_LAMBDA_STATE_REFRESHING_PERIOD_IN_SECONDS = Index.propertyBuilder("sleeper.query.processor.state.refresh.period.seconds")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static UserDefinedInstancePropertyImpl.Builder propertyBuilder(String pr
.description("The timeout in seconds for lambdas that create batches of tables to run some operation against, " +
"eg. create compaction jobs, run garbage collection, perform partition splitting.")
.defaultValue("60")
.validationPredicate(SleeperPropertyValueUtils::isPositiveInteger)
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.TABLE_STATE)
.build();
UserDefinedInstanceProperty TABLE_PROPERTIES_PROVIDER_TIMEOUT_IN_MINS = Index.propertyBuilder("sleeper.cache.table.properties.provider.timeout.minutes")
Expand Down Expand Up @@ -112,7 +112,7 @@ private static UserDefinedInstancePropertyImpl.Builder propertyBuilder(String pr
UserDefinedInstanceProperty SNAPSHOT_CREATION_LAMBDA_TIMEOUT_IN_SECONDS = Index.propertyBuilder("sleeper.statestore.snapshot.creation.lambda.timeout.seconds")
.description("The timeout in seconds after which to terminate the transaction log snapshot creation lambda.")
.defaultValue("900")
.validationPredicate(SleeperPropertyValueUtils::isPositiveInteger)
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.propertyGroup(InstancePropertyGroup.TABLE_STATE)
.build();
UserDefinedInstanceProperty SNAPSHOT_CREATION_LAMBDA_MEMORY = Index.propertyBuilder("sleeper.statestore.snapshot.creation.memory.mb")
Expand Down Expand Up @@ -178,7 +178,7 @@ private static UserDefinedInstancePropertyImpl.Builder propertyBuilder(String pr
.propertyGroup(InstancePropertyGroup.TABLE_STATE).build();
UserDefinedInstanceProperty TRANSACTION_DELETION_LAMBDA_TIMEOUT_SECS = Index.propertyBuilder("sleeper.statestore.transaction.deletion.lambda.timeout.seconds")
.description("The maximum timeout for the transaction deletion lambda in seconds.")
.validationPredicate(SleeperPropertyValueUtils::isPositiveInteger)
.validationPredicate(SleeperPropertyValueUtils::isValidLambdaTimeout)
.defaultValue("900")
.propertyGroup(InstancePropertyGroup.TABLE_STATE).build();
UserDefinedInstanceProperty TABLE_INDEX_DYNAMO_POINT_IN_TIME_RECOVERY = Index.propertyBuilder("sleeper.tables.index.dynamo.pointintimerecovery")
Expand Down

0 comments on commit df02e1a

Please sign in to comment.