HBASE-14580 Make the HBaseMiniCluster compliant with Kerberos

This commit is contained in:
Nicolas Liochon 2015-10-13 11:33:40 +02:00
parent b63155eac7
commit 657078b353
1 changed files with 2 additions and 2 deletions

View File

@ -3370,7 +3370,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
/**
* This method clones the passed <code>c</code> configuration setting a new
* user into the clone. Use it getting new instances of FileSystem. Only
* works for DistributedFileSystem.
* works for DistributedFileSystem w/o Kerberos.
* @param c Initial configuration
* @param differentiatingSuffix Suffix to differentiate this user from others.
* @return A new configuration instance with a different user set into it.
@ -3380,7 +3380,7 @@ public class HBaseTestingUtility extends HBaseCommonTestingUtility {
final String differentiatingSuffix)
throws IOException {
FileSystem currentfs = FileSystem.get(c);
if (!(currentfs instanceof DistributedFileSystem)) {
if (!(currentfs instanceof DistributedFileSystem) || User.isHBaseSecurityEnabled(c)) {
return User.getCurrent();
}
// Else distributed filesystem. Make a new instance per daemon. Below