org.apache.hadoop.hbase
Interface HConnection


public interface HConnection


Method Summary
 void close(org.apache.hadoop.io.Text tableName)
          Discard all the information about this table
 HRegionInterface getHRegionConnection(HServerAddress regionServer)
          Establishes a connection to the region server at the specified address.
 HMasterInterface getMaster()
           
 boolean isMasterRunning()
           
 HTableDescriptor[] listTables()
          List all the userspace tables.
 HRegionLocation locateRegion(org.apache.hadoop.io.Text tableName, org.apache.hadoop.io.Text row)
          Find the location of the region of tableName that row lives in.
 HRegionLocation relocateRegion(org.apache.hadoop.io.Text tableName, org.apache.hadoop.io.Text row)
          Find the location of the region of tableName that row lives in, ignoring any value that might be in the cache.
 boolean tableExists(org.apache.hadoop.io.Text tableName)
          Checks if tableName exists.
 

Method Detail

getMaster

HMasterInterface getMaster()
                           throws MasterNotRunningException
Returns:
proxy connection to master server for this instance
Throws:
MasterNotRunningException

isMasterRunning

boolean isMasterRunning()
Returns:
- true if the master server is running

tableExists

boolean tableExists(org.apache.hadoop.io.Text tableName)
Checks if tableName exists.

Parameters:
tableName - Table to check.
Returns:
True if table exists already.

listTables

HTableDescriptor[] listTables()
                              throws IOException
List all the userspace tables. In other words, scan the META table. If we wanted this to be really fast, we could implement a special catalog table that just contains table names and their descriptors. Right now, it only exists as part of the META table's region info.

Returns:
- returns an array of HTableDescriptors
Throws:
IOException

locateRegion

HRegionLocation locateRegion(org.apache.hadoop.io.Text tableName,
                             org.apache.hadoop.io.Text 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 reigon in question
Throws:
IOException

relocateRegion

HRegionLocation relocateRegion(org.apache.hadoop.io.Text tableName,
                               org.apache.hadoop.io.Text 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 reigon in question
Throws:
IOException

getHRegionConnection

HRegionInterface getHRegionConnection(HServerAddress regionServer)
                                      throws IOException
Establishes a connection to the region server at the specified address.

Parameters:
regionServer - - the server to connect to
Returns:
proxy for HRegionServer
Throws:
IOException

close

void close(org.apache.hadoop.io.Text tableName)
Discard all the information about this table

Parameters:
tableName - the name of the table to close


Copyright © 2008 The Apache Software Foundation