@Deprecated @InterfaceAudience.Private public class SplitLogWorker extends Object implements Runnable
SplitLogManager
running in the master and races with other workers in other serves to acquire those tasks. The
coordination is done via coordination engine.
If a worker has successfully moved the task from state UNASSIGNED to OWNED then it owns the task. It keeps heart beating the manager by periodically moving the task from UNASSIGNED to OWNED state. On success it moves the task to TASK_DONE. On unrecoverable error it moves task state to ERR. If it cannot continue but wants the master to retry the task then it moves the task state to RESIGNED.
The manager can take a task away from a worker by moving the task from OWNED to UNASSIGNED. In the absence of a global lock there is a unavoidable race here - a worker might have just finished its task when it is stripped of its ownership. Here we rely on the idempotency of the log splitting task for correctness
Modifier and Type | Class and Description |
---|---|
static interface |
SplitLogWorker.TaskExecutor
Deprecated.
Objects implementing this interface actually do the task that has been acquired by a
SplitLogWorker . |
Modifier and Type | Field and Description |
---|---|
private org.apache.hadoop.conf.Configuration |
conf
Deprecated.
|
private SplitLogWorkerCoordination |
coordination
Deprecated.
|
private static org.slf4j.Logger |
LOG
Deprecated.
|
private RegionServerServices |
server
Deprecated.
|
(package private) Thread |
worker
Deprecated.
|
Constructor and Description |
---|
SplitLogWorker(org.apache.hadoop.conf.Configuration conf,
RegionServerServices server,
LastSequenceId sequenceIdChecker,
WALFactory factory)
Deprecated.
|
SplitLogWorker(Server hserver,
org.apache.hadoop.conf.Configuration conf,
RegionServerServices server,
SplitLogWorker.TaskExecutor splitTaskExecutor)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
getTaskReadySeq()
Deprecated.
Returns the number of tasks processed by coordination.
|
void |
run()
Deprecated.
|
(package private) static SplitLogWorker.TaskExecutor.Status |
splitLog(String filename,
CancelableProgressable p,
org.apache.hadoop.conf.Configuration conf,
RegionServerServices server,
LastSequenceId sequenceIdChecker,
WALFactory factory)
Deprecated.
Returns Result either DONE, RESIGNED, or ERR.
|
void |
start()
Deprecated.
start the SplitLogWorker thread
|
void |
stop()
Deprecated.
stop the SplitLogWorker thread
|
void |
stopTask()
Deprecated.
If the worker is doing a task i.e.
|
private static final org.slf4j.Logger LOG
private final SplitLogWorkerCoordination coordination
private final org.apache.hadoop.conf.Configuration conf
private final RegionServerServices server
public SplitLogWorker(Server hserver, org.apache.hadoop.conf.Configuration conf, RegionServerServices server, SplitLogWorker.TaskExecutor splitTaskExecutor)
public SplitLogWorker(org.apache.hadoop.conf.Configuration conf, RegionServerServices server, LastSequenceId sequenceIdChecker, WALFactory factory)
static SplitLogWorker.TaskExecutor.Status splitLog(String filename, CancelableProgressable p, org.apache.hadoop.conf.Configuration conf, RegionServerServices server, LastSequenceId sequenceIdChecker, WALFactory factory)
public void stopTask()
public void start()
public void stop()
public int getTaskReadySeq()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.