org.apache.hadoop.hbase.rest
Class TableModel

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.AbstractModel
      extended by org.apache.hadoop.hbase.rest.TableModel

public class TableModel
extends AbstractModel


Nested Class Summary
static class TableModel.Regions
           
 
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.rest.AbstractModel
AbstractModel.Encodings
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hbase.rest.AbstractModel
admin, COLON, conf, encoding
 
Constructor Summary
TableModel(HBaseConfiguration config, HBaseAdmin admin)
           
 
Method Summary
 boolean delete(byte[] tableName)
          Deletes table tableName
protected  void disableTable(byte[] tableName)
           
protected  boolean doesTableExist(byte[] tableName)
           
protected  void enableTable(byte[] tableName)
           
 Result[] get(byte[] tableName)
           
 Result[] get(byte[] tableName, byte[][] columnNames)
          Returns all cells from all rows from the given table in the given columns.
 HTableDescriptor getTableMetadata(String tableName)
          Get table metadata.
 TableModel.Regions getTableRegions(String tableName)
          Return region offsets.
 boolean post(byte[] tableName, HTableDescriptor htd)
          Creates table tableName described by the json in input.
 boolean updateTable(String tableName, ArrayList<HColumnDescriptor> columns)
           
 
Methods inherited from class org.apache.hadoop.hbase.rest.AbstractModel
getColumns, initialize, isColumnFamily
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableModel

public TableModel(HBaseConfiguration config,
                  HBaseAdmin admin)
Method Detail

get

public Result[] get(byte[] tableName)
             throws HBaseRestException
Throws:
HBaseRestException

get

public Result[] get(byte[] tableName,
                    byte[][] columnNames)
             throws HBaseRestException
Returns all cells from all rows from the given table in the given columns. The output is in the order that the columns are given.

Parameters:
tableName - table name
columnNames - column names
Returns:
resultant rows
Throws:
HBaseRestException

doesTableExist

protected boolean doesTableExist(byte[] tableName)
                          throws HBaseRestException
Throws:
HBaseRestException

disableTable

protected void disableTable(byte[] tableName)
                     throws HBaseRestException
Throws:
HBaseRestException

enableTable

protected void enableTable(byte[] tableName)
                    throws HBaseRestException
Throws:
HBaseRestException

updateTable

public boolean updateTable(String tableName,
                           ArrayList<HColumnDescriptor> columns)
                    throws HBaseRestException
Throws:
HBaseRestException

getTableMetadata

public HTableDescriptor getTableMetadata(String tableName)
                                  throws HBaseRestException
Get table metadata.

Parameters:
tableName -
Returns:
HTableDescriptor
Throws:
HBaseRestException

getTableRegions

public TableModel.Regions getTableRegions(String tableName)
                                   throws HBaseRestException
Return region offsets.

Parameters:
tableName -
Returns:
Regions
Throws:
HBaseRestException

post

public boolean post(byte[] tableName,
                    HTableDescriptor htd)
             throws HBaseRestException
Creates table tableName described by the json in input.

Parameters:
tableName - table name
htd - HBaseTableDescriptor for the table to be created
Returns:
true if operation does not fail due to a table with the given tableName not existing.
Throws:
HBaseRestException

delete

public boolean delete(byte[] tableName)
               throws HBaseRestException
Deletes table tableName

Parameters:
tableName - name of the table.
Returns:
true if table exists and deleted, false if table does not exist.
Throws:
HBaseRestException


Copyright © 2010 The Apache Software Foundation