Class TestRegionSizeCalculator

java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestRegionSizeCalculator

public class TestRegionSizeCalculator extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final HBaseClassTestRule
     
    private org.apache.hadoop.conf.Configuration
     
    private final long
     
    private final org.apache.hadoop.hbase.ServerName
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private org.apache.hadoop.hbase.client.Admin
    mockAdmin(org.apache.hadoop.hbase.RegionMetrics... regionLoadArray)
    Creates mock returning RegionLoad info about given servers.
    private org.apache.hadoop.hbase.RegionMetrics
    mockRegion(String regionName, int fileSizeMb, int memStoreSize)
    Creates mock of region with given name and size.
    private org.apache.hadoop.hbase.client.RegionLocator
    mockRegionLocator(String... regionNames)
    Makes some table with given region names.
    private org.apache.hadoop.hbase.client.RegionLocator
    mockRegionLocator(org.apache.hadoop.hbase.ServerName serverName, List<String> regionNames)
     
    void
    When calculator is disabled, it should return 0 for each request.
    void
    When size of region in megabytes is larger than largest possible integer there could be error caused by lost of precision.
    void
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • testSimpleTestCase

      public void testSimpleTestCase() throws Exception
      Throws:
      Exception
    • testLargeRegion

      public void testLargeRegion() throws Exception
      When size of region in megabytes is larger than largest possible integer there could be error caused by lost of precision.
      Throws:
      Exception
    • testDisabled

      public void testDisabled() throws Exception
      When calculator is disabled, it should return 0 for each request.
      Throws:
      Exception
    • testRegionWithNullServerName

      Throws:
      Exception
    • mockRegionLocator

      private org.apache.hadoop.hbase.client.RegionLocator mockRegionLocator(String... regionNames) throws IOException
      Makes some table with given region names.
      Throws:
      IOException
    • mockRegionLocator

      private org.apache.hadoop.hbase.client.RegionLocator mockRegionLocator(org.apache.hadoop.hbase.ServerName serverName, List<String> regionNames) throws IOException
      Throws:
      IOException
    • mockAdmin

      private org.apache.hadoop.hbase.client.Admin mockAdmin(org.apache.hadoop.hbase.RegionMetrics... regionLoadArray) throws Exception
      Creates mock returning RegionLoad info about given servers.
      Throws:
      Exception
    • mockRegion

      private org.apache.hadoop.hbase.RegionMetrics mockRegion(String regionName, int fileSizeMb, int memStoreSize)
      Creates mock of region with given name and size.
      Parameters:
      fileSizeMb - number of megabytes occupied by region in file store in megabytes
      memStoreSize - number of megabytes occupied by region in memstore in megabytes