[
https://issues.apache.org/jira/browse/NIFI-1322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15636012#comment-15636012
]
ASF GitHub Bot commented on NIFI-1322:
--------------------------------------
Github user olegz commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1181#discussion_r86524045
--- Diff:
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/PutHDFS.java
---
@@ -315,21 +328,24 @@ public void process(InputStream in) throws
IOException {
final long millis =
stopWatch.getDuration(TimeUnit.MILLISECONDS);
tempDotCopyFile = tempCopyFile;
- boolean renamed = false;
- for (int i = 0; i < 10; i++) { // try to rename multiple times.
- if (hdfs.rename(tempCopyFile, copyFile)) {
- renamed = true;
- break;// rename was successful
+ if(!conflictResponse.equals(APPEND_RESOLUTION.getValue())
+ ||
(conflictResponse.equals(APPEND_RESOLUTION.getValue()) && !destinationExists)) {
+ boolean renamed = false;
+ for (int i = 0; i < 10; i++) { // try to rename multiple
times.
+ if (hdfs.rename(tempCopyFile, copyFile)) {
+ renamed = true;
+ break;// rename was successful
+ }
+ Thread.sleep(200L);// try waiting to let whatever
might cause rename failure to resolve
--- End diff --
Do you know what's this for and if we still need it? I mean not only the
sleep, but he whole loop.
> Support appending files in PutHDFS
> ----------------------------------
>
> Key: NIFI-1322
> URL: https://issues.apache.org/jira/browse/NIFI-1322
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Extensions
> Reporter: Scott
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)