HDFS-7931. DistributedFileSystem should not look for keyProvider in cache if Encryption is disabled (asuresh)
(cherry picked from commit 7660da95cb
)
This commit is contained in:
parent
743c74a573
commit
0a95b4f8aa
|
@ -10,6 +10,9 @@ Release 2.7.1 - UNRELEASED
|
||||||
|
|
||||||
HDFS-8081. Split getAdditionalBlock() into two methods. (shv)
|
HDFS-8081. Split getAdditionalBlock() into two methods. (shv)
|
||||||
|
|
||||||
|
HDFS-7931. DistributedFileSystem should not look for keyProvider in
|
||||||
|
cache if Encryption is disabled (asuresh)
|
||||||
|
|
||||||
OPTIMIZATIONS
|
OPTIMIZATIONS
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
|
@ -3527,6 +3527,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.
|
* Returns the SaslDataTransferClient configured for this DFSClient.
|
||||||
*
|
*
|
||||||
|
|
|
@ -2226,7 +2226,7 @@ public class DistributedFileSystem extends FileSystem {
|
||||||
public Token<?>[] addDelegationTokens(
|
public Token<?>[] addDelegationTokens(
|
||||||
final String renewer, Credentials credentials) throws IOException {
|
final String renewer, Credentials credentials) throws IOException {
|
||||||
Token<?>[] tokens = super.addDelegationTokens(renewer, credentials);
|
Token<?>[] tokens = super.addDelegationTokens(renewer, credentials);
|
||||||
if (dfs.getKeyProvider() != null) {
|
if (dfs.isHDFSEncryptionEnabled()) {
|
||||||
KeyProviderDelegationTokenExtension keyProviderDelegationTokenExtension =
|
KeyProviderDelegationTokenExtension keyProviderDelegationTokenExtension =
|
||||||
KeyProviderDelegationTokenExtension.
|
KeyProviderDelegationTokenExtension.
|
||||||
createKeyProviderDelegationTokenExtension(dfs.getKeyProvider());
|
createKeyProviderDelegationTokenExtension(dfs.getKeyProvider());
|
||||||
|
|
Loading…
Reference in New Issue