@InterfaceAudience.Private public class RegionServerTracker extends ZKListener
ServerManager.expireServer(ServerName)
Modifier and Type | Field and Description |
---|---|
private boolean |
active |
private ExecutorService |
executor |
private static org.slf4j.Logger |
LOG |
private Set<ServerName> |
regionServers |
private MasterServices |
server |
watcher
Constructor and Description |
---|
RegionServerTracker(ZKWatcher watcher,
MasterServices server) |
Modifier and Type | Method and Description |
---|---|
Set<ServerName> |
getRegionServers() |
private 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.
|
getWatcher, nodeCreated, nodeDataChanged, nodeDeleted
private static final org.slf4j.Logger LOG
private boolean active
private volatile Set<ServerName> regionServers
private final MasterServices server
private final ExecutorService executor
public RegionServerTracker(ZKWatcher watcher, MasterServices server)
private org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionServerInfo getServerInfo(ServerName serverName) throws org.apache.zookeeper.KeeperException, IOException
org.apache.zookeeper.KeeperException
IOException
public void upgrade(Set<ServerName> deadServersFromPE, Set<ServerName> liveServersBeforeRestart, Set<ServerName> splittingServersFromWALDir) throws org.apache.zookeeper.KeeperException, IOException
ServerManager
. 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 in
ServerManager.findDeadServersAndProcess(Set, Set)
, we call it here under the lock
protection to prevent concurrency issues with server expiration operation.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'.org.apache.zookeeper.KeeperException
IOException
public void stop()
public Set<ServerName> getRegionServers()
private void processAsActiveMaster(Set<ServerName> newServers)
private void refresh()
public void nodeChildrenChanged(String path)
ZKListener
nodeChildrenChanged
in class ZKListener
path
- full path of the node whose children have changedCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.