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
FieldsModifier and TypeFieldDescriptionprivate ClusterIdprivate final org.apache.hadoop.conf.Configurationprivate final org.apache.hadoop.fs.FileSystemstatic final StringParameter name for HBase instance root directory permissionstatic final StringParameter name for HBase WAL directory permissionprivate final org.apache.hadoop.fs.permission.FsPermissionprivate booleanprivate static final org.slf4j.Loggerprivate final org.apache.hadoop.fs.Pathprivate final org.apache.hadoop.fs.permission.FsPermissionprivate final org.apache.hadoop.fs.permission.FsPermissionprivate final org.apache.hadoop.fs.Pathprivate final org.apache.hadoop.fs.FileSystemprivate final org.apache.hadoop.fs.Path -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckRootDir(org.apache.hadoop.fs.Path rd, org.apache.hadoop.conf.Configuration c, org.apache.hadoop.fs.FileSystem fs) Get the rootdir.private voidCheck permissions for bulk load staging directory.private voidcheckSubDir(org.apache.hadoop.fs.Path p, String dirPermsConfName) Make sure the directories under rootDir have good permissions.(package private) voidcheckTempDir(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 voidCreate initial layout in filesystem.voiddeleteFamilyFromFS(org.apache.hadoop.fs.Path rootDir, RegionInfo region, byte[] familyName) voiddeleteFamilyFromFS(RegionInfo region, byte[] familyName) Returns The unique identifier generated for this clusterorg.apache.hadoop.conf.Configurationorg.apache.hadoop.fs.FileSystemorg.apache.hadoop.fs.PathgetRegionDir(RegionInfo region) Returns the directory for a giveregion.org.apache.hadoop.fs.PathReturns HBase root dir.org.apache.hadoop.fs.PathReturns HBase temp dir.org.apache.hadoop.fs.FileSystemorg.apache.hadoop.fs.PathReturns HBase root log dir.voidlogFileSystemState(org.slf4j.Logger log) voidstop()
-
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
-