org.apache.hadoop.hbase.client
Class CoprocessorHConnection

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HConnectionManager.HConnectionImplementation
      extended by org.apache.hadoop.hbase.client.CoprocessorHConnection
All Implemented Interfaces:
Closeable, Abortable, HConnection

@InterfaceAudience.Private
@InterfaceStability.Evolving
public class CoprocessorHConnection
extends HConnectionManager.HConnectionImplementation

Connection to an HTable from within a Coprocessor. We can do some nice tricks since we know we are on a regionserver, for instance skipping the full serialization/deserialization of objects when talking to the server.

You should not use this class from any client - its an internal class meant for use by the coprocessor framework.


Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.client.HConnectionManager.HConnectionImplementation
clusterId, user
 
Fields inherited from interface org.apache.hadoop.hbase.client.HConnection
HBASE_CLIENT_CONNECTION_IMPL
 
Constructor Summary
CoprocessorHConnection(org.apache.hadoop.conf.Configuration conf, HRegionServer server)
          Constructor that accepts custom configuration
CoprocessorHConnection(HConnection delegate, HRegionServer server)
          Deprecated. delegate is not used
CoprocessorHConnection(HRegionServer server)
          Constructor that uses server configuration
 
Method Summary
 ClientProtos.ClientService.BlockingInterface getClient(ServerName serverName)
          Establishes a connection to the region server at the specified address, and returns a region client protocol.
static HConnection getConnectionForEnvironment(CoprocessorEnvironment env)
          Create an unmanaged HConnection based on the environment in which we are running the coprocessor.
 
Methods inherited from class org.apache.hadoop.hbase.client.HConnectionManager.HConnectionImplementation
abort, clearCaches, clearRegionCache, clearRegionCache, clearRegionCache, close, createAsyncProcess, deleteCachedRegionLocation, finalize, getAdmin, getAdmin, getBackoffPolicy, getConfiguration, getConnectionMetrics, getCurrentBatchPool, getCurrentNrHRS, getHTableDescriptor, getHTableDescriptor, getHTableDescriptors, getHTableDescriptorsByTableName, getKeepAliveMasterService, getMaster, getNonceGenerator, getRegionCachePrefetch, getRegionCachePrefetch, getRegionLocation, getRegionLocation, getStatisticsTracker, getTable, getTable, getTable, getTable, getTable, getTable, getTableNames, isAborted, isClosed, isDeadServer, isMasterRunning, isTableAvailable, isTableAvailable, isTableAvailable, isTableAvailable, isTableDisabled, isTableDisabled, isTableEnabled, isTableEnabled, listTableNames, listTables, locateRegion, locateRegion, locateRegion, locateRegions, locateRegions, locateRegions, locateRegions, processBatch, processBatch, processBatchCallback, processBatchCallback, relocateRegion, relocateRegion, setRegionCachePrefetch, setRegionCachePrefetch, toString, updateCachedLocations, updateCachedLocations
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoprocessorHConnection

@Deprecated
public CoprocessorHConnection(HConnection delegate,
                                         HRegionServer server)
                       throws IOException
Deprecated. delegate is not used

Legacy constructor

Parameters:
delegate -
server -
Throws:
IOException - if we cannot create the connection

CoprocessorHConnection

public CoprocessorHConnection(HRegionServer server)
                       throws IOException
Constructor that uses server configuration

Parameters:
server -
Throws:
IOException - if we cannot create the connection

CoprocessorHConnection

public CoprocessorHConnection(org.apache.hadoop.conf.Configuration conf,
                              HRegionServer server)
                       throws IOException
Constructor that accepts custom configuration

Parameters:
conf -
server -
Throws:
IOException - if we cannot create the connection
Method Detail

getConnectionForEnvironment

public static HConnection getConnectionForEnvironment(CoprocessorEnvironment env)
                                               throws IOException
Create an unmanaged HConnection based on the environment in which we are running the coprocessor. The HConnection must be externally cleaned up (we bypass the usual HTable cleanup mechanisms since we own everything).

Parameters:
env - environment hosting the HConnection
Returns:
an unmanaged HConnection.
Throws:
IOException - if we cannot create the connection

getClient

public ClientProtos.ClientService.BlockingInterface getClient(ServerName serverName)
                                                       throws IOException
Description copied from interface: HConnection
Establishes a connection to the region server at the specified address, and returns a region client protocol.

Specified by:
getClient in interface HConnection
Overrides:
getClient in class HConnectionManager.HConnectionImplementation
Returns:
ClientProtocol proxy for RegionServer
Throws:
IOException - if a remote or network exception occurs


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.