[ 
https://issues.apache.org/jira/browse/HBASE-12394?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14194489#comment-14194489
 ] 

Weichen Ye commented on HBASE-12394:
------------------------------------

I update some lineLengths issues and upload the patch.v2
Welcome to the ReviewBoard
https://reviews.apache.org/r/27519/

This patch is large, because I add three new classes and there are too much 
redundant code between the following pairs:
TableMultiRegionInputFormat.java --  TableInputFormat.java
TableMultiRegionInputFormatBase.java --  TableInputFormatBase.java  
TableMultiRegionMapReduceUtil.java --  TableMapReduceUtil.java

I do this because in this patch I hope nothing changes in the original code 
TableInputFormat/TableInputFormatBase/TableMapReduceUtil.java. These 3 files 
are the core of HBase-Mapreduce module. I hope the first patch only mind its 
own business and do not affect others.

Now I am testing a new patch, which combine the redundant code together. In the 
new patch all changes are merged into 
TableInputFormatBase/TableInputFormat/TableMapReduceUtil.java, so the new patch 
will be smaller. If there are no compatibility problems, I will upload the 
smaller patch in few days.

So, for this patch , the only important part is the method getSplits(JobContext 
context) in TableInputFormatBase.java. 
The changes in other files are all about some references and class names, like 
(TableInputFormat.SCAN ->TableMultiRegionInputFormat.SCAN). 




> Support multiple regions as input to each mapper in map/reduce jobs
> -------------------------------------------------------------------
>
>                 Key: HBASE-12394
>                 URL: https://issues.apache.org/jira/browse/HBASE-12394
>             Project: HBase
>          Issue Type: Improvement
>          Components: mapreduce
>    Affects Versions: 2.0.0, 0.98.6.1
>            Reporter: Weichen Ye
>         Attachments: HBASE-12394.patch
>
>
> For Hadoop cluster, a job with large HBase table as input always consumes a 
> large amount of computing resources. For example, we need to create a job 
> with 1000 mappers to scan a table with 1000 regions. This patch is to support 
> one mapper using multiple regions as input.
>  
> The following new files are included in this patch:
> TableMultiRegionInputFormat.java
> TableMultiRegionInputFormatBase.java
> TableMultiRegionMapReduceUtil.java
> *TestTableMultiRegionInputFormatScan1.java
> *TestTableMultiRegionInputFormatScan2.java
> *TestTableMultiRegionInputFormatScanBase.java
> *TestTableMultiRegionMapReduceUtil.java
>  
> The files start with * are tests.
> In order to support multiple regions for one mapper, we need a new property 
> in configuration--"hbase.mapreduce.scan.regionspermapper"
> hbase.mapreduce.scan.regionspermapper controls how many regions used as input 
> for one mapper. For example,if we have an HBase table with 300 regions, and 
> we set hbase.mapreduce.scan.regionspermapper = 3. Then we run a job to scan 
> the table, the job will use only 300/3=100 mappers.
> In this way, we can control the number of mappers using the following formula.
> Number of Mappers = (Total region numbers) / 
> hbase.mapreduce.scan.regionspermapper
> This is an example of the configuration.
> <property>
>      <name>hbase.mapreduce.scan.regionspermapper</name>
>      <value>3</value>
> </property>
> This is an example for Java code:
> TableMultiRegionMapReduceUtil.initTableMapperJob(tablename, scan, Map.class, 
> Text.class, Text.class, job);
>  
>       



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to