You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by as...@apache.org on 2015/04/10 20:41:40 UTC
hadoop git commit: HDFS-7931. DistributedFileSystem should not look
for keyProvider in cache if Encryption is disabled (asuresh)
Repository: hadoop
Updated Branches:
refs/heads/trunk e516706b8 -> 7660da95c
HDFS-7931. DistributedFileSystem should not look for keyProvider in cache if Encryption is disabled (asuresh)
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/7660da95
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/7660da95
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/7660da95
Branch: refs/heads/trunk
Commit: 7660da95cb67cbfe034aa8fa2a5bf0f8c9fdf41a
Parents: e516706
Author: Arun Suresh <as...@apache.org>
Authored: Fri Apr 10 11:40:25 2015 -0700
Committer: Arun Suresh <as...@apache.org>
Committed: Fri Apr 10 11:40:25 2015 -0700
----------------------------------------------------------------------
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++
.../src/main/java/org/apache/hadoop/hdfs/DFSClient.java | 4 ++++
.../main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java | 2 +-
3 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7660da95/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 5d5c8a6..333a1b1 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -479,6 +479,9 @@ Release 2.7.1 - UNRELEASED
HDFS-8081. Split getAdditionalBlock() into two methods. (shv)
+ HDFS-7931. DistributedFileSystem should not look for keyProvider in
+ cache if Encryption is disabled (asuresh)
+
OPTIMIZATIONS
BUG FIXES
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7660da95/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index c85c1ec..d43e7de 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -3538,6 +3538,10 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
}
}
+ public boolean isHDFSEncryptionEnabled() {
+ return conf.get(
+ DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, null) != null;
+ }
/**
* Returns the SaslDataTransferClient configured for this DFSClient.
*
http://git-wip-us.apache.org/repos/asf/hadoop/blob/7660da95/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
index 090d884..3edab48 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
@@ -2191,7 +2191,7 @@ public class DistributedFileSystem extends FileSystem {
public Token<?>[] addDelegationTokens(
final String renewer, Credentials credentials) throws IOException {
Token<?>[] tokens = super.addDelegationTokens(renewer, credentials);
- if (dfs.getKeyProvider() != null) {
+ if (dfs.isHDFSEncryptionEnabled()) {
KeyProviderDelegationTokenExtension keyProviderDelegationTokenExtension =
KeyProviderDelegationTokenExtension.
createKeyProviderDelegationTokenExtension(dfs.getKeyProvider());