From fec7771f73379a8322053d324c1a66543d14bffa Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Sat, 6 Sep 2014 13:23:28 +0000 Subject: [PATCH] HBASE-11896 LoadIncrementalHFiles fails in secure mode if the namespace is specified (Ashish Singhi and Ted Yu) --- .../hbase/security/access/SecureBulkLoadEndpoint.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 07d5bf5cc08..b2405453822 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 @@ -174,7 +174,6 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService getAccessController().preCleanupBulkLoad(env); fs.delete(createStagingDir(baseStagingDir, getActiveUser(), - env.getRegion().getTableDesc().getTableName(), new Path(request.getBulkToken()).getName()), true); done.run(CleanupBulkLoadResponse.newBuilder().build()); @@ -291,14 +290,14 @@ public class SecureBulkLoadEndpoint extends SecureBulkLoadService private Path createStagingDir(Path baseDir, User user, TableName tableName) throws IOException { - String randomDir = user.getShortName()+"__"+ tableName +"__"+ + String tblName = tableName.getNameAsString().replace(":", "_"); + String randomDir = user.getShortName()+"__"+ tblName +"__"+ (new BigInteger(RANDOM_WIDTH, random).toString(RANDOM_RADIX)); - return createStagingDir(baseDir, user, tableName, randomDir); + return createStagingDir(baseDir, user, randomDir); } private Path createStagingDir(Path baseDir, User user, - TableName tableName, String randomDir) throws IOException { Path p = new Path(baseDir, randomDir); fs.mkdirs(p, PERM_ALL_ACCESS);