org.apache.hadoop.hbase.util
Class ModifyRegionUtils

java.lang.Object
  extended by org.apache.hadoop.hbase.util.ModifyRegionUtils

@InterfaceAudience.Private
public abstract class ModifyRegionUtils
extends Object

Utility methods for interacting with the regions.


Nested Class Summary
static interface ModifyRegionUtils.RegionEditTask
           
static interface ModifyRegionUtils.RegionFillTask
           
 
Method Summary
static void assignRegions(AssignmentManager assignmentManager, List<HRegionInfo> regionInfos)
          Triggers a bulk assignment of the specified regions
static HRegionInfo createRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path tableDir, HTableDescriptor hTableDescriptor, HRegionInfo newRegion, ModifyRegionUtils.RegionFillTask task)
          Create new set of regions on the specified file-system.
static List<HRegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, HTableDescriptor hTableDescriptor, HRegionInfo[] newRegions)
          Create new set of regions on the specified file-system.
static List<HRegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, HTableDescriptor hTableDescriptor, HRegionInfo[] newRegions, ModifyRegionUtils.RegionFillTask task)
          Create new set of regions on the specified file-system.
static List<HRegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path tableDir, HTableDescriptor hTableDescriptor, HRegionInfo[] newRegions, ModifyRegionUtils.RegionFillTask task)
          Create new set of regions on the specified file-system.
static List<HRegionInfo> createRegions(ThreadPoolExecutor exec, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, org.apache.hadoop.fs.Path tableDir, HTableDescriptor hTableDescriptor, HRegionInfo[] newRegions, ModifyRegionUtils.RegionFillTask task)
          Create new set of regions on the specified file-system.
static void editRegions(ThreadPoolExecutor exec, Collection<HRegionInfo> regions, ModifyRegionUtils.RegionEditTask task)
          Execute the task on the specified set of regions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createRegions

public static List<HRegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf,
                                              org.apache.hadoop.fs.Path rootDir,
                                              HTableDescriptor hTableDescriptor,
                                              HRegionInfo[] newRegions)
                                       throws IOException
Create new set of regions on the specified file-system. NOTE: that you should add the regions to hbase:meta after this operation.

Parameters:
conf - Configuration
rootDir - Root directory for HBase instance
hTableDescriptor - description of the table
newRegions - HRegionInfo that describes the regions to create
Throws:
IOException

createRegions

public static List<HRegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf,
                                              org.apache.hadoop.fs.Path rootDir,
                                              HTableDescriptor hTableDescriptor,
                                              HRegionInfo[] newRegions,
                                              ModifyRegionUtils.RegionFillTask task)
                                       throws IOException
Create new set of regions on the specified file-system. NOTE: that you should add the regions to hbase:meta after this operation.

Parameters:
conf - Configuration
rootDir - Root directory for HBase instance
hTableDescriptor - description of the table
newRegions - HRegionInfo that describes the regions to create
task - ModifyRegionUtils.RegionFillTask custom code to populate region after creation
Throws:
IOException

createRegions

public static List<HRegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf,
                                              org.apache.hadoop.fs.Path rootDir,
                                              org.apache.hadoop.fs.Path tableDir,
                                              HTableDescriptor hTableDescriptor,
                                              HRegionInfo[] newRegions,
                                              ModifyRegionUtils.RegionFillTask task)
                                       throws IOException
Create new set of regions on the specified file-system. NOTE: that you should add the regions to hbase:meta after this operation.

Parameters:
conf - Configuration
rootDir - Root directory for HBase instance
tableDir - table directory
hTableDescriptor - description of the table
newRegions - HRegionInfo that describes the regions to create
task - ModifyRegionUtils.RegionFillTask custom code to populate region after creation
Throws:
IOException

createRegions

public static List<HRegionInfo> createRegions(ThreadPoolExecutor exec,
                                              org.apache.hadoop.conf.Configuration conf,
                                              org.apache.hadoop.fs.Path rootDir,
                                              org.apache.hadoop.fs.Path tableDir,
                                              HTableDescriptor hTableDescriptor,
                                              HRegionInfo[] newRegions,
                                              ModifyRegionUtils.RegionFillTask task)
                                       throws IOException
Create new set of regions on the specified file-system. NOTE: that you should add the regions to hbase:meta after this operation.

Parameters:
exec - Thread Pool Executor
conf - Configuration
rootDir - Root directory for HBase instance
tableDir - table directory
hTableDescriptor - description of the table
newRegions - HRegionInfo that describes the regions to create
task - ModifyRegionUtils.RegionFillTask custom code to populate region after creation
Throws:
IOException

createRegion

public static HRegionInfo createRegion(org.apache.hadoop.conf.Configuration conf,
                                       org.apache.hadoop.fs.Path rootDir,
                                       org.apache.hadoop.fs.Path tableDir,
                                       HTableDescriptor hTableDescriptor,
                                       HRegionInfo newRegion,
                                       ModifyRegionUtils.RegionFillTask task)
                                throws IOException
Create new set of regions on the specified file-system.

Parameters:
conf - Configuration
rootDir - Root directory for HBase instance
tableDir - table directory
hTableDescriptor - description of the table
newRegion - HRegionInfo that describes the region to create
task - ModifyRegionUtils.RegionFillTask custom code to populate region after creation
Throws:
IOException

editRegions

public static void editRegions(ThreadPoolExecutor exec,
                               Collection<HRegionInfo> regions,
                               ModifyRegionUtils.RegionEditTask task)
                        throws IOException
Execute the task on the specified set of regions.

Parameters:
exec - Thread Pool Executor
regions - HRegionInfo that describes the regions to edit
task - ModifyRegionUtils.RegionFillTask custom code to edit the region
Throws:
IOException

assignRegions

public static void assignRegions(AssignmentManager assignmentManager,
                                 List<HRegionInfo> regionInfos)
                          throws IOException
Triggers a bulk assignment of the specified regions

Parameters:
assignmentManager - the Assignment Manger
regionInfos - the list of regions to assign
Throws:
IOException - if an error occurred during the assignment


Copyright © 2015 The Apache Software Foundation. All rights reserved.