Skip to content

Commit

Permalink
Add upper bounds for new options
Browse files Browse the repository at this point in the history
Signed-off-by: Hai Yan <oeyh@amazon.com>
  • Loading branch information
oeyh committed Sep 19, 2024
1 parent 3f0ff88 commit 8f6b5e6
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
package org.opensearch.dataprepper.plugins.sink.s3.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import org.hibernate.validator.constraints.time.DurationMax;
import org.hibernate.validator.constraints.time.DurationMin;

import java.time.Duration;
Expand All @@ -17,10 +19,12 @@ public class ClientOptions {

@JsonProperty("max_connections")
@Min(1)
@Max(5000)
private int maxConnections = DEFAULT_MAX_CONNECTIONS;

@JsonProperty("acquire_timeout")
@DurationMin(seconds = 1)
@DurationMax(seconds = 3600)
private Duration acquireTimeout = DEFAULT_ACQUIRE_TIMEOUT;

public int getMaxConnections() {
Expand Down

0 comments on commit 8f6b5e6

Please sign in to comment.