[HBASE-10360] Expose the HRegionLocations for each HTable in an efficient way

Author: liyintang

Summary:
After discussing with Calypso team, they are currently using HTable.getHRegionInfo() to get all the HRegionLocation information. This function is relatively expensive because it needs to scan through the META region to get all the Region to ServerAddress mapping. And Calypso needs to issue this function call for each query. So this following new API will return the cached HRegionLocation directly without querying the META. In the most cases, the cachedLocations is relatively update-to-date and Calypso is also able to tolerant the stale information as well.

  /**
   * Get all the cached HRegionLocations.
   * @param forceRefresh
   * @return
   */
  public Collection<HRegionLocation> getCachedHRegionLocations(boolean forceRefresh);

Test Plan: Run the unit test for this new API to make sure both HTable.getHRegionInfo() and HTable.getCachedHRegionLocations() returns the same data.

Reviewers: manukranthk

Reviewed By: manukranthk

CC: hbase-eng@, ehwang

Differential Revision: https://phabricator.fb.com/D1124663

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1558890 13f79535-47bb-0310-9956-ffa450edef68
[master] Add 2 extra options to debug replication issue

Author: jiqingt

Summary:
Add -o option to enable processing of hlog starting from an offset;
Add -t option to limit the number of transactions to be processed.

Test Plan: built and manually ran the utlity.

Reviewers: mycnyc, aleksandr

Reviewed By: aleksandr

CC: aleksandr

Differential Revision: https://phabricator.fb.com/D1129807

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1558891 13f79535-47bb-0310-9956-ffa450edef68