Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
1.1.1
-
None
-
None
-
None
Description
The PutHDFS permission umask property is not working. The umask is set when the processor is scheduled to run as per below:
@OnScheduled
public void onScheduled(ProcessContext context) throws Exception {
super.abstractOnScheduled(context);
// Set umask once, to avoid thread safety issues doing it in onTrigger
final PropertyValue umaskProp = context.getProperty(UMASK);
final short dfsUmask;
if (umaskProp.isSet())
else
{ dfsUmask = FsPermission.DEFAULT_UMASK; } final Configuration conf = getConfiguration();
FsPermission.setUMask(conf, new FsPermission(dfsUmask));
}
However, when the flowfile is being processed, a new set of configuration is loaded:
@Override
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
final FlowFile flowFile = session.get();
if (flowFile == null)
final FileSystem hdfs = getFileSystem();
final Configuration configuration = getConfiguration();
...
}
This configuration is the one which is going to be used when putting the file to HDFS; hence not grabbing the umask set perviously on onScheduled but only the default one (hdfs-site.xml). Thus, the umask property is irrelevant.
Fix should be easy by externalizing the configuration and grabbing it again in onTrigger or by setting a new hdfsResources in onScheduled.
Attachments
Issue Links
- is duplicated by
-
NIFI-4311 PutHDFS not honoring umask property
- Resolved