Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting value from environment variables for maxBufferingDurationMs. … #14

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ The template allows for the user to supply the following optional parameter:

- **nonTokenizedDeadLetterPath**: Folder where failed to tokenize data will be stored

The template also allows user to override the environment variable:

- **MAX_BUFFERING_DURATION_MS**: Max duration of buffering rows in milliseconds. Default value: 100ms.

in the following format:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public class DataProtectors {
private static final Logger LOG = LoggerFactory.getLogger(DataProtectors.class);

public static final String ID_FIELD_NAME = "ID";
private static final Integer MAX_BUFFERING = 100;
private static final Long MAX_BUFFERING_DURATION_MS =
Long.valueOf(System.getenv().getOrDefault("MAX_BUFFERING_DURATION_MS", "100"));

/**
* The {@link RowToTokenizedRow} transform converts {@link Row} to {@link TableRow} objects. The
Expand Down Expand Up @@ -107,7 +108,7 @@ public PCollectionTuple expand(PCollection<KV<Integer, Row>> inputRows) {
FailsafeElementCoder<Row, Row> coder =
FailsafeElementCoder.of(RowCoder.of(schema()), RowCoder.of(schema()));

Duration maxBuffering = Duration.millis(MAX_BUFFERING);
Duration maxBuffering = Duration.millis(MAX_BUFFERING_DURATION_MS);
PCollectionTuple pCollectionTuple =
inputRows
.apply(
Expand Down