Skip to content

Commit

Permalink
Add validation for DocumentDB Collection Config
Browse files Browse the repository at this point in the history
Signed-off-by: Dinu John <[email protected]>
  • Loading branch information
dinujoh committed May 14, 2024
1 parent 2975e1a commit 9d6510d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.opensearch.dataprepper.plugins.mongo.configuration;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;

Expand All @@ -23,11 +25,17 @@ public class CollectionConfig {
private boolean stream;

@JsonProperty("partition_count")
@Min(1)
@Max(1000)
private int partitionCount;

@JsonProperty("export_batch_size")
@Min(1)
@Max(1_000_000)
private int exportBatchSize;
@JsonProperty("stream_batch_size")
@Min(1)
@Max(1_000_000)
private int streamBatchSize;

public CollectionConfig() {
Expand Down

0 comments on commit 9d6510d

Please sign in to comment.