@InterfaceAudience.Private public class MasterFileSystem extends Object
| Modifier and Type | Field and Description |
|---|---|
private ClusterId |
clusterId |
(package private) org.apache.hadoop.conf.Configuration |
conf |
(package private) boolean |
distributedLogReplay |
private org.apache.hadoop.fs.FileSystem |
fs |
private boolean |
fsOk |
private static org.apache.commons.logging.Log |
LOG |
(package private) Server |
master |
(package private) static org.apache.hadoop.fs.PathFilter |
META_FILTER |
private MetricsMasterFileSystem |
metricsMasterFilesystem |
(package private) static org.apache.hadoop.fs.PathFilter |
NON_META_FILTER |
private org.apache.hadoop.fs.Path |
oldLogDir |
private org.apache.hadoop.fs.Path |
rootdir |
private MasterServices |
services |
(package private) Lock |
splitLogLock |
(package private) SplitLogManager |
splitLogManager |
private org.apache.hadoop.fs.Path |
tempdir |
| Constructor and Description |
|---|
MasterFileSystem(Server master,
MasterServices services) |
| Modifier and Type | Method and Description |
|---|---|
HTableDescriptor |
addColumn(TableName tableName,
HColumnDescriptor hcd)
Add column to a table
|
private static void |
bootstrap(org.apache.hadoop.fs.Path rd,
org.apache.hadoop.conf.Configuration c) |
boolean |
checkFileSystem()
Checks to see if the file system is still accessible.
|
private org.apache.hadoop.fs.Path |
checkRootDir(org.apache.hadoop.fs.Path rd,
org.apache.hadoop.conf.Configuration c,
org.apache.hadoop.fs.FileSystem fs)
Get the rootdir.
|
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 org.apache.hadoop.fs.Path |
createInitialFileSystemLayout()
Create initial layout in filesystem.
|
HTableDescriptor |
deleteColumn(TableName tableName,
byte[] familyName)
Delete column of a table
|
void |
deleteFamilyFromFS(HRegionInfo region,
byte[] familyName) |
void |
deleteRegion(HRegionInfo region) |
void |
deleteTable(TableName tableName) |
ClusterId |
getClusterId() |
(package private) Set<ServerName> |
getFailedServersFromLogFolders()
Inspect the log directory to find dead servers which need recovery work
|
org.apache.hadoop.fs.FileSystem |
getFileSystem() |
private List<org.apache.hadoop.fs.Path> |
getLogDirs(Set<ServerName> serverNames) |
org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode |
getLogRecoveryMode() |
org.apache.hadoop.fs.Path |
getOldLogDir()
Get the directory where old logs go
|
org.apache.hadoop.fs.Path |
getRootDir() |
(package private) SplitLogManager |
getSplitLogManager() |
org.apache.hadoop.fs.Path |
getTempDir() |
void |
logFileSystemState(org.apache.commons.logging.Log log) |
HTableDescriptor |
modifyColumn(TableName tableName,
HColumnDescriptor hcd)
Modify Column of a table
|
org.apache.hadoop.fs.Path |
moveTableToTemp(TableName tableName)
Move the specified table to the hbase temp directory
|
void |
prepareLogReplay(ServerName serverName,
Set<HRegionInfo> regions)
Mark regions in recovering state when distributedLogReplay are set true
|
(package private) void |
removeStaleRecoveringRegionsFromZK(Set<ServerName> failedServers)
Wrapper function on
SplitLogManager.removeStaleRecoveringRegions(Set) |
static void |
setInfoFamilyCachingForMeta(HTableDescriptor metaDescriptor,
boolean b)
Enable in memory caching for hbase:meta
|
void |
setLogRecoveryMode()
The function is used in SSH to set recovery mode based on configuration after all outstanding
log split tasks drained.
|
void |
splitLog(ServerName serverName) |
void |
splitLog(Set<ServerName> serverNames) |
void |
splitLog(Set<ServerName> serverNames,
org.apache.hadoop.fs.PathFilter filter)
This method is the base split method that splits WAL files matching a filter.
|
void |
splitMetaLog(ServerName serverName)
Specialized method to handle the splitting for meta WAL
|
void |
splitMetaLog(Set<ServerName> serverNames)
Specialized method to handle the splitting for meta WAL
|
void |
stop() |
void |
updateRegionInfo(HRegionInfo region) |
private static final org.apache.commons.logging.Log LOG
org.apache.hadoop.conf.Configuration conf
Server master
private final MetricsMasterFileSystem metricsMasterFilesystem
private ClusterId clusterId
private final org.apache.hadoop.fs.FileSystem fs
private volatile boolean fsOk
private final org.apache.hadoop.fs.Path oldLogDir
private final org.apache.hadoop.fs.Path rootdir
private final org.apache.hadoop.fs.Path tempdir
final Lock splitLogLock
final boolean distributedLogReplay
final SplitLogManager splitLogManager
private final MasterServices services
static final org.apache.hadoop.fs.PathFilter META_FILTER
static final org.apache.hadoop.fs.PathFilter NON_META_FILTER
public MasterFileSystem(Server master, MasterServices services) throws IOException
IOExceptionSplitLogManager getSplitLogManager()
private org.apache.hadoop.fs.Path createInitialFileSystemLayout()
throws IOException
IOExceptionpublic org.apache.hadoop.fs.FileSystem getFileSystem()
public org.apache.hadoop.fs.Path getOldLogDir()
public boolean checkFileSystem()
public org.apache.hadoop.fs.Path getRootDir()
public org.apache.hadoop.fs.Path getTempDir()
public ClusterId getClusterId()
Set<ServerName> getFailedServersFromLogFolders()
public void splitLog(ServerName serverName) throws IOException
IOExceptionpublic void splitMetaLog(ServerName serverName) throws IOException
serverName - IOExceptionpublic void splitMetaLog(Set<ServerName> serverNames) throws IOException
serverNames - IOExceptionprivate List<org.apache.hadoop.fs.Path> getLogDirs(Set<ServerName> serverNames) throws IOException
IOExceptionpublic void prepareLogReplay(ServerName serverName, Set<HRegionInfo> regions) throws IOException
serverName - Failed region server whose wals to be replayedregions - Set of regions to be recoveredIOExceptionpublic void splitLog(Set<ServerName> serverNames) throws IOException
IOExceptionvoid removeStaleRecoveringRegionsFromZK(Set<ServerName> failedServers) throws IOException, InterruptedIOException
SplitLogManager.removeStaleRecoveringRegions(Set)failedServers - IOExceptionInterruptedIOExceptionpublic void splitLog(Set<ServerName> serverNames, org.apache.hadoop.fs.PathFilter filter) throws IOException
serverNames - logs belonging to these servers will be split; this will rename the log
directory out from under a soft-failed serverfilter - IOExceptionprivate org.apache.hadoop.fs.Path checkRootDir(org.apache.hadoop.fs.Path rd,
org.apache.hadoop.conf.Configuration c,
org.apache.hadoop.fs.FileSystem fs)
throws IOException
rd - c - fs - IOExceptionprivate void checkTempDir(org.apache.hadoop.fs.Path tmpdir,
org.apache.hadoop.conf.Configuration c,
org.apache.hadoop.fs.FileSystem fs)
throws IOException
IOExceptionprivate static void bootstrap(org.apache.hadoop.fs.Path rd,
org.apache.hadoop.conf.Configuration c)
throws IOException
IOExceptionpublic static void setInfoFamilyCachingForMeta(HTableDescriptor metaDescriptor, boolean b)
public void deleteRegion(HRegionInfo region) throws IOException
IOExceptionpublic void deleteTable(TableName tableName) throws IOException
IOExceptionpublic org.apache.hadoop.fs.Path moveTableToTemp(TableName tableName) throws IOException
tableName - Table name to moveIOException - in case of file-system failurepublic void updateRegionInfo(HRegionInfo region)
public void deleteFamilyFromFS(HRegionInfo region, byte[] familyName) throws IOException
IOExceptionpublic void stop()
public HTableDescriptor deleteColumn(TableName tableName, byte[] familyName) throws IOException
tableName - familyName - IOExceptionpublic HTableDescriptor modifyColumn(TableName tableName, HColumnDescriptor hcd) throws IOException
tableName - hcd - HColumnDesciptorIOExceptionpublic HTableDescriptor addColumn(TableName tableName, HColumnDescriptor hcd) throws IOException
tableName - hcd - IOExceptionpublic void setLogRecoveryMode()
throws IOException
IOExceptionpublic org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode getLogRecoveryMode()
public void logFileSystemState(org.apache.commons.logging.Log log)
throws IOException
IOExceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.