-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
NIFI-14285 ConsumeKinesisStream Record Wrapper #9738
base: main
Are you sure you want to change the base?
Conversation
1e01ced
to
87d3bf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for introducing this new property support @dariuszseweryn. The general approach looks good. I noted a few implementation detail recommendations.
...processors/src/main/java/org/apache/nifi/processors/aws/kinesis/property/OutputStrategy.java
Outdated
Show resolved
Hide resolved
...processors/src/main/java/org/apache/nifi/processors/aws/kinesis/property/OutputStrategy.java
Outdated
Show resolved
Hide resolved
...essors/src/main/java/org/apache/nifi/processors/aws/kinesis/stream/ConsumeKinesisStream.java
Outdated
Show resolved
Hide resolved
...ain/java/org/apache/nifi/processors/aws/kinesis/stream/record/converter/RecordConverter.java
Outdated
Show resolved
Hide resolved
.../org/apache/nifi/processors/aws/kinesis/stream/record/converter/RecordConverterIdentity.java
Outdated
Show resolved
Hide resolved
...rs/src/test/java/org/apache/nifi/processors/aws/kinesis/stream/TestConsumeKinesisStream.java
Outdated
Show resolved
Hide resolved
...a/org/apache/nifi/processors/aws/kinesis/stream/record/converter/RecordConverterWrapper.java
Outdated
Show resolved
Hide resolved
...a/org/apache/nifi/processors/aws/kinesis/stream/record/converter/RecordConverterWrapper.java
Outdated
Show resolved
Hide resolved
metadata.put(SEQUENCE_NUMBER, consumerRecord.sequenceNumber()); | ||
metadata.put(PARTITION_KEY, consumerRecord.partitionKey()); | ||
final Instant approxArrivalTimestamp = consumerRecord.approximateArrivalTimestamp(); | ||
metadata.put(APPROX_ARRIVAL_TIMESTAMP, approxArrivalTimestamp != null ? approxArrivalTimestamp.toEpochMilli() : null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend reversing the ternary conditional as follows:
metadata.put(APPROX_ARRIVAL_TIMESTAMP, approxArrivalTimestamp != null ? approxArrivalTimestamp.toEpochMilli() : null); | |
metadata.put(APPROX_ARRIVAL_TIMESTAMP, approxArrivalTimestamp == null ? null : approxArrivalTimestamp.toEpochMilli()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP, is there such convention explained? Always thought that the null case is less interesting and therefore it can come last
Summary
NIFI-14285
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-14285
NIFI-14285
Pull Request Formatting
main
branchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-check
Licensing
LICENSE
andNOTICE
filesDocumentation