@Deprecated @InterfaceAudience.Private public class SplitLogManager extends Object
SplitLogManager monitors the tasks that it creates using the timeoutMonitor thread. If a task's
progress is slow then SplitLogManagerCoordination.checkTasks()
will take away the task from
the owner SplitLogWorker
and the task will be up for
grabs again. When the task is done then it is deleted by SplitLogManager.
Clients call splitLogDistributed(Path)
to split a region server's log files. The caller
thread waits in this method until all the log files have been split.
All the coordination calls made by this class are asynchronous. This is mainly to help reduce response time seen by the callers.
There is race in this design between the SplitLogManager and the SplitLogWorker. SplitLogManager might re-queue a task that has in reality already been completed by a SplitLogWorker. We rely on the idempotency of the log splitting task for correctness.
It is also assumed that every log splitting task is unique and once completed (either with success or with error) it will be not be submitted again. If a task is resubmitted then there is a risk that old "delete task" can delete the re-submission.
Modifier and Type | Class and Description |
---|---|
static class |
SplitLogManager.ResubmitDirective
Deprecated.
|
static class |
SplitLogManager.Task
Deprecated.
in memory state of an active task.
|
static class |
SplitLogManager.TaskBatch
Deprecated.
Keeps track of the batch of tasks submitted together by a caller in splitLogDistributed().
|
static class |
SplitLogManager.TerminationStatus
Deprecated.
|
private class |
SplitLogManager.TimeoutMonitor
Deprecated.
Periodically checks all active tasks and resubmits the ones that have timed out
|
Modifier and Type | Field and Description |
---|---|
private ChoreService |
choreService
Deprecated.
|
private org.apache.hadoop.conf.Configuration |
conf
Deprecated.
|
private Set<ServerName> |
deadWorkers
Deprecated.
|
private Object |
deadWorkersLock
Deprecated.
|
static int |
DEFAULT_UNASSIGNED_TIMEOUT
Deprecated.
|
private long |
lastTaskCreateTime
Deprecated.
|
private static org.slf4j.Logger |
LOG
Deprecated.
|
private MasterServices |
server
Deprecated.
|
(package private) ConcurrentMap<String,SplitLogManager.Task> |
tasks
Deprecated.
|
private SplitLogManager.TimeoutMonitor |
timeoutMonitor
Deprecated.
|
private long |
unassignedTimeout
Deprecated.
|
Constructor and Description |
---|
SplitLogManager(MasterServices master,
org.apache.hadoop.conf.Configuration conf)
Deprecated.
Its OK to construct this object even when region-servers are not online.
|
Modifier and Type | Method and Description |
---|---|
private int |
activeTasks(SplitLogManager.TaskBatch batch)
Deprecated.
|
private SplitLogManager.Task |
createTaskIfAbsent(String path,
SplitLogManager.TaskBatch batch)
Deprecated.
nn * @return null on success, existing task on error
|
(package private) boolean |
enqueueSplitTask(String taskname,
SplitLogManager.TaskBatch batch)
Deprecated.
Add a task entry to coordination if it is not already there.
|
(package private) static int |
getBatchWaitTimeMillis(int remainingTasks)
Deprecated.
Get the amount of time in milliseconds to wait till next check.
|
static List<org.apache.hadoop.fs.FileStatus> |
getFileList(org.apache.hadoop.conf.Configuration conf,
List<org.apache.hadoop.fs.Path> logDirs,
org.apache.hadoop.fs.PathFilter filter)
Deprecated.
Get a list of paths that need to be split given a set of server-specific directories and
optionally a filter.
|
private List<org.apache.hadoop.fs.FileStatus> |
getFileList(List<org.apache.hadoop.fs.Path> logDirs,
org.apache.hadoop.fs.PathFilter filter)
Deprecated.
|
private SplitLogManagerCoordination |
getSplitLogManagerCoordination()
Deprecated.
|
(package private) ConcurrentMap<String,SplitLogManager.Task> |
getTasks()
Deprecated.
|
(package private) void |
handleDeadWorker(ServerName workerName)
Deprecated.
|
(package private) void |
handleDeadWorkers(Set<ServerName> serverNames)
Deprecated.
|
long |
splitLogDistributed(List<org.apache.hadoop.fs.Path> logDirs)
Deprecated.
The caller will block until all the log files of the given region server have been processed -
successfully split or an error is encountered - by an available worker region server.
|
long |
splitLogDistributed(org.apache.hadoop.fs.Path logDir)
Deprecated.
|
long |
splitLogDistributed(Set<ServerName> serverNames,
List<org.apache.hadoop.fs.Path> logDirs,
org.apache.hadoop.fs.PathFilter filter)
Deprecated.
The caller will block until all the hbase:meta log files of the given region server have been
processed - successfully split or an error is encountered - by an available worker region
server.
|
void |
stop()
Deprecated.
|
private void |
waitForSplittingCompletion(SplitLogManager.TaskBatch batch,
MonitoredTask status)
Deprecated.
|
private static final org.slf4j.Logger LOG
private final MasterServices server
private final org.apache.hadoop.conf.Configuration conf
private final ChoreService choreService
public static final int DEFAULT_UNASSIGNED_TIMEOUT
private long unassignedTimeout
private long lastTaskCreateTime
final ConcurrentMap<String,SplitLogManager.Task> tasks
private SplitLogManager.TimeoutMonitor timeoutMonitor
private volatile Set<ServerName> deadWorkers
private final Object deadWorkersLock
public SplitLogManager(MasterServices master, org.apache.hadoop.conf.Configuration conf) throws IOException
master
- the master servicesconf
- the HBase configuration nIOException
private SplitLogManagerCoordination getSplitLogManagerCoordination()
private List<org.apache.hadoop.fs.FileStatus> getFileList(List<org.apache.hadoop.fs.Path> logDirs, org.apache.hadoop.fs.PathFilter filter) throws IOException
IOException
public static List<org.apache.hadoop.fs.FileStatus> getFileList(org.apache.hadoop.conf.Configuration conf, List<org.apache.hadoop.fs.Path> logDirs, org.apache.hadoop.fs.PathFilter filter) throws IOException
AbstractFSWALProvider.getServerNameFromWALDirectoryName(org.apache.hadoop.conf.Configuration, java.lang.String)
for more info on directory
layout.
Should be package-private, but is needed by
WALSplitter.split(Path, Path, Path, FileSystem, Configuration, org.apache.hadoop.hbase.wal.WALFactory)
for tests.IOException
public long splitLogDistributed(org.apache.hadoop.fs.Path logDir) throws IOException
logDir
- one region sever wal dir path in .logsIOException
- if there was an error while splitting any log filepublic long splitLogDistributed(List<org.apache.hadoop.fs.Path> logDirs) throws IOException
logDirs
- List of log dirs to splitIOException
- If there was an error while splitting any log filepublic long splitLogDistributed(Set<ServerName> serverNames, List<org.apache.hadoop.fs.Path> logDirs, org.apache.hadoop.fs.PathFilter filter) throws IOException
logDirs
- List of log dirs to splitfilter
- the Path filter to select specific files for consideringIOException
- If there was an error while splitting any log fileboolean enqueueSplitTask(String taskname, SplitLogManager.TaskBatch batch)
taskname
- the path of the log to be splitbatch
- the batch this task belongs tostatic int getBatchWaitTimeMillis(int remainingTasks)
private void waitForSplittingCompletion(SplitLogManager.TaskBatch batch, MonitoredTask status)
ConcurrentMap<String,SplitLogManager.Task> getTasks()
private int activeTasks(SplitLogManager.TaskBatch batch)
private SplitLogManager.Task createTaskIfAbsent(String path, SplitLogManager.TaskBatch batch)
public void stop()
void handleDeadWorker(ServerName workerName)
void handleDeadWorkers(Set<ServerName> serverNames)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.