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
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RegionInfo
createRegion
(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 void
editRegions
(ThreadPoolExecutor exec, Collection<RegionInfo> regions, ModifyRegionUtils.RegionEditTask task) Execute the task on the specified set of regions.(package private) static ThreadPoolExecutor
getRegionOpenAndInitThreadPool
(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
-Configuration
rootDir
- Root directory for HBase instancetableDescriptor
- description of the tablenewRegions
-RegionInfo
that describes the regions to createtask
-ModifyRegionUtils.RegionFillTask
custom 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
-Configuration
rootDir
- Root directory for HBase instancetableDescriptor
- description of the tablenewRegions
-RegionInfo
that describes the regions to createtask
-ModifyRegionUtils.RegionFillTask
custom 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
-Configuration
rootDir
- Root directory for HBase instancetableDescriptor
- description of the tablenewRegion
-RegionInfo
that describes the region to createtask
-ModifyRegionUtils.RegionFillTask
custom 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
-RegionInfo
that describes the regions to edittask
-ModifyRegionUtils.RegionFillTask
custom code to edit the region- Throws:
IOException
-
getRegionOpenAndInitThreadPool
static ThreadPoolExecutor getRegionOpenAndInitThreadPool(org.apache.hadoop.conf.Configuration conf, String threadNamePrefix, int regionNumber)
-