Package org.apache.hadoop.hbase.master
Class RegionServerTracker
java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
org.apache.hadoop.hbase.master.RegionServerTracker
Tracks the online region servers via ZK.
Handling of new RSs checking in is done via RPC. This class is only responsible for watching for
expired nodes. It handles listening for changes in the RS node list. The only exception is when
master restart, we will use the list fetched from zk to construct the initial set of live region
servers.
If an RS node gets deleted, this automatically handles calling of
ServerManager.expireServer(ServerName)
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private final ExecutorService
private static final org.slf4j.Logger
private Set<ServerName>
private final MasterServices
Fields inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
watcher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionServerInfo
getServerInfo
(ServerName serverName) void
nodeChildrenChanged
(String path) Called when an existing node has a child node added or removed.private void
processAsActiveMaster
(Set<ServerName> newServers) private void
refresh()
void
stop()
void
upgrade
(Set<ServerName> deadServersFromPE, Set<ServerName> liveServersBeforeRestart, Set<ServerName> splittingServersFromWALDir) Upgrade to active master mode, where besides tracking the changes of region server set, we will also started to add new region servers to ServerManager and also schedule SCP if a region server dies.Methods inherited from class org.apache.hadoop.hbase.zookeeper.ZKListener
getWatcher, nodeCreated, nodeDataChanged, nodeDeleted
-
Field Details
-
LOG
-
active
-
regionServers
-
server
-
executor
-
-
Constructor Details
-
RegionServerTracker
-
-
Method Details
-
getServerInfo
private org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionServerInfo getServerInfo(ServerName serverName) throws org.apache.zookeeper.KeeperException, IOException - Throws:
org.apache.zookeeper.KeeperException
IOException
-
upgrade
public void upgrade(Set<ServerName> deadServersFromPE, Set<ServerName> liveServersBeforeRestart, Set<ServerName> splittingServersFromWALDir) throws org.apache.zookeeper.KeeperException, IOException Upgrade to active master mode, where besides tracking the changes of region server set, we will also started to add new region servers to ServerManager and also schedule SCP if a region server dies. Starts the tracking of online RegionServers. All RSes will be tracked after this method is called. In this method, we will also construct the region server sets inServerManager
. If a region server is dead between the crash of the previous master instance and the start of the current master instance, we will schedule a SCP for it. This is done inServerManager.findDeadServersAndProcess(Set, Set)
, we call it here under the lock protection to prevent concurrency issues with server expiration operation.- Parameters:
deadServersFromPE
- the region servers which already have SCP associated.liveServersBeforeRestart
- the live region servers we recorded before master restarts.splittingServersFromWALDir
- Servers whose WALs are being actively 'split'.- Throws:
org.apache.zookeeper.KeeperException
IOException
-
stop
-
getRegionServers
-
processAsActiveMaster
-
refresh
-
nodeChildrenChanged
Description copied from class:ZKListener
Called when an existing node has a child node added or removed.- Overrides:
nodeChildrenChanged
in classZKListener
- Parameters:
path
- full path of the node whose children have changed
-