Interface RegionLocator

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
RegionLocatorOverAsyncTableRegionLocator

@Public public interface RegionLocator extends Closeable
Used to view region location information for a single HBase table. Obtain an instance from an Connection.
Since:
0.99.0
See Also:
  • Field Details

  • Method Details

    • getRegionLocation

      default HRegionLocation getRegionLocation(byte[] row) throws IOException
      Finds the region on which the given row is being served. Does not reload the cache.
      Parameters:
      row - Row to find.
      Returns:
      Location of the row.
      Throws:
      IOException - if a remote or network exception occurs
    • getRegionLocation

      default HRegionLocation getRegionLocation(byte[] row, boolean reload) throws IOException
      Finds the region on which the given row is being served.
      Parameters:
      row - Row to find.
      reload - true to reload information or false to use cached information
      Returns:
      Location of the row.
      Throws:
      IOException - if a remote or network exception occurs
    • getRegionLocation

      default HRegionLocation getRegionLocation(byte[] row, int replicaId) throws IOException
      Finds the region with the given replica id on which the given row is being served.
      Parameters:
      row - Row to find.
      replicaId - the replica id
      Returns:
      Location of the row.
      Throws:
      IOException - if a remote or network exception occurs
    • getRegionLocation

      HRegionLocation getRegionLocation(byte[] row, int replicaId, boolean reload) throws IOException
      Finds the region with the given replica id on which the given row is being served.
      Parameters:
      row - Row to find.
      replicaId - the replica id
      reload - true to reload information or false to use cached information
      Returns:
      Location of the row.
      Throws:
      IOException - if a remote or network exception occurs
    • getRegionLocations

      default List<HRegionLocation> getRegionLocations(byte[] row) throws IOException
      Find all the replicas for the region on which the given row is being served.
      Parameters:
      row - Row to find.
      Returns:
      Locations for all the replicas of the row.
      Throws:
      IOException - if a remote or network exception occurs
    • getRegionLocations

      List<HRegionLocation> getRegionLocations(byte[] row, boolean reload) throws IOException
      Find all the replicas for the region on which the given row is being served.
      Parameters:
      row - Row to find.
      reload - true to reload information or false to use cached information
      Returns:
      Locations for all the replicas of the row.
      Throws:
      IOException - if a remote or network exception occurs
    • clearRegionLocationCache

      Clear all the entries in the region location cache.

      This may cause performance issue so use it with caution.

    • getAllRegionLocations

      Retrieves all of the regions associated with this table.

      Usually we will go to meta table directly in this method so there is no reload parameter.

      Notice that the location for region replicas other than the default replica are also returned.

      Returns:
      a List of all regions associated with this table.
      Throws:
      IOException - if a remote or network exception occurs
    • getStartKeys

      default byte[][] getStartKeys() throws IOException
      Gets the starting row key for every region in the currently open table.

      This is mainly useful for the MapReduce integration.

      Returns:
      Array of region starting row keys
      Throws:
      IOException - if a remote or network exception occurs
    • getEndKeys

      default byte[][] getEndKeys() throws IOException
      Gets the ending row key for every region in the currently open table.

      This is mainly useful for the MapReduce integration.

      Returns:
      Array of region ending row keys
      Throws:
      IOException - if a remote or network exception occurs
    • getStartEndKeys

      default Pair<byte[][],byte[][]> getStartEndKeys() throws IOException
      Gets the starting and ending row keys for every region in the currently open table.

      This is mainly useful for the MapReduce integration.

      Returns:
      Pair of arrays of region starting and ending row keys
      Throws:
      IOException - if a remote or network exception occurs
    • getName

      Gets the fully qualified table name instance of this table.