Class RegionServerTracker

java.lang.Object
org.apache.hadoop.hbase.zookeeper.ZKListener
org.apache.hadoop.hbase.master.RegionServerTracker

@Private public class RegionServerTracker extends ZKListener
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 Details

  • Constructor Details

  • 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 in 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.

      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

      public void stop()
    • getRegionServers

    • processAsActiveMaster

      private void processAsActiveMaster(Set<ServerName> newServers)
    • refresh

      private void refresh()
    • nodeChildrenChanged

      public void nodeChildrenChanged(String path)
      Description copied from class: ZKListener
      Called when an existing node has a child node added or removed.
      Overrides:
      nodeChildrenChanged in class ZKListener
      Parameters:
      path - full path of the node whose children have changed