@InterfaceAudience.Private public class ZKSplitLogManagerCoordination extends ZooKeeperListener implements SplitLogManagerCoordination
org.apache.hadoop.hbase.master.SplitLogManagerCoordination
Modifier and Type | Class and Description |
---|---|
class |
ZKSplitLogManagerCoordination.CreateAsyncCallback
Asynchronous handler for zk create node results.
|
class |
ZKSplitLogManagerCoordination.CreateRescanAsyncCallback
Asynchronous handler for zk create RESCAN-node results.
|
class |
ZKSplitLogManagerCoordination.DeleteAsyncCallback
Asynchronous handler for zk delete node results.
|
class |
ZKSplitLogManagerCoordination.GetDataAsyncCallback
Asynchronous handler for zk get-data-set-watch on node results.
|
static interface |
ZKSplitLogManagerCoordination.TaskFinisher
SplitLogManager can use
objects implementing this interface to finish off a partially
done task by SplitLogWorker . |
static class |
ZKSplitLogManagerCoordination.ZkSplitLogManagerDetails |
SplitLogManagerCoordination.SplitLogManagerDetails
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RESUBMIT |
static int |
DEFAULT_TIMEOUT |
static int |
DEFAULT_ZK_RETRIES |
boolean |
ignoreZKDeleteForTesting |
watcher
Constructor and Description |
---|
ZKSplitLogManagerCoordination(CoordinatedStateManager manager,
ZooKeeperWatcher watcher) |
Modifier and Type | Method and Description |
---|---|
void |
checkTasks()
tells Coordination that it should check for new tasks
|
void |
checkTaskStillAvailable(String path)
Check that the task is still there
|
void |
deleteTask(String path) |
SplitLogManagerCoordination.SplitLogManagerDetails |
getDetails()
Returns the configuration that was provided previously
|
long |
getLastRecoveryTime() |
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)
Create znodes /hbase/recovering-regions/[region_ids...]/[failed region server names ...] for
all regions of the passed in region servers
|
void |
nodeDataChanged(String path)
Called when an existing node has changed data.
|
String |
prepareTask(String taskname)
Prepare the new task
|
int |
remainingTasksInCoordination()
Return the number of remaining tasks
|
void |
removeRecoveringRegions(Set<String> recoveredServerNameSet,
Boolean isMetaRecovery)
It removes recovering regions under /hbase/recovering-regions/[encoded region name] so that the
region server hosting the region can allow reads to the recovered region
|
void |
removeStaleRecoveringRegions(Set<String> knownFailedServers)
ZooKeeper implementation of
{@link org.apache.hadoop.hbase.master.
|
boolean |
resubmitTask(String path,
SplitLogManager.Task task,
SplitLogManager.ResubmitDirective directive)
Resubmit the task in case if found unassigned or failed
|
void |
setDetails(SplitLogManagerCoordination.SplitLogManagerDetails details)
Provide the configuration from the SplitLogManager
|
void |
setIgnoreDeleteForTesting(boolean b)
Temporary function that is used by unit tests only
|
void |
setRecoveryMode(boolean isForInitialization)
This function is to set recovery mode from outstanding split log tasks from before or current
configuration setting
|
void |
submitTask(String path) |
getWatcher, nodeChildrenChanged, nodeCreated, nodeDeleted
public static final int DEFAULT_TIMEOUT
public static final int DEFAULT_ZK_RETRIES
public static final int DEFAULT_MAX_RESUBMIT
public boolean ignoreZKDeleteForTesting
public ZKSplitLogManagerCoordination(CoordinatedStateManager manager, ZooKeeperWatcher watcher)
public void init() throws IOException
SplitLogManagerCoordination
init
in interface SplitLogManagerCoordination
IOException
public String prepareTask(String taskname)
SplitLogManagerCoordination
prepareTask
in interface SplitLogManagerCoordination
taskname
- name of the taskpublic int remainingTasksInCoordination()
SplitLogManagerCoordination
remainingTasksInCoordination
in interface SplitLogManagerCoordination
public void deleteTask(String path)
deleteTask
in interface SplitLogManagerCoordination
path
- to be removedpublic boolean resubmitTask(String path, SplitLogManager.Task task, SplitLogManager.ResubmitDirective directive)
SplitLogManagerCoordination
resubmitTask
in interface SplitLogManagerCoordination
path
- path related to tasktask
- to resubmitdirective
- whether it should be forcedpublic void checkTasks()
SplitLogManagerCoordination
checkTasks
in interface SplitLogManagerCoordination
public void submitTask(String path)
submitTask
in interface SplitLogManagerCoordination
path
- to be submittedpublic void checkTaskStillAvailable(String path)
SplitLogManagerCoordination
checkTaskStillAvailable
in interface SplitLogManagerCoordination
path
- node to checkpublic void removeRecoveringRegions(Set<String> recoveredServerNameSet, Boolean isMetaRecovery) throws IOException
removeRecoveringRegions
in interface SplitLogManagerCoordination
recoveredServerNameSet
- servers which are just recoveredisMetaRecovery
- whether current recovery is for the meta region on
serverNames
IOException
public void markRegionsRecovering(ServerName serverName, Set<HRegionInfo> userRegions) throws IOException, InterruptedIOException
markRegionsRecovering
in interface SplitLogManagerCoordination
serverName
- the name of a region serveruserRegions
- user regiones assigned on the region serverIOException
- in case of failureInterruptedIOException
public void nodeDataChanged(String path)
ZooKeeperListener
nodeDataChanged
in class ZooKeeperListener
path
- full path of the updated nodepublic void removeStaleRecoveringRegions(Set<String> knownFailedServers) throws IOException, InterruptedIOException
SplitLogManagerCoordination#removeStaleRecoveringRegions(Set)
removeStaleRecoveringRegions
in interface SplitLogManagerCoordination
knownFailedServers
- set of previously failed serversIOException
- in case of failureInterruptedIOException
public boolean isReplaying()
isReplaying
in interface SplitLogManagerCoordination
public boolean isSplitting()
isSplitting
in interface SplitLogManagerCoordination
public void setRecoveryMode(boolean isForInitialization) throws IOException
setRecoveryMode
in interface SplitLogManagerCoordination
isForInitialization
- IOException
InterruptedIOException
public void setDetails(SplitLogManagerCoordination.SplitLogManagerDetails details)
SplitLogManagerCoordination
setDetails
in interface SplitLogManagerCoordination
public SplitLogManagerCoordination.SplitLogManagerDetails getDetails()
SplitLogManagerCoordination
getDetails
in interface SplitLogManagerCoordination
public ZooKeeperProtos.SplitLogTask.RecoveryMode getRecoveryMode()
SplitLogManagerCoordination
getRecoveryMode
in interface SplitLogManagerCoordination
public long getLastRecoveryTime()
getLastRecoveryTime
in interface SplitLogManagerCoordination
public void setIgnoreDeleteForTesting(boolean b)
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.