You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2016/02/22 23:23:11 UTC
nifi git commit: NIFI-1536 This closes #241. ensured that
UserGroupInformation is re-initialized on each call to
'AbstractHadoopProcessor.resetHDFSResources(..)'
Repository: nifi
Updated Branches:
refs/heads/support/nifi-0.5.x 12bd6d46e -> 3a341ff26
NIFI-1536 This closes #241. ensured that UserGroupInformation is re-initialized on each call to 'AbstractHadoopProcessor.resetHDFSResources(..)'
Signed-off-by: joewitt <jo...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/3a341ff2
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/3a341ff2
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/3a341ff2
Branch: refs/heads/support/nifi-0.5.x
Commit: 3a341ff264d7fd4ee9197649db59dc7300c3df68
Parents: 12bd6d4
Author: Oleg Zhurakousky <ol...@suitcase.io>
Authored: Sun Feb 21 12:45:00 2016 -0500
Committer: joewitt <jo...@apache.org>
Committed: Mon Feb 22 17:22:09 2016 -0500
----------------------------------------------------------------------
.../nifi/processors/hadoop/AbstractHadoopProcessor.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/3a341ff2/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
index 9e89c3a..b536996 100644
--- a/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
+++ b/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/AbstractHadoopProcessor.java
@@ -258,8 +258,8 @@ public abstract class AbstractHadoopProcessor extends AbstractProcessor {
// If kerberos is enabled, create the file system as the kerberos principal
// -- use RESOURCE_LOCK to guarantee UserGroupInformation is accessed by only a single thread at at time
- FileSystem fs = null;
- UserGroupInformation ugi = null;
+ FileSystem fs;
+ UserGroupInformation ugi;
synchronized (RESOURCES_LOCK) {
if (config.get("hadoop.security.authentication").equalsIgnoreCase("kerberos")) {
String principal = context.getProperty(KERBEROS_PRINCIPAL).getValue();
@@ -271,7 +271,9 @@ public abstract class AbstractHadoopProcessor extends AbstractProcessor {
} else {
config.set("ipc.client.fallback-to-simple-auth-allowed", "true");
config.set("hadoop.security.authentication", "simple");
- fs = getFileSystem(config);
+ UserGroupInformation.setConfiguration(config);
+ ugi = UserGroupInformation.getLoginUser();
+ fs = getFileSystemAsUser(config, ugi);
}
}
config.set(disableCacheName, "true");