Class SecureBulkLoadManager
java.lang.Object
org.apache.hadoop.hbase.regionserver.SecureBulkLoadManager
Bulk loads in secure mode. This service addresses two issues:
- Moving files in a secure filesystem wherein the HBase Client and HBase Server are different filesystem users.
- Does moving in a secure manner. Assuming that the filesystem is POSIX compliant.
- Create an hbase owned staging directory which is world traversable (711):
/hbase/staging - A user writes out data to his secure output directory:
/user/foo/data - A call is made to hbase to create a secret staging directory which globally rwx (777):
/user/staging/averylongandrandomdirectoryname - The user moves the data into the random staging directory, then calls bulkLoadHFiles()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.fs.Pathprivate org.apache.hadoop.conf.Configurationprivate AsyncConnectionprivate org.apache.hadoop.fs.FileSystemprivate static final org.slf4j.Loggerprivate static final org.apache.hadoop.fs.permission.FsPermissionprivate static final org.apache.hadoop.fs.permission.FsPermissionprivate SecureRandomprivate static final intprivate static final intprivate ConcurrentHashMap<org.apache.hadoop.security.UserGroupInformation,org.apache.commons.lang3.mutable.MutableInt> private UserProviderstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSecureBulkLoadManager(org.apache.hadoop.conf.Configuration conf, AsyncConnection conn) -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanupBulkLoad(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request) private org.apache.hadoop.fs.PathcreateStagingDir(org.apache.hadoop.fs.Path baseDir, User user, String randomDir) private org.apache.hadoop.fs.PathcreateStagingDir(org.apache.hadoop.fs.Path baseDir, User user, TableName tableName) private voiddecrementUgiReference(org.apache.hadoop.security.UserGroupInformation ugi) private Userprivate voidincrementUgiReference(org.apache.hadoop.security.UserGroupInformation ugi) private booleanisUserReferenced(org.apache.hadoop.security.UserGroupInformation ugi) prepareBulkLoad(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request) secureBulkLoadHFiles(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request) secureBulkLoadHFiles(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request, List<String> clusterIds) (package private) voidsetFsCreatedListener(Consumer<HRegion> fsCreatedListener) voidstart()voidstop()
-
Field Details
-
VERSION
- See Also:
-
RANDOM_WIDTH
- See Also:
-
RANDOM_RADIX
- See Also:
-
LOG
-
PERM_ALL_ACCESS
-
PERM_HIDDEN
-
random
-
fs
-
conf
-
baseStagingDir
-
userProvider
-
ugiReferenceCounter
private ConcurrentHashMap<org.apache.hadoop.security.UserGroupInformation,org.apache.commons.lang3.mutable.MutableInt> ugiReferenceCounter -
conn
-
fsCreatedListener
-
-
Constructor Details
-
SecureBulkLoadManager
SecureBulkLoadManager(org.apache.hadoop.conf.Configuration conf, AsyncConnection conn)
-
-
Method Details
-
start
- Throws:
IOException
-
stop
- Throws:
IOException
-
prepareBulkLoad
public String prepareBulkLoad(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.PrepareBulkLoadRequest request) throws IOException - Throws:
IOException
-
cleanupBulkLoad
public void cleanupBulkLoad(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CleanupBulkLoadRequest request) throws IOException - Throws:
IOException
-
setFsCreatedListener
-
incrementUgiReference
-
decrementUgiReference
-
isUserReferenced
-
secureBulkLoadHFiles
public Map<byte[],List<org.apache.hadoop.fs.Path>> secureBulkLoadHFiles(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request) throws IOException - Throws:
IOException
-
secureBulkLoadHFiles
public Map<byte[],List<org.apache.hadoop.fs.Path>> secureBulkLoadHFiles(HRegion region, org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.BulkLoadHFileRequest request, List<String> clusterIds) throws IOException - Throws:
IOException
-
createStagingDir
private org.apache.hadoop.fs.Path createStagingDir(org.apache.hadoop.fs.Path baseDir, User user, TableName tableName) throws IOException - Throws:
IOException
-
createStagingDir
private org.apache.hadoop.fs.Path createStagingDir(org.apache.hadoop.fs.Path baseDir, User user, String randomDir) throws IOException - Throws:
IOException
-
getActiveUser
- Throws:
IOException
-