Package org.apache.hadoop.hbase.tool
Class TestBulkLoadHFilesWithDfsPermissions
java.lang.Object
org.apache.hadoop.hbase.tool.TestBulkLoadHFilesWithDfsPermissions
@Tag("org.apache.hadoop.hbase.testclassification.MiscTests") @Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestBulkLoadHFilesWithDfsPermissions
extends Object
End-to-end bulk load test on a MiniDFSCluster with HDFS permissions enabled and three distinct
identities: the HBase service user (which runs the mini cluster and must not be the HDFS
superuser), the bulk load client (which owns the input HFiles and the target table) and an
unrelated attacker user.
A single HFile spanning the table split point is loaded, so BulkLoadHFilesTool has to split it
into .tmp/<uuid>.bottom and .tmp/<uuid>.top inside the client's own directory.
The test verifies that the load succeeds without any world-writable permission on the split
artifacts (they are handed to the service user through the staging directory of
SecureBulkLoadManager, which is protected by a random directory name), and that a third
user cannot tamper with the split directory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.apache.hadoop.security.UserGroupInformationprivate static org.apache.hadoop.security.UserGroupInformationprivate static final byte[]private static org.apache.hadoop.security.UserGroupInformationprivate static final byte[]private static final String[]private static org.apache.hadoop.security.UserGroupInformationprivate static final byte[]private static org.apache.hadoop.fs.FileSystemprivate static final org.apache.hadoop.hbase.TableNameprivate static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> TrunAs(org.apache.hadoop.security.UserGroupInformation ugi, PrivilegedExceptionAction<T> action) static voidstatic voidvoidprivate static voidwriteHFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path)
-
Field Details
-
UTIL
-
TABLE
-
FAMILY
-
QUALIFIER
-
SPLIT_KEY
-
ROWS
-
originalLogin
-
serviceUgi
-
clientUgi
-
attackerUgi
-
superuserFs
-
-
Constructor Details
-
TestBulkLoadHFilesWithDfsPermissions
public TestBulkLoadHFilesWithDfsPermissions()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testBulkLoadWithSplitUnderHdfsPermissions
- Throws:
Exception
-
runAs
private static <T> T runAs(org.apache.hadoop.security.UserGroupInformation ugi, PrivilegedExceptionAction<T> action) throws Exception - Throws:
Exception
-
writeHFile
private static void writeHFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException - Throws:
IOException
-