@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, nodeDeletedpublic 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
SplitLogManagerCoordinationinit in interface SplitLogManagerCoordinationIOExceptionpublic String prepareTask(String taskname)
SplitLogManagerCoordinationprepareTask in interface SplitLogManagerCoordinationtaskname - name of the taskpublic int remainingTasksInCoordination()
SplitLogManagerCoordinationremainingTasksInCoordination in interface SplitLogManagerCoordinationpublic void deleteTask(String path)
deleteTask in interface SplitLogManagerCoordinationpath - to be removedpublic boolean resubmitTask(String path, SplitLogManager.Task task, SplitLogManager.ResubmitDirective directive)
SplitLogManagerCoordinationresubmitTask in interface SplitLogManagerCoordinationpath - path related to tasktask - to resubmitdirective - whether it should be forcedpublic void checkTasks()
SplitLogManagerCoordinationcheckTasks in interface SplitLogManagerCoordinationpublic void submitTask(String path)
submitTask in interface SplitLogManagerCoordinationpath - to be submittedpublic void checkTaskStillAvailable(String path)
SplitLogManagerCoordinationcheckTaskStillAvailable in interface SplitLogManagerCoordinationpath - node to checkpublic void removeRecoveringRegions(Set<String> recoveredServerNameSet, Boolean isMetaRecovery) throws IOException
removeRecoveringRegions in interface SplitLogManagerCoordinationrecoveredServerNameSet - servers which are just recoveredisMetaRecovery - whether current recovery is for the meta region on
serverNamesIOExceptionpublic void markRegionsRecovering(ServerName serverName, Set<HRegionInfo> userRegions) throws IOException, InterruptedIOException
markRegionsRecovering in interface SplitLogManagerCoordinationserverName - the name of a region serveruserRegions - user regiones assigned on the region serverIOException - in case of failureInterruptedIOExceptionpublic void nodeDataChanged(String path)
ZooKeeperListenernodeDataChanged in class ZooKeeperListenerpath - full path of the updated nodepublic void removeStaleRecoveringRegions(Set<String> knownFailedServers) throws IOException, InterruptedIOException
SplitLogManagerCoordination#removeStaleRecoveringRegions(Set)removeStaleRecoveringRegions in interface SplitLogManagerCoordinationknownFailedServers - set of previously failed serversIOException - in case of failureInterruptedIOExceptionpublic boolean isReplaying()
isReplaying in interface SplitLogManagerCoordinationpublic boolean isSplitting()
isSplitting in interface SplitLogManagerCoordinationpublic void setRecoveryMode(boolean isForInitialization)
throws IOException
setRecoveryMode in interface SplitLogManagerCoordinationisForInitialization - IOExceptionInterruptedIOExceptionpublic void setDetails(SplitLogManagerCoordination.SplitLogManagerDetails details)
SplitLogManagerCoordinationsetDetails in interface SplitLogManagerCoordinationpublic SplitLogManagerCoordination.SplitLogManagerDetails getDetails()
SplitLogManagerCoordinationgetDetails in interface SplitLogManagerCoordinationpublic ZooKeeperProtos.SplitLogTask.RecoveryMode getRecoveryMode()
SplitLogManagerCoordinationgetRecoveryMode in interface SplitLogManagerCoordinationpublic long getLastRecoveryTime()
getLastRecoveryTime in interface SplitLogManagerCoordinationpublic void setIgnoreDeleteForTesting(boolean b)
Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.