Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.99.0
-
None
-
None
-
Reviewed
-
Add a RegionLocator Interface. Encapsulates 'region' operations. Implemented by HTable and you can get one from an HConnection.
Description
Most of the HTable methods are now abstracted by HTableInterface, with the notable exception of the following methods that pertain to region metadata:
HRegionLocation getRegionLocation(final String row) HRegionLocation getRegionLocation(final byte [] row) HRegionLocation getRegionLocation(final byte [] row, boolean reload) byte [][] getStartKeys() byte[][] getEndKeys() Pair<byte[][],byte[][]> getStartEndKeys() void clearRegionCache()
and a default scope method which maybe should be bundled with the others:
List<RegionLocations> listRegionLocations()
Since the consensus seems to be that these would muddy HTableInterface with non-core functionality, where should it go? MapReduce looks up the region boundaries, so it needs to be exposed somewhere.
Let me throw out a straw man to start the conversation. I propose:
org.apache.hadoop.hbase.client.HRegionInterface
Have HTable implement this interface. Also add these methods to HConnection:
HRegionInterface getTableRegion(TableName tableName) HRegionInterface getTableRegion(TableName tableName, ExecutorService pool)