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

Ted Yu commented on HBASE-15482:
--------------------------------

{code}
+  public static final String  SNAPSHOT_INPUTFORMAT_CARE_BLOCK_LOCALITY_KEY = 
"hbase.TableSnapshotInputFormat.locality";
{code}
>From the current key name, it sounds like locality measure (say percent). How 
>about naming it "hbase.TableSnapshotInputFormat.locality.enable" (or something 
>similar).
{code}
+      List<String> hosts = getBestLocations(conf,
+              HRegion.computeHDFSBlocksDistribution(conf, htd, hri, tableDir));
+
+      // return at most top 3 hosts
+      int len = Math.min(3, hosts.size());
{code}
You can pass 3 to getBestLocations() so that no more than 3 hosts are returned.



> Provide an option to skip calculating block locations for SnapshotInputFormat
> -----------------------------------------------------------------------------
>
>                 Key: HBASE-15482
>                 URL: https://issues.apache.org/jira/browse/HBASE-15482
>             Project: HBase
>          Issue Type: Improvement
>          Components: mapreduce
>            Reporter: Liyin Tang
>            Assignee: Xiang Li
>            Priority: Minor
>             Fix For: 2.1.0
>
>         Attachments: HBASE-15482.master.000.patch
>
>
> When a MR job is reading from SnapshotInputFormat, it needs to calculate the 
> splits based on the block locations in order to get best locality. However, 
> this process may take a long time for large snapshots. 
> In some setup, the computing layer, Spark, Hive or Presto could run out side 
> of HBase cluster. In these scenarios, the block locality doesn't matter. 
> Therefore, it will be great to have an option to skip calculating the block 
> locations for every job. That will super useful for the Hive/Presto/Spark 
> connectors.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to