Interface ClusterConnection

All Superinterfaces:
Abortable, AutoCloseable, Closeable, Connection
All Known Implementing Classes:
ConnectionImplementation, ConnectionUtils.MasterlessConnection, ServerConnectionUtils.ShortCircuitingClusterConnection

@Private public interface ClusterConnection extends Connection
Internal methods on Connection that should not be used by user code.
  • Field Details

  • Method Details

    • isMasterRunning

      Deprecated.
      this has been deprecated without a replacement
      Returns:
      - true if the master server is running
      Throws:
      MasterNotRunningException
      ZooKeeperConnectionException
    • isTableAvailable

      boolean isTableAvailable(TableName tableName, byte[][] splitKeys) throws IOException
      Use this api to check if the table has been created with the specified number of splitkeys which was used while creating the given table. Note : If this api is used after a table's region gets splitted, the api may return false. tableName splitKeys used while creating table if a remote or network exception occurs
      Throws:
      IOException
    • isTableEnabled

      boolean isTableEnabled(TableName tableName) throws IOException
      A table that isTableEnabled == false and isTableDisabled == false is possible. This happens when a table has a lot of regions that must be processed.
      Parameters:
      tableName - table name
      Returns:
      true if the table is enabled, false otherwise
      Throws:
      IOException - if a remote or network exception occurs
    • isTableDisabled

      boolean isTableDisabled(TableName tableName) throws IOException
      Check if a table is disabled.
      Parameters:
      tableName - table name
      Returns:
      true if the table is disabled, false otherwise
      Throws:
      IOException - if a remote or network exception occurs
    • getTableState

      Retrieve TableState, represent current table state.
      Parameters:
      tableName - table state for
      Returns:
      state of the table
      Throws:
      IOException
    • locateRegion

      HRegionLocation locateRegion(TableName tableName, byte[] row) throws IOException
      Find the location of the region of tableName that row lives in.
      Parameters:
      tableName - name of the table row is in
      row - row key you're trying to find the region of
      Returns:
      HRegionLocation that describes where to find the region in question
      Throws:
      IOException - if a remote or network exception occurs
    • clearRegionCache

      @Deprecated default void clearRegionCache()
      Clear the region location cache.
    • cacheLocation

      void cacheLocation(TableName tableName, RegionLocations location)
    • clearRegionCache

      void clearRegionCache(TableName tableName)
      Allows flushing the region cache of all locations that pertain to tableName
      Parameters:
      tableName - Name of the table whose regions we are to remove from cache.
    • relocateRegion

      HRegionLocation relocateRegion(TableName tableName, byte[] row) throws IOException
      Find the location of the region of tableName that row lives in, ignoring any value that might be in the cache.
      Parameters:
      tableName - name of the table row is in
      row - row key you're trying to find the region of
      Returns:
      HRegionLocation that describes where to find the region in question
      Throws:
      IOException - if a remote or network exception occurs
    • relocateRegion

      RegionLocations relocateRegion(TableName tableName, byte[] row, int replicaId) throws IOException
      Find the location of the region of tableName that row lives in, ignoring any value that might be in the cache.
      Parameters:
      tableName - name of the table row is in
      row - row key you're trying to find the region of
      replicaId - the replicaId of the region
      Returns:
      RegionLocations that describe where to find the region in question
      Throws:
      IOException - if a remote or network exception occurs
    • updateCachedLocations

      void updateCachedLocations(TableName tableName, byte[] regionName, byte[] rowkey, Object exception, ServerName source)
      Update the location cache. This is used internally by HBase, in most cases it should not be used by the client application.
      Parameters:
      tableName - the table name
      regionName - the region name
      rowkey - the row
      exception - the exception if any. Can be null.
      source - the previous location
    • locateRegion

      HRegionLocation locateRegion(byte[] regionName) throws IOException
      Gets the location of the region of regionName.
      Parameters:
      regionName - name of the region to locate
      Returns:
      HRegionLocation that describes where to find the region in question
      Throws:
      IOException - if a remote or network exception occurs
    • locateRegions

      Gets the locations of all regions in the specified table, tableName.
      Parameters:
      tableName - table to get regions of
      Returns:
      list of region locations for all regions of table
      Throws:
      IOException - if IO failure occurs
    • locateRegions

      List<HRegionLocation> locateRegions(TableName tableName, boolean useCache, boolean offlined) throws IOException
      Gets the locations of all regions in the specified table, tableName.
      Parameters:
      tableName - table to get regions of
      useCache - Should we use the cache to retrieve the region information.
      offlined - True if we are to include offlined regions, false and we'll leave out offlined regions from returned list.
      Returns:
      list of region locations for all regions of table
      Throws:
      IOException - if IO failure occurs
    • locateRegion

      RegionLocations locateRegion(TableName tableName, byte[] row, boolean useCache, boolean retry) throws IOException
      Gets the locations of the region in the specified table, tableName, for a given row.
      Parameters:
      tableName - table to get regions of
      row - the row
      useCache - Should we use the cache to retrieve the region information.
      retry - do we retry
      Returns:
      region locations for this row.
      Throws:
      IOException - if IO failure occurs
    • locateRegion

      RegionLocations locateRegion(TableName tableName, byte[] row, boolean useCache, boolean retry, int replicaId) throws IOException
      Gets the locations of the region in the specified table, tableName, for a given row.
      Parameters:
      tableName - table to get regions of
      row - the row
      useCache - Should we use the cache to retrieve the region information.
      retry - do we retry
      replicaId - the replicaId for the region
      Returns:
      region locations for this row.
      Throws:
      IOException - if IO failure occurs
    • getMaster

      Returns a MasterKeepAliveConnection to the active master
      Throws:
      IOException
    • getAdminForMaster

      org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdminForMaster() throws IOException
      Get the admin service for master.
      Throws:
      IOException
    • getAdmin

      org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService.BlockingInterface getAdmin(ServerName serverName) throws IOException
      Establishes a connection to the region server at the specified address.
      Parameters:
      serverName - the region server to connect to
      Returns:
      proxy for HRegionServer
      Throws:
      IOException - if a remote or network exception occurs
    • getClient

      org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService.BlockingInterface getClient(ServerName serverName) throws IOException
      Establishes a connection to the region server at the specified address, and returns a region client protocol.
      Parameters:
      serverName - the region server to connect to
      Returns:
      ClientProtocol proxy for RegionServer
      Throws:
      IOException - if a remote or network exception occurs
    • getRegionLocation

      HRegionLocation getRegionLocation(TableName tableName, byte[] row, boolean reload) throws IOException
      Find region location hosting passed row
      Parameters:
      tableName - table name
      row - Row to find.
      reload - If true do not use cache, otherwise bypass.
      Returns:
      Location of row.
      Throws:
      IOException - if a remote or network exception occurs
    • clearCaches

      Clear any caches that pertain to server name sn.
      Parameters:
      sn - A server name
    • getNonceGenerator

      Returns Nonce generator for this ClusterConnection; may be null if disabled in configuration.
    • getAsyncProcess

      Returns Default AsyncProcess associated with this connection.
    • getNewRpcRetryingCallerFactory

      RpcRetryingCallerFactory getNewRpcRetryingCallerFactory(org.apache.hadoop.conf.Configuration conf)
      Returns a new RpcRetryingCallerFactory from the given Configuration. This RpcRetryingCallerFactory lets the users create RpcRetryingCallers which can be intercepted with the configured RetryingCallerInterceptor
      Parameters:
      conf - configuration
    • getRpcRetryingCallerFactory

      Returns Connection's RpcRetryingCallerFactory instance
    • getRpcControllerFactory

      Returns Connection's RpcControllerFactory instance
    • getConnectionConfiguration

      Returns a ConnectionConfiguration object holding parsed configuration values
    • getStatisticsTracker

      Returns the current statistics tracker associated with this connection
    • getBackoffPolicy

      Returns the configured client backoff policy
    • getConnectionMetrics

      Returns the MetricsConnection instance associated with this connection.
    • hasCellBlockSupport

      Returns true when this connection uses a Codec and so supports cell blocks.
    • getLiveRegionServers

      List<ServerName> getLiveRegionServers(Supplier<ServerName> masterAddrTracker, int count) throws IOException
      Get live region servers from masters.
      Throws:
      IOException
    • getAllBootstrapNodes

      Get the bootstrap node list of another region server.
      Throws:
      IOException
    • getUser

      Get the User associated with this connection. May be null.
    • getConnectionRegistry

      Get the ConnectionRegistry used to orient this cluster.