Class SplitLogWorker
java.lang.Object
org.apache.hadoop.hbase.regionserver.SplitLogWorker
- All Implemented Interfaces:
Runnable
Deprecated.
since 2.4.0 and in 3.0.0, to be removed in 4.0.0, replaced by procedure-based
distributed WAL splitter, see SplitWALRemoteProcedure
This worker is spawned in every regionserver, including master. The Worker waits for log
splitting tasks to be put up by the
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Deprecated.Objects implementing this interface actually do the task that has been acquired by aSplitLogWorker
. -
Field Summary
Modifier and TypeFieldDescriptionprivate final SplitLogWorkerCoordination
Deprecated.private static final org.slf4j.Logger
Deprecated.private final RegionServerServices
Deprecated.(package private) Thread
Deprecated. -
Constructor Summary
ConstructorDescriptionSplitLogWorker
(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. -
Method Summary
Modifier and TypeMethodDescriptionint
Deprecated.Returns the number of tasks processed by coordination.private static boolean
processSyncReplicationWAL
(String name, org.apache.hadoop.conf.Configuration conf, RegionServerServices server, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path walDir) Deprecated.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 threadvoid
stop()
Deprecated.stop the SplitLogWorker threadvoid
stopTask()
Deprecated.If the worker is doing a task i.e.
-
Field Details
-
LOG
Deprecated. -
worker
Deprecated. -
coordination
Deprecated. -
server
Deprecated.
-
-
Constructor Details
-
SplitLogWorker
public SplitLogWorker(Server hserver, org.apache.hadoop.conf.Configuration conf, RegionServerServices server, SplitLogWorker.TaskExecutor splitTaskExecutor) Deprecated. -
SplitLogWorker
public SplitLogWorker(org.apache.hadoop.conf.Configuration conf, RegionServerServices server, LastSequenceId sequenceIdChecker, WALFactory factory) Deprecated.
-
-
Method Details
-
processSyncReplicationWAL
private static boolean processSyncReplicationWAL(String name, org.apache.hadoop.conf.Configuration conf, RegionServerServices server, org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path walDir) throws IOException Deprecated.- Throws:
IOException
-
splitLog
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. -
run
Deprecated. -
stopTask
Deprecated.If the worker is doing a task i.e. splitting a log file then stop the task. It doesn't exit the worker thread. -
start
Deprecated.start the SplitLogWorker thread -
stop
Deprecated.stop the SplitLogWorker thread -
getTaskReadySeq
Deprecated.Returns the number of tasks processed by coordination. This method is used by tests only
-