org.apache.hadoop.hbase
Interface HConnection


public interface HConnection


Method Summary
 void close(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()
           
 SortedMap<Text,HRegionLocation> getTableServers(Text tableName)
          Gets the servers of the given table.
 boolean isMasterRunning()
           
 HTableDescriptor[] listTables()
          List all the userspace tables.
 SortedMap<Text,HRegionLocation> reloadTableServers(Text tableName)
          Reloads servers for the specified table.
 boolean tableExists(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(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

getTableServers

SortedMap<Text,HRegionLocation> getTableServers(Text tableName)
                                                throws IOException
Gets the servers of the given table.

Parameters:
tableName - - the table to be located
Returns:
map of startRow -> RegionLocation
Throws:
IOException - - if the table can not be located after retrying

reloadTableServers

SortedMap<Text,HRegionLocation> reloadTableServers(Text tableName)
                                                   throws IOException
Reloads servers for the specified table.

Parameters:
tableName - name of table whose servers are to be reloaded
Returns:
map of start key -> RegionLocation
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(Text tableName)
Discard all the information about this table

Parameters:
tableName - the name of the table to close


Copyright © 2006 The Apache Software Foundation