Package org.apache.hadoop.hbase.master
Class MasterFileSystem
java.lang.Object
org.apache.hadoop.hbase.master.MasterFileSystem
This class abstracts a bunch of operations the HMaster needs to interact with the underlying file
system like creating the initial layout, checking file system status, etc.
-
Field Summary
Modifier and TypeFieldDescriptionprivate ClusterId
private final org.apache.hadoop.conf.Configuration
private final org.apache.hadoop.fs.FileSystem
static final String
Parameter name for HBase instance root directory permissionstatic final String
Parameter name for HBase WAL directory permissionprivate final org.apache.hadoop.fs.permission.FsPermission
private boolean
private static final org.slf4j.Logger
private final org.apache.hadoop.fs.Path
private final org.apache.hadoop.fs.permission.FsPermission
private final org.apache.hadoop.fs.permission.FsPermission
private final org.apache.hadoop.fs.Path
private final org.apache.hadoop.fs.FileSystem
private final org.apache.hadoop.fs.Path
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkRootDir
(org.apache.hadoop.fs.Path rd, org.apache.hadoop.conf.Configuration c, org.apache.hadoop.fs.FileSystem fs) Get the rootdir.private void
Check permissions for bulk load staging directory.private void
checkSubDir
(org.apache.hadoop.fs.Path p, String dirPermsConfName) Make sure the directories under rootDir have good permissions.(package private) void
checkTempDir
(org.apache.hadoop.fs.Path tmpdir, org.apache.hadoop.conf.Configuration c, org.apache.hadoop.fs.FileSystem fs) Make sure the hbase temp directory exists and is empty.private void
Create initial layout in filesystem.void
deleteFamilyFromFS
(org.apache.hadoop.fs.Path rootDir, RegionInfo region, byte[] familyName) void
deleteFamilyFromFS
(RegionInfo region, byte[] familyName) Returns The unique identifier generated for this clusterorg.apache.hadoop.conf.Configuration
org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.Path
getRegionDir
(RegionInfo region) Returns the directory for a giveregion
.org.apache.hadoop.fs.Path
Returns HBase root dir.org.apache.hadoop.fs.Path
Returns HBase temp dir.org.apache.hadoop.fs.FileSystem
org.apache.hadoop.fs.Path
Returns HBase root log dir.void
logFileSystemState
(org.slf4j.Logger log) void
stop()
-
Field Details
-
LOG
-
HBASE_DIR_PERMS
Parameter name for HBase instance root directory permission- See Also:
-
HBASE_WAL_DIR_PERMS
Parameter name for HBase WAL directory permission- See Also:
-
conf
-
clusterId
-
fs
-
walFs
-
rootdir
-
tempdir
-
walRootDir
-
secureRootSubDirPerms
-
secureRootFilePerms
-
HiddenDirPerms
-
isSecurityEnabled
-
-
Constructor Details
-
MasterFileSystem
- Throws:
IOException
-
-
Method Details
-
createInitialFileSystemLayout
Create initial layout in filesystem.- Check if the meta region exists and is readable, if not create it. Create hbase.version and the hbase:meta directory if not one.
- Throws:
IOException
-
getFileSystem
-
getWALFileSystem
-
getConfiguration
-
getRootDir
Returns HBase root dir. -
getWALRootDir
Returns HBase root log dir. -
getRegionDir
Returns the directory for a giveregion
. -
getTempDir
Returns HBase temp dir. -
getClusterId
Returns The unique identifier generated for this cluster -
checkRootDir
private void checkRootDir(org.apache.hadoop.fs.Path rd, org.apache.hadoop.conf.Configuration c, org.apache.hadoop.fs.FileSystem fs) throws IOException Get the rootdir. Make sure its wholesome and exists before returning.- Throws:
IOException
-
checkTempDir
void checkTempDir(org.apache.hadoop.fs.Path tmpdir, org.apache.hadoop.conf.Configuration c, org.apache.hadoop.fs.FileSystem fs) throws IOException Make sure the hbase temp directory exists and is empty. NOTE that this method is only executed once just after the master becomes the active one.- Throws:
IOException
-
checkSubDir
Make sure the directories under rootDir have good permissions. Create if necessary.- Throws:
IOException
-
checkStagingDir
Check permissions for bulk load staging directory. This directory has special hidden permissions. Create it if necessary.- Throws:
IOException
-
deleteFamilyFromFS
- Throws:
IOException
-
deleteFamilyFromFS
public void deleteFamilyFromFS(org.apache.hadoop.fs.Path rootDir, RegionInfo region, byte[] familyName) throws IOException - Throws:
IOException
-
stop
-
logFileSystemState
- Throws:
IOException
-