@InterfaceAudience.Private public class MasterWalManager extends Object
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf |
private org.apache.hadoop.fs.FileSystem |
fs |
private boolean |
fsOk |
private static org.slf4j.Logger |
LOG |
(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
This is the hbase rootdir.
|
private MasterServices |
services |
private Lock |
splitLogLock |
private SplitLogManager |
splitLogManager |
Constructor and Description |
---|
MasterWalManager(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.fs.FileSystem fs,
MasterServices services) |
MasterWalManager(MasterServices services) |
Modifier and Type | Method and Description |
---|---|
void |
archiveMetaLog(ServerName serverName)
For meta region open and closed normally on a server, it may leave some meta
WAL in the server's wal dir.
|
private boolean |
checkFileSystem()
Checks to see if the file system is still accessible.
|
(package private) List<org.apache.hadoop.fs.Path> |
createAndGetLogDirs(Set<ServerName> serverNames)
Finds WAL dirs for
serverNames and renames them with '-splitting' suffix. |
Set<ServerName> |
getFailedServersFromLogFolders()
Deprecated.
With proc-v2, we can record the crash server with procedure store, so do not need
to scan the wal directory to find out the splitting wal directory any more. Leave
it here only because
RecoverMetaProcedure (which is also deprecated) uses
it. |
org.apache.hadoop.fs.FileSystem |
getFileSystem() |
Set<ServerName> |
getLiveServersFromWALDir()
Get Servernames that COULD BE 'alive'; excludes those that have a '-splitting' suffix as these
are already being split -- they cannot be 'alive'.
|
(package private) org.apache.hadoop.fs.Path |
getOldLogDir()
Get the directory where old logs go
|
Set<ServerName> |
getServerNamesFromWALDirPath(org.apache.hadoop.fs.PathFilter filter) |
(package private) SplitLogManager |
getSplitLogManager() |
Set<ServerName> |
getSplittingServersFromWALDir()
Get Servernames which are currently splitting; paths have a '-splitting' suffix.
|
(package private) org.apache.hadoop.fs.Path |
getWALDirectoryName(ServerName serverName)
Depends on current FS Layout!
|
(package private) org.apache.hadoop.fs.Path |
getWALDirPath() |
org.apache.hadoop.fs.FileStatus[] |
getWALDirPaths(org.apache.hadoop.fs.PathFilter filter) |
(package private) boolean |
isWALDirectoryNameWithWALs(ServerName serverName) |
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() |
private static final org.slf4j.Logger LOG
static final org.apache.hadoop.fs.PathFilter META_FILTER
static final org.apache.hadoop.fs.PathFilter NON_META_FILTER
private final MetricsMasterFileSystem metricsMasterFilesystem
private final MasterServices services
private final org.apache.hadoop.conf.Configuration conf
private final org.apache.hadoop.fs.FileSystem fs
private final org.apache.hadoop.fs.Path oldLogDir
private final org.apache.hadoop.fs.Path rootDir
private final Lock splitLogLock
private final SplitLogManager splitLogManager
private volatile boolean fsOk
public MasterWalManager(MasterServices services) throws IOException
IOException
public MasterWalManager(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.FileSystem fs, MasterServices services) throws IOException
IOException
public void stop()
SplitLogManager getSplitLogManager()
org.apache.hadoop.fs.Path getOldLogDir()
public org.apache.hadoop.fs.FileSystem getFileSystem()
private boolean checkFileSystem()
public Set<ServerName> getSplittingServersFromWALDir() throws IOException
IOException
- IOExceptionpublic Set<ServerName> getLiveServersFromWALDir() throws IOException
IOException
- IOExceptionpublic Set<ServerName> getServerNamesFromWALDirPath(org.apache.hadoop.fs.PathFilter filter) throws IOException
IOException
org.apache.hadoop.fs.Path getWALDirPath() throws IOException
rootDir
IOException
public org.apache.hadoop.fs.FileStatus[] getWALDirPaths(org.apache.hadoop.fs.PathFilter filter) throws IOException
IOException
@Deprecated public Set<ServerName> getFailedServersFromLogFolders() throws IOException
RecoverMetaProcedure
(which is also deprecated) uses
it.IOException
public void splitLog(ServerName serverName) throws IOException
IOException
public void splitMetaLog(ServerName serverName) throws IOException
serverName
- logs belonging to this server will be splitIOException
public void splitMetaLog(Set<ServerName> serverNames) throws IOException
serverNames
- logs belonging to these servers will be splitIOException
boolean isWALDirectoryNameWithWALs(ServerName serverName)
org.apache.hadoop.fs.Path getWALDirectoryName(ServerName serverName)
serverName
List<org.apache.hadoop.fs.Path> createAndGetLogDirs(Set<ServerName> serverNames) throws IOException
serverNames
and renames them with '-splitting' suffix.serverNames
IOException
public void splitLog(Set<ServerName> serverNames) throws IOException
IOException
public 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 serverIOException
public void archiveMetaLog(ServerName serverName)
serverName
- the server to archive meta logCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.