Skip to content

Commit

Permalink
conditionally set fields if non-null
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Stehler authored and shyamsfo committed Jun 9, 2021
1 parent dc6fc65 commit e492a53
Showing 1 changed file with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,24 @@ private LambdaEventConfigurationDescription formEventObject(String curr, LambdaU
taskInput.setStartingPosition(DEFAULT_STARTING_POSITION);
}

singleEvent.setBisectBatchOnError(taskInput.getBisectBatchOnError());
if (taskInput.getBisectBatchOnError() != null) {
singleEvent.setBisectBatchOnError(taskInput.getBisectBatchOnError());
}

singleEvent.setDestinationConfig(formDestinationConfig(taskInput));
singleEvent.setMaxRecordAgeSecs(taskInput.getMaxRecordAgeSecs());
singleEvent.setMaxRetryAttempts(taskInput.getMaxRetryAttempts());
singleEvent.setParallelizationFactor(taskInput.getParallelizationFactor());

if (taskInput.getMaxRecordAgeSecs() != null) {
singleEvent.setMaxRecordAgeSecs(taskInput.getMaxRecordAgeSecs());
}

if (taskInput.getMaxRetryAttempts() != null) {
singleEvent.setMaxRetryAttempts(taskInput.getMaxRetryAttempts());
}

if (taskInput.getParallelizationFactor() != null) {
singleEvent.setParallelizationFactor(taskInput.getParallelizationFactor());
}

singleEvent.setStartingPosition(taskInput.getStartingPosition());

if (taskInput.getTumblingWindowSecs() != null && taskInput.getTumblingWindowSecs() != -1) {
Expand Down

0 comments on commit e492a53

Please sign in to comment.