greyp9 commented on a change in pull request #5409:
URL: https://github.com/apache/nifi/pull/5409#discussion_r714329247
##########
File path:
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/PutHDFS.java
##########
@@ -228,6 +232,20 @@ protected void preProcessConfiguration(final Configuration
config, final Process
FsPermission.setUMask(config, new FsPermission(dfsUmask));
}
+ @Override
+ protected void preProcessFileSystem(final FileSystem fileSystem, final
ProcessContext context) throws IOException {
+ if (fileSystem instanceof DistributedFileSystem) {
+ final Path dirPath = new
Path(context.getProperty(DIRECTORY).getValue());
Review comment:
> The `Directory` property indicates support for FlowFile Expression
Language, which means that `getProperty()` needs to call
`evaluateAttributeExpressions(FlowFile)`. Since the FlowFile is not available
in this method, it looks like a different approach is necessary.
>
> One option is implementing this hook through a method called from
`onTrigger()`, but that would log a warning for every invocation of the
Processor.
>
> Since the only current purpose of this hook is to log a warning, this may
not be the best approach to the issue. Perhaps adding a note to the umask
property would be a better option?
Thanks.
In addition to the doc update, I'd like to explore a different means to
alert on this condition, if it is detected. Having both should provide a
helpful user experience. I think I understand the constraints here; I'll give
it another try.
--
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]