HBASE-11237 Bulk load initiated by user other than hbase fails

This commit is contained in:
Jimmy Xiang 2014-05-22 15:27:34 -07:00
parent 3054c3b9b8
commit 26387cbf18
1 changed files with 5 additions and 1 deletions

View File

@ -236,7 +236,11 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService
done.run(null);
return;
}
ugi.addToken(targetfsDelegationToken.getUserToken());
Token<?> targetFsToken = targetfsDelegationToken.getUserToken();
if (targetFsToken != null && (userToken == null
|| !targetFsToken.getService().equals(userToken.getService()))) {
ugi.addToken(targetFsToken);
}
loaded = ugi.doAs(new PrivilegedAction<Boolean>() {
@Override