diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java index dfd71fc2ac6..930d9b33ae1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java @@ -198,7 +198,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService } Token userToken = null; - if (request.getFsToken().hasIdentifier() && request.getFsToken().hasPassword()) { + if (userProvider.isHadoopSecurityEnabled()) { userToken = new Token(request.getFsToken().getIdentifier().toByteArray(), request.getFsToken() .getPassword().toByteArray(), new Text(request.getFsToken().getKind()), new Text( request.getFsToken().getService())); @@ -213,6 +213,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService //for mini cluster testing ResponseConverter.setControllerException(controller, new DoNotRetryIOException("User token cannot be null")); + done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build()); return; } @@ -223,7 +224,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService bypass = region.getCoprocessorHost().preBulkLoadHFile(familyPaths); } catch (IOException e) { ResponseConverter.setControllerException(controller, e); - done.run(null); + done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build()); return; } } @@ -240,7 +241,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService targetfsDelegationToken.acquireDelegationToken(fs); } catch (IOException e) { ResponseConverter.setControllerException(controller, e); - done.run(null); + done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build()); return; } Token targetFsToken = targetfsDelegationToken.getUserToken(); @@ -284,7 +285,7 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService loaded = region.getCoprocessorHost().postBulkLoadHFile(familyPaths, loaded); } catch (IOException e) { ResponseConverter.setControllerException(controller, e); - done.run(null); + done.run(SecureBulkLoadHFilesResponse.newBuilder().setLoaded(false).build()); return; } }