@InterfaceAudience.Private public interface SplitLogWorkerCoordination
SplitLogWorker
and
WALSplitterHandler
Important
methods for SplitLogWorker: isReady()
called from SplitLogWorker.run()
to check whether the coordination is
ready to supply the tasks taskLoop()
loop for new tasks until the worker is stopped isStop()
a flag indicates whether worker should finish registerListener()
called from SplitLogWorker.run()
and could register listener
for external changes in coordination (if required) endTask(SplitLogTask, LongAdder, SplitTaskDetails)
notify coordination engine that
Important methods for WALSplitterHandler:
splitting task has completed.
Modifier and Type | Interface and Description |
---|---|
static interface |
SplitLogWorkerCoordination.SplitTaskDetails
Interface for log-split tasks Used to carry implementation details in encapsulated way through
Handlers to the coordination API.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_SPLITTERS |
Modifier and Type | Method and Description |
---|---|
void |
endTask(SplitLogTask slt,
LongAdder ctr,
SplitLogWorkerCoordination.SplitTaskDetails splitTaskDetails)
Notify coordination engine that splitting task has completed.
|
int |
getTaskReadySeq()
Used by unit tests to check how many tasks were processed
|
void |
init(RegionServerServices server,
org.apache.hadoop.conf.Configuration conf,
SplitLogWorker.TaskExecutor splitTaskExecutor,
SplitLogWorker worker)
Initialize internal values.
|
boolean |
isReady()
Check whether the log splitter is ready to supply tasks
|
boolean |
isStop() |
void |
markCorrupted(org.apache.hadoop.fs.Path rootDir,
String name,
org.apache.hadoop.fs.FileSystem fs)
marks log file as corrupted
|
void |
registerListener()
set the listener for task changes.
|
void |
removeListener()
remove the listener for task changes.
|
void |
stopProcessingTasks()
called when Coordination should stop processing tasks and exit
|
void |
taskLoop()
Wait for the new tasks and grab one
|
static final int DEFAULT_MAX_SPLITTERS
void init(RegionServerServices server, org.apache.hadoop.conf.Configuration conf, SplitLogWorker.TaskExecutor splitTaskExecutor, SplitLogWorker worker)
server
- instance of RegionServerServices to work withconf
- is current configuration.splitTaskExecutor
- split executor from SplitLogWorkerworker
- instance of SplitLogWorkervoid stopProcessingTasks()
boolean isStop()
void taskLoop() throws InterruptedException
InterruptedException
- if the SplitLogWorker was stoppedvoid markCorrupted(org.apache.hadoop.fs.Path rootDir, String name, org.apache.hadoop.fs.FileSystem fs)
rootDir
- where to find the logname
- of the logfs
- file systemboolean isReady() throws InterruptedException
InterruptedException
- if the SplitLogWorker was stoppedint getTaskReadySeq()
void registerListener()
void removeListener()
void endTask(SplitLogTask slt, LongAdder ctr, SplitLogWorkerCoordination.SplitTaskDetails splitTaskDetails)
slt
- See SplitLogTask
ctr
- counter to be updatedsplitTaskDetails
- details about log split task (specific to coordination engine being
used).Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.