Class MockRegionServerServices

java.lang.Object
org.apache.hadoop.hbase.MockRegionServerServices
All Implemented Interfaces:
org.apache.hadoop.hbase.Abortable, org.apache.hadoop.hbase.regionserver.FavoredNodesForRegion, org.apache.hadoop.hbase.regionserver.MutableOnlineRegions, org.apache.hadoop.hbase.regionserver.OnlineRegions, org.apache.hadoop.hbase.regionserver.RegionServerServices, org.apache.hadoop.hbase.Server, org.apache.hadoop.hbase.Stoppable

public class MockRegionServerServices extends Object implements org.apache.hadoop.hbase.regionserver.RegionServerServices
Basic mock region server services. Should only be instantiated by HBaseTestingUtility.b
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
    • regions

      private final Map<String,org.apache.hadoop.hbase.regionserver.Region> regions
    • rit

      private final ConcurrentSkipListMap<byte[],Boolean> rit
    • hfs

      private org.apache.hadoop.hbase.fs.HFileSystem hfs
    • conf

      private final org.apache.hadoop.conf.Configuration conf
    • zkw

      private org.apache.hadoop.hbase.zookeeper.ZKWatcher zkw
    • serverName

      private org.apache.hadoop.hbase.ServerName serverName
    • rpcServer

      private org.apache.hadoop.hbase.ipc.RpcServerInterface rpcServer
    • abortRequested

      private volatile boolean abortRequested
    • stopping

      private volatile boolean stopping
    • running

      private final AtomicBoolean running
  • Constructor Details

  • Method Details

    • removeRegion

      public boolean removeRegion(org.apache.hadoop.hbase.regionserver.HRegion r, org.apache.hadoop.hbase.ServerName destination)
      Specified by:
      removeRegion in interface org.apache.hadoop.hbase.regionserver.MutableOnlineRegions
    • getRegion

      public org.apache.hadoop.hbase.regionserver.Region getRegion(String encodedRegionName)
      Specified by:
      getRegion in interface org.apache.hadoop.hbase.regionserver.OnlineRegions
    • getRegions

      public List<org.apache.hadoop.hbase.regionserver.Region> getRegions(org.apache.hadoop.hbase.TableName tableName) throws IOException
      Specified by:
      getRegions in interface org.apache.hadoop.hbase.regionserver.OnlineRegions
      Throws:
      IOException
    • getRegions

      public List<org.apache.hadoop.hbase.regionserver.Region> getRegions()
      Specified by:
      getRegions in interface org.apache.hadoop.hbase.regionserver.OnlineRegions
    • addRegion

      public void addRegion(org.apache.hadoop.hbase.regionserver.HRegion r)
      Specified by:
      addRegion in interface org.apache.hadoop.hbase.regionserver.MutableOnlineRegions
    • postOpenDeployTasks

      public void postOpenDeployTasks(org.apache.hadoop.hbase.regionserver.RegionServerServices.PostOpenDeployContext context) throws IOException
      Specified by:
      postOpenDeployTasks in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
      Throws:
      IOException
    • isStopping

      public boolean isStopping()
      Specified by:
      isStopping in interface org.apache.hadoop.hbase.Server
    • getRpcServer

      public org.apache.hadoop.hbase.ipc.RpcServerInterface getRpcServer()
      Specified by:
      getRpcServer in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • setRpcServer

      public void setRpcServer(org.apache.hadoop.hbase.ipc.RpcServerInterface rpc)
    • getRegionsInTransitionInRS

      Specified by:
      getRegionsInTransitionInRS in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getFlushRequester

      public org.apache.hadoop.hbase.regionserver.FlushRequester getFlushRequester()
      Specified by:
      getFlushRequester in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getCompactionRequestor

      public org.apache.hadoop.hbase.regionserver.compactions.CompactionRequester getCompactionRequestor()
      Specified by:
      getCompactionRequestor in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getConnection

      public org.apache.hadoop.hbase.client.ClusterConnection getConnection()
      Specified by:
      getConnection in interface org.apache.hadoop.hbase.Server
    • getZooKeeper

      public org.apache.hadoop.hbase.zookeeper.ZKWatcher getZooKeeper()
      Specified by:
      getZooKeeper in interface org.apache.hadoop.hbase.Server
    • getCoordinatedStateManager

      public org.apache.hadoop.hbase.CoordinatedStateManager getCoordinatedStateManager()
      Specified by:
      getCoordinatedStateManager in interface org.apache.hadoop.hbase.Server
    • getRegionServerAccounting

      public org.apache.hadoop.hbase.regionserver.RegionServerAccounting getRegionServerAccounting()
      Specified by:
      getRegionServerAccounting in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getRegionServerRpcQuotaManager

      public org.apache.hadoop.hbase.quotas.RegionServerRpcQuotaManager getRegionServerRpcQuotaManager()
      Specified by:
      getRegionServerRpcQuotaManager in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getServerName

      public org.apache.hadoop.hbase.ServerName getServerName()
      Specified by:
      getServerName in interface org.apache.hadoop.hbase.Server
    • getConfiguration

      public org.apache.hadoop.conf.Configuration getConfiguration()
      Specified by:
      getConfiguration in interface org.apache.hadoop.hbase.Server
    • abort

      public void abort(String why, Throwable e)
      Specified by:
      abort in interface org.apache.hadoop.hbase.Abortable
    • stop

      public void stop(String why)
      Specified by:
      stop in interface org.apache.hadoop.hbase.Stoppable
    • isStopped

      public boolean isStopped()
      Specified by:
      isStopped in interface org.apache.hadoop.hbase.Stoppable
    • isAborted

      public boolean isAborted()
      Specified by:
      isAborted in interface org.apache.hadoop.hbase.Abortable
    • getFileSystem

      public org.apache.hadoop.hbase.fs.HFileSystem getFileSystem()
      Specified by:
      getFileSystem in interface org.apache.hadoop.hbase.Server
    • setFileSystem

      public void setFileSystem(org.apache.hadoop.fs.FileSystem hfs)
    • getLeaseManager

      public org.apache.hadoop.hbase.regionserver.LeaseManager getLeaseManager()
      Specified by:
      getLeaseManager in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getWALs

      public List<org.apache.hadoop.hbase.wal.WAL> getWALs() throws IOException
      Specified by:
      getWALs in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
      Throws:
      IOException
    • getWAL

      public org.apache.hadoop.hbase.wal.WAL getWAL(org.apache.hadoop.hbase.client.RegionInfo regionInfo) throws IOException
      Specified by:
      getWAL in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
      Throws:
      IOException
    • getExecutorService

      public org.apache.hadoop.hbase.executor.ExecutorService getExecutorService()
      Specified by:
      getExecutorService in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getChoreService

      public org.apache.hadoop.hbase.ChoreService getChoreService()
      Specified by:
      getChoreService in interface org.apache.hadoop.hbase.Server
    • updateRegionFavoredNodesMapping

      public void updateRegionFavoredNodesMapping(String encodedRegionName, List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes)
      Specified by:
      updateRegionFavoredNodesMapping in interface org.apache.hadoop.hbase.regionserver.FavoredNodesForRegion
    • getFavoredNodesForRegion

      public InetSocketAddress[] getFavoredNodesForRegion(String encodedRegionName)
      Specified by:
      getFavoredNodesForRegion in interface org.apache.hadoop.hbase.regionserver.FavoredNodesForRegion
    • getNonceManager

      public org.apache.hadoop.hbase.regionserver.ServerNonceManager getNonceManager()
      Specified by:
      getNonceManager in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • reportRegionStateTransition

      public boolean reportRegionStateTransition(org.apache.hadoop.hbase.regionserver.RegionServerServices.RegionStateTransitionContext context)
      Specified by:
      reportRegionStateTransition in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • registerService

      public boolean registerService(com.google.protobuf.Service service)
      Specified by:
      registerService in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getHeapMemoryManager

      public org.apache.hadoop.hbase.regionserver.HeapMemoryManager getHeapMemoryManager()
      Specified by:
      getHeapMemoryManager in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getCompactionPressure

      public double getCompactionPressure()
      Specified by:
      getCompactionPressure in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getClusterConnection

      public org.apache.hadoop.hbase.client.ClusterConnection getClusterConnection()
      Specified by:
      getClusterConnection in interface org.apache.hadoop.hbase.Server
    • getFlushThroughputController

      public org.apache.hadoop.hbase.regionserver.throttle.ThroughputController getFlushThroughputController()
      Specified by:
      getFlushThroughputController in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getFlushPressure

      public double getFlushPressure()
      Specified by:
      getFlushPressure in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getMetrics

      public org.apache.hadoop.hbase.regionserver.MetricsRegionServer getMetrics()
      Specified by:
      getMetrics in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • regionLock

      public org.apache.hadoop.hbase.client.locking.EntityLock regionLock(List<org.apache.hadoop.hbase.client.RegionInfo> regionInfos, String description, org.apache.hadoop.hbase.Abortable abort) throws IOException
      Specified by:
      regionLock in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
      Throws:
      IOException
    • getSecureBulkLoadManager

      public org.apache.hadoop.hbase.regionserver.SecureBulkLoadManager getSecureBulkLoadManager()
      Specified by:
      getSecureBulkLoadManager in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • unassign

      public void unassign(byte[] regionName) throws IOException
      Specified by:
      unassign in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
      Throws:
      IOException
    • getRegionServerSpaceQuotaManager

      public org.apache.hadoop.hbase.quotas.RegionServerSpaceQuotaManager getRegionServerSpaceQuotaManager()
      Specified by:
      getRegionServerSpaceQuotaManager in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • createConnection

      public org.apache.hadoop.hbase.client.Connection createConnection(org.apache.hadoop.conf.Configuration conf) throws IOException
      Specified by:
      createConnection in interface org.apache.hadoop.hbase.Server
      Throws:
      IOException
    • isClusterUp

      public boolean isClusterUp()
      Specified by:
      isClusterUp in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getTableDescriptors

      public org.apache.hadoop.hbase.TableDescriptors getTableDescriptors()
      Specified by:
      getTableDescriptors in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getBlockCache

      public Optional<org.apache.hadoop.hbase.io.hfile.BlockCache> getBlockCache()
      Specified by:
      getBlockCache in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getMobFileCache

      public Optional<org.apache.hadoop.hbase.mob.MobFileCache> getMobFileCache()
      Specified by:
      getMobFileCache in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getAccessChecker

      public org.apache.hadoop.hbase.security.access.AccessChecker getAccessChecker()
      Specified by:
      getAccessChecker in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • getZKPermissionWatcher

      public org.apache.hadoop.hbase.security.access.ZKPermissionWatcher getZKPermissionWatcher()
      Specified by:
      getZKPermissionWatcher in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • reportRegionSizesForQuotas

      public boolean reportRegionSizesForQuotas(org.apache.hadoop.hbase.quotas.RegionSizeStore sizeStore)
      Specified by:
      reportRegionSizesForQuotas in interface org.apache.hadoop.hbase.regionserver.RegionServerServices
    • reportFileArchivalForQuotas

      public boolean reportFileArchivalForQuotas(org.apache.hadoop.hbase.TableName tableName, Collection<Map.Entry<String,Long>> archivedFiles)
      Specified by:
      reportFileArchivalForQuotas in interface org.apache.hadoop.hbase.regionserver.RegionServerServices