HDFS-13100. Handle IllegalArgumentException when GETSERVERDEFAULTS is not implemented in webhdfs. Contributed by Aaron T. Myers and Yongjun Zhang.
(cherry picked from commit 4e9a59ce16
)
This commit is contained in:
parent
7cd3770fee
commit
6dfea05049
|
@ -1911,8 +1911,17 @@ public class WebHdfsFileSystem extends FileSystem
|
||||||
try {
|
try {
|
||||||
keyProviderUri = getServerDefaults().getKeyProviderUri();
|
keyProviderUri = getServerDefaults().getKeyProviderUri();
|
||||||
} catch (UnsupportedOperationException e) {
|
} catch (UnsupportedOperationException e) {
|
||||||
// This means server doesn't supports GETSERVERDEFAULTS call.
|
// This means server doesn't support GETSERVERDEFAULTS call.
|
||||||
// Do nothing, let keyProviderUri = null.
|
// Do nothing, let keyProviderUri = null.
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
if (e.getClassName() != null &&
|
||||||
|
e.getClassName().equals("java.lang.IllegalArgumentException")) {
|
||||||
|
// See HDFS-13100.
|
||||||
|
// This means server doesn't support GETSERVERDEFAULTS call.
|
||||||
|
// Do nothing, let keyProviderUri = null.
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return HdfsKMSUtil.getKeyProviderUri(ugi, getUri(), keyProviderUri,
|
return HdfsKMSUtil.getKeyProviderUri(ugi, getUri(), keyProviderUri,
|
||||||
getConf());
|
getConf());
|
||||||
|
|
Loading…
Reference in New Issue