turcsanyip commented on code in PR #8415:
URL: https://github.com/apache/nifi/pull/8415#discussion_r1622927597


##########
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/PutHDFS.java:
##########
@@ -366,14 +374,18 @@ public Object run() {
 
                     // Write FlowFile to temp file on HDFS
                     final StopWatch stopWatch = new StopWatch(true);
-                    session.read(putFlowFile, in -> {
-                        OutputStream fos = null;
-                        Path createdFile = null;
-                        try {
-                            if (conflictResponse.equals(APPEND_RESOLUTION) && 
destinationExists) {
-                                fos = hdfs.append(copyFile, bufferSize);
-                            } else {
-                                final EnumSet<CreateFlag> cflags = 
EnumSet.of(CreateFlag.CREATE, CreateFlag.OVERWRITE);
+                    final ResourceTransferSource resourceTransferSource = 
ResourceTransferSource.valueOf(
+                            
context.getProperty(RESOURCE_TRANSFER_SOURCE).getValue());

Review Comment:
   The preferred way to read a property containing allowable/described value:
   ```suggestion
                       final ResourceTransferSource resourceTransferSource = 
context.getProperty(RESOURCE_TRANSFER_SOURCE).asAllowableValue(ResourceTransferSource.class);
   ```
   ```suggestion
                       final ResourceTransferSource resourceTransferSource = 
ResourceTransferSource.valueOf(
                               
context.getProperty(RESOURCE_TRANSFER_SOURCE).getValue());
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to