@InterfaceAudience.Private public interface SplitLogManagerCoordination
prepareTask(java.lang.String)
and submit it by
submitTask(String)
. After that it periodically check the number of remaining tasks by
remainingTasksInCoordination()
and waits until it become zero.
Methods required for task life circle:
markRegionsRecovering(ServerName, Set)
mark regions for log replaying. Used by
MasterFileSystem
removeRecoveringRegions(Set, Boolean)
make regions cleanup that previous were marked as
recovering. Called after all tasks processed
removeStaleRecoveringRegions(Set)
remove stale recovering. called by
MasterFileSystem
after Active Master is initialized
getLastRecoveryTime()
required for garbage collector and should indicate when the last
recovery has been made
checkTaskStillAvailable(String)
Check that task is still there
checkTasks()
check for unassigned tasks and resubmit them
Modifier and Type | Interface and Description |
---|---|
static class |
SplitLogManagerCoordination.SplitLogManagerDetails
Detail class that shares data between coordination and split log manager
|
Modifier and Type | Method and Description |
---|---|
void |
checkTasks()
tells Coordination that it should check for new tasks
|
void |
checkTaskStillAvailable(String task)
Check that the task is still there
|
void |
deleteTask(String taskName) |
SplitLogManagerCoordination.SplitLogManagerDetails |
getDetails()
Returns the configuration that was provided previously
|
long |
getLastRecoveryTime() |
org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode |
getRecoveryMode()
Temporary function, mostly for UTs.
|
void |
init()
Support method to init constants such as timeout.
|
boolean |
isReplaying() |
boolean |
isSplitting() |
void |
markRegionsRecovering(ServerName serverName,
Set<HRegionInfo> userRegions)
Mark regions in recovering state for distributed log replay
|
String |
prepareTask(String taskName)
Prepare the new task
|
int |
remainingTasksInCoordination()
Return the number of remaining tasks
|
void |
removeRecoveringRegions(Set<String> serverNames,
Boolean isMetaRecovery)
It removes recovering regions from Coordination
|
void |
removeStaleRecoveringRegions(Set<String> knownServers)
Removes known stale servers
|
boolean |
resubmitTask(String taskName,
SplitLogManager.Task task,
SplitLogManager.ResubmitDirective force)
Resubmit the task in case if found unassigned or failed
|
void |
setDetails(SplitLogManagerCoordination.SplitLogManagerDetails details)
Provide the configuration from the SplitLogManager
|
void |
setRecoveryMode(boolean b)
Change the recovery mode.
|
void |
submitTask(String taskName) |
void setDetails(SplitLogManagerCoordination.SplitLogManagerDetails details)
SplitLogManagerCoordination.SplitLogManagerDetails getDetails()
String prepareTask(String taskName)
taskName
- name of the taskvoid markRegionsRecovering(ServerName serverName, Set<HRegionInfo> userRegions) throws IOException, InterruptedIOException
serverName
- server nameuserRegions
- set of regions to be markedIOException
- in case of failureInterruptedIOException
void checkTasks()
void removeRecoveringRegions(Set<String> serverNames, Boolean isMetaRecovery) throws IOException
serverNames
- servers which are just recoveredisMetaRecovery
- whether current recovery is for the meta region on
serverNames
IOException
int remainingTasksInCoordination()
void checkTaskStillAvailable(String task)
task
- node to checkvoid setRecoveryMode(boolean b) throws InterruptedIOException, IOException
b
- the recovery mode stateInterruptedIOException
IOException
- in case of failurevoid removeStaleRecoveringRegions(Set<String> knownServers) throws IOException, InterruptedIOException
knownServers
- set of previously failed serversIOException
- in case of failureInterruptedIOException
boolean resubmitTask(String taskName, SplitLogManager.Task task, SplitLogManager.ResubmitDirective force)
taskName
- path related to tasktask
- to resubmitforce
- whether it should be forcedvoid submitTask(String taskName)
taskName
- to be submittedvoid deleteTask(String taskName)
taskName
- to be removedboolean isReplaying()
boolean isSplitting()
long getLastRecoveryTime()
org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.SplitLogTask.RecoveryMode getRecoveryMode()
void init() throws IOException
IOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.