Interface AsyncTableRegionLocator

All Known Implementing Classes:
AsyncTableRegionLocatorImpl

@Public public interface AsyncTableRegionLocator
The asynchronous version of RegionLocator.

Usually the implementations will not throw any exception directly, you need to get the exception from the returned CompletableFuture.

Since:
2.0.0
  • Method Details

    • getName

      Gets the fully qualified table name instance of the table whose region we want to locate.
    • getRegionLocation

      Finds the region on which the given row is being served. Does not reload the cache.

      Returns the location of the region to which the row belongs.

      Parameters:
      row - Row to find.
    • getRegionLocation

      default CompletableFuture<HRegionLocation> getRegionLocation(byte[] row, boolean reload)
      Finds the region on which the given row is being served.

      Returns the location of the region to which the row belongs.

      Parameters:
      row - Row to find.
      reload - true to reload information or false to use cached information
    • getRegionLocation

      default CompletableFuture<HRegionLocation> getRegionLocation(byte[] row, int replicaId)
      Finds the region with the given replicaId on which the given row is being served.

      Returns the location of the region with the given replicaId to which the row belongs.

      Parameters:
      row - Row to find.
      replicaId - the replica id of the region
    • getRegionLocation

      CompletableFuture<HRegionLocation> getRegionLocation(byte[] row, int replicaId, boolean reload)
      Finds the region with the given replicaId on which the given row is being served.

      Returns the location of the region with the given replicaId to which the row belongs.

      Parameters:
      row - Row to find.
      replicaId - the replica id of the region
      reload - true to reload information or false to use cached information
    • getRegionLocations

      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.
    • getRegionLocations

      CompletableFuture<List<HRegionLocation>> getRegionLocations(byte[] row, boolean reload)
      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.
    • 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.
    • getStartKeys

      default CompletableFuture<List<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 CompletableFuture<List<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 CompletableFuture<List<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
    • clearRegionLocationCache

      Clear all the entries in the region location cache.

      This may cause performance issue so use it with caution.