org.apache.hadoop.hbase.rest
Class TableModel
java.lang.Object
org.apache.hadoop.hbase.rest.AbstractModel
org.apache.hadoop.hbase.rest.TableModel
public class TableModel
- extends AbstractModel
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TableModel
public TableModel(HBaseConfiguration config,
HBaseAdmin admin)
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 namecolumnNames
- 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 namehtd
- 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