Package org.apache.hadoop.hbase.util
Class ModifyRegionUtils
java.lang.Object
org.apache.hadoop.hbase.util.ModifyRegionUtils
Utility methods for interacting with the regions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RegionInfocreateRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, TableDescriptor tableDescriptor, RegionInfo newRegion, ModifyRegionUtils.RegionFillTask task) Create new set of regions on the specified file-system.static RegionInfo[]createRegionInfos(TableDescriptor tableDescriptor, byte[][] splitKeys) static List<RegionInfo>createRegions(ThreadPoolExecutor exec, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, TableDescriptor tableDescriptor, RegionInfo[] newRegions, ModifyRegionUtils.RegionFillTask task) Create new set of regions on the specified file-system.static List<RegionInfo>createRegions(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, TableDescriptor tableDescriptor, RegionInfo[] newRegions, ModifyRegionUtils.RegionFillTask task) Create new set of regions on the specified file-system.static voideditRegions(ThreadPoolExecutor exec, Collection<RegionInfo> regions, ModifyRegionUtils.RegionEditTask task) Execute the task on the specified set of regions.(package private) static ThreadPoolExecutorgetRegionOpenAndInitThreadPool(org.apache.hadoop.conf.Configuration conf, String threadNamePrefix, int regionNumber)
-
Field Details
-
LOG
-
-
Constructor Details
-
ModifyRegionUtils
private ModifyRegionUtils()
-
-
Method Details
-
createRegionInfos
-
createRegions
public static List<RegionInfo> createRegions(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, TableDescriptor tableDescriptor, RegionInfo[] 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-ConfigurationrootDir- Root directory for HBase instancetableDescriptor- description of the tablenewRegions-RegionInfothat describes the regions to createtask-ModifyRegionUtils.RegionFillTaskcustom code to populate region after creation- Throws:
IOException
-
createRegions
public static List<RegionInfo> createRegions(ThreadPoolExecutor exec, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, TableDescriptor tableDescriptor, RegionInfo[] 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 Executorconf-ConfigurationrootDir- Root directory for HBase instancetableDescriptor- description of the tablenewRegions-RegionInfothat describes the regions to createtask-ModifyRegionUtils.RegionFillTaskcustom code to populate region after creation- Throws:
IOException
-
createRegion
public static RegionInfo createRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path rootDir, TableDescriptor tableDescriptor, RegionInfo newRegion, ModifyRegionUtils.RegionFillTask task) throws IOException Create new set of regions on the specified file-system.- Parameters:
conf-ConfigurationrootDir- Root directory for HBase instancetableDescriptor- description of the tablenewRegion-RegionInfothat describes the region to createtask-ModifyRegionUtils.RegionFillTaskcustom code to populate region after creation- Throws:
IOException
-
editRegions
public static void editRegions(ThreadPoolExecutor exec, Collection<RegionInfo> regions, ModifyRegionUtils.RegionEditTask task) throws IOException Execute the task on the specified set of regions.- Parameters:
exec- Thread Pool Executorregions-RegionInfothat describes the regions to edittask-ModifyRegionUtils.RegionFillTaskcustom code to edit the region- Throws:
IOException
-
getRegionOpenAndInitThreadPool
static ThreadPoolExecutor getRegionOpenAndInitThreadPool(org.apache.hadoop.conf.Configuration conf, String threadNamePrefix, int regionNumber)
-