nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi] markap14 commented on a change in pull request #3966: NIFI-6992 - Add "Batch Size" property to GetHDFSFileInfo processor
Date Fri, 10 Jan 2020 17:55:53 GMT
markap14 commented on a change in pull request #3966: NIFI-6992 - Add "Batch Size" property
to GetHDFSFileInfo processor
URL: https://github.com/apache/nifi/pull/3966#discussion_r365353915
 
 

 ##########
 File path: nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/GetHDFSFileInfo.java
 ##########
 @@ -255,6 +270,30 @@ public void onPropertyModified(PropertyDescriptor descriptor, String
oldValue, S
         req = null;
     }
 
+    @Override
+    protected Collection<ValidationResult> customValidate(ValidationContext validationContext)
{
+        final List<ValidationResult> validationResults = new ArrayList<>(super.customValidate(validationContext));
+
+        String destination = validationContext.getProperty(DESTINATION).getValue();
+        String grouping = validationContext.getProperty(GROUPING).getValue();
+        String batchSize = validationContext.getProperty(BATCH_SIZE).getValue();
+
+        if (
+            (!DESTINATION_CONTENT.getValue().equals(destination) || !GROUP_NONE.getValue().equals(grouping))
+                && !isEmpty(batchSize)
 
 Review comment:
   If we avoid allowing Batch Size to be set to an empty string, as recommended above, we
can instead just check `validationContext.getProperty(BATCH_SIZE).isSet()` here. I think this
reads more cleanly, and is more inline with the way most processors are written.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message