Class RegionMover.RegionMoverBuilder

java.lang.Object
org.apache.hadoop.hbase.util.RegionMover.RegionMoverBuilder
Enclosing class:
RegionMover

public static class RegionMover.RegionMoverBuilder extends Object
Builder for Region mover. Use the build() method to create RegionMover object. Has filename(String), excludeFile(String), maxthreads(int), ack(boolean), timeout(int), designatedFile(String) methods to set the corresponding options.
  • Field Details

  • Constructor Details

    • RegionMoverBuilder

      public RegionMoverBuilder(String hostname)
    • RegionMoverBuilder

      public RegionMoverBuilder(String hostname, org.apache.hadoop.conf.Configuration conf)
      Parameters:
      hostname - Hostname to unload regions from or load regions to. Can be either hostname or hostname:port.
      conf - Configuration object
  • Method Details

    • createConf

      private static org.apache.hadoop.conf.Configuration createConf()
      Creates a new configuration and sets region mover specific overrides
    • filename

      Path of file where regions will be written to during unloading/read from during loading
      Returns:
      RegionMoverBuilder object
    • maxthreads

      Set the max number of threads that will be used to move regions
    • isolateRegionIdArray

      Set the region ID to isolate on the region server.
    • excludeFile

      Path of file containing hostnames to be excluded during region movement. Exclude file should have 'host:port' per line. Port is mandatory here as we can have many RS running on a single host.
    • designatedFile

      Set the designated file. Designated file contains hostnames where region moves. Designated file should have 'host:port' per line. Port is mandatory here as we can have many RS running on a single host.
      Parameters:
      designatedFile - The designated file
      Returns:
      RegionMoverBuilder object
    • ack

      public RegionMover.RegionMoverBuilder ack(boolean ack)
      Set ack/noAck mode.

      In ack mode regions are acknowledged before and after moving and the move is retried hbase.move.retries.max times, if unsuccessful we quit with exit code 1.No Ack mode is a best effort mode,each region movement is tried once.This can be used during graceful shutdown as even if we have a stuck region,upon shutdown it'll be reassigned anyway.

      Returns:
      RegionMoverBuilder object
    • timeout

      Set the timeout for Load/Unload operation in seconds.This is a global timeout,threadpool for movers also have a separate time which is hbase.move.wait.max * number of regions to load/unload
      Parameters:
      timeout - in seconds
      Returns:
      RegionMoverBuilder object
    • rackManager

      Set specific rackManager implementation. This setter method is for testing purpose only.
      Parameters:
      rackManager - rackManager impl
      Returns:
      RegionMoverBuilder object
    • build

      public RegionMover build() throws IOException
      This method builds the appropriate RegionMover object which can then be used to load/unload using load and unload methods
      Returns:
      RegionMover object
      Throws:
      IOException