NIFI-12923 Added append avro mode to PutHDFS#8544
NIFI-12923 Added append avro mode to PutHDFS#8544balazsgerner wants to merge 4 commits intoapache:mainfrom
Conversation
a8ac014 to
f9ba16f
Compare
| && AVRO_APPEND_MODE.equals(appendMode) | ||
| && destinationExists) { | ||
| getLogger().info("Appending avro record to existing avro file"); | ||
| try (final var reader = new DataFileStream<>(in, new GenericDatumReader<>()); |
There was a problem hiding this comment.
This won't backport to 1.x because var wasn't introduced until Java 10 and we still have to support Java 8 on 1.x for now.
There was a problem hiding this comment.
One additional note, use of var should be avoided in general, even when supported in the main branch.
There was a problem hiding this comment.
Noted, thank you for the feedback. Fixed in 04a1ed7.
| .build(); | ||
|
|
||
| public static final PropertyDescriptor APPEND_MODE = new PropertyDescriptor.Builder() | ||
| .name("Append mode") |
There was a problem hiding this comment.
| .name("Append mode") | |
| .name("Append Mode") |
...oop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/PutHDFS.java
Show resolved
Hide resolved
|
In order for the append to work I had to set |
To be honest, during the whole dev testing I left the 'Writing Strategy' property on default value which is 'Write and rename', and it worked completely fine for me. I double checked it now and it still does. As I see it, my ticket does not affect the connection between writing strategy and conflict resolution strategy so it should work just as before. I also checked 'Writing strategy'='Simple write', and that also works for me without any problems. If you experience file deletion I assume your flow might need a tweak. I do not know the processors you use exactly, but I had file deletion problems when I left the 'GetHDFS' or the 'GetFile' processors 'Keep source file' on default which is 'false'. In order to make my flow reexecutable I changed that value to 'true'. For testing I used the following flow:
|
0d92f2d to
909810b
Compare
909810b to
f23bc5a
Compare
|
I had to rebase to |
|
Now I'm running into this in my test environment, trying to change the default filesystem now. |
|
+1 LGTM, verified the Avro append capability works as expected. Thanks for the improvement! Merging to main and support/nifi-1.x |
NIFI-12923 remove var keyword NIFI-12923 change property name NIFI-12923 Added property dependency for append_mode Signed-off-by: Matt Burgess <mattyb149@apache.org> This closes apache#8544
NIFI-12923 remove var keyword NIFI-12923 change property name NIFI-12923 Added property dependency for append_mode Signed-off-by: Matt Burgess <mattyb149@apache.org> This closes apache#8544
Summary
NIFI-12923
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
mvn clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation