org.apache.hadoop.hbase.client
Class HTable

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HTable

public class HTable
extends Object

Used to communicate with a single HBase table


Nested Class Summary
protected  class HTable.ClientScanner
          Implements the scanner interface for the HBase client.
 
Constructor Summary
HTable(byte[] tableName)
          Creates an object to access a HBase table
HTable(HBaseConfiguration conf, byte[] tableName)
          Creates an object to access a HBase table
HTable(HBaseConfiguration conf, String tableName)
          Creates an object to access a HBase table
HTable(HBaseConfiguration conf, org.apache.hadoop.io.Text tableName)
          Deprecated. Use String or byte [] overload instead
HTable(String tableName)
          Creates an object to access a HBase table
HTable(org.apache.hadoop.io.Text tableName)
          Deprecated. Use String or byte [] overload instead
 
Method Summary
 void commit(BatchUpdate batchUpdate)
          Commit a BatchUpdate to the table.
 void commit(List<BatchUpdate> batchUpdates)
          Commit a RowsBatchUpdate to the table.
 void deleteAll(byte[] row)
          Completely delete the row's cells.
 void deleteAll(byte[] row, byte[] column)
          Completely delete the row's cells.
 void deleteAll(byte[] row, byte[] column, long ts)
          Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.
 void deleteAll(byte[] row, long ts)
          Completely delete the row's cells.
 void deleteAll(String row)
          Completely delete the row's cells.
 void deleteAll(String row, long ts)
          Completely delete the row's cells.
 void deleteAll(String row, String column)
          Delete all cells that match the passed row and column.
 void deleteAll(String row, String column, long ts)
          Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.
 void deleteAll(org.apache.hadoop.io.Text row)
          Deprecated. Use String or byte [] overload instead
 void deleteAll(org.apache.hadoop.io.Text row, long ts)
          Deprecated. Use String or byte [] overload instead
 void deleteAll(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column)
          Deprecated. Use String or byte [] overload instead
 void deleteAll(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column, long ts)
          Deprecated. Use String or byte [] overload instead
 void deleteFamily(byte[] row, byte[] family)
          Delete all cells for a row with matching column family at all timestamps.
 void deleteFamily(byte[] row, byte[] family, long timestamp)
          Delete all cells for a row with matching column family with timestamps less than or equal to timestamp.
 void deleteFamily(String row, String family)
          Delete all cells for a row with matching column family at all timestamps.
 void deleteFamily(String row, String family, long timestamp)
          Delete all cells for a row with matching column family at all timestamps.
 void deleteFamily(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text family, long timestamp)
          Deprecated. Use String or byte [] overload instead
 Cell get(byte[] row, byte[] column)
          Get a single value for the specified row and column
 Cell[] get(byte[] row, byte[] column, int numVersions)
          Get the specified number of versions of the specified row and column
 Cell[] get(byte[] row, byte[] column, long timestamp, int numVersions)
          Get the specified number of versions of the specified row and column with the specified timestamp.
 Cell get(String row, String column)
          Get a single value for the specified row and column
 Cell[] get(String row, String column, int numVersions)
          Get a single value for the specified row and column
 Cell[] get(String row, String column, long timestamp, int numVersions)
          Get the specified number of versions of the specified row and column with the specified timestamp.
 Cell get(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column)
          Deprecated. Use String or byte [] overload instead
 Cell[] get(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column, int numVersions)
          Deprecated. Use String or byte [] overload instead
 Cell[] get(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text column, long timestamp, int numVersions)
          Deprecated. Use String or byte [] overload instead
 HConnection getConnection()
          Used by unit tests and tools to do low-level manipulations.
 HTableDescriptor getMetadata()
          Deprecated. 
 HRegionLocation getRegionLocation(byte[] row)
          Find region location hosting passed row using cached info
 HRegionLocation getRegionLocation(String row)
          Find region location hosting passed row using cached info
 HRegionLocation getRegionLocation(org.apache.hadoop.io.Text row)
          Deprecated. Use String or byte [] overload instead
 Map<HRegionInfo,HServerAddress> getRegionsInfo()
          Get all the regions and their address for this table
 RowResult getRow(byte[] row)
          Get all the data for the specified row at the latest timestamp
 RowResult getRow(byte[] row, byte[][] columns)
          Get selected columns for the specified row at the latest timestamp
 RowResult getRow(byte[] row, byte[][] columns, long ts)
          Get selected columns for the specified row at a specified timestamp
 RowResult getRow(byte[] row, long ts)
          Get all the data for the specified row at a specified timestamp
 RowResult getRow(String row)
          Get all the data for the specified row at the latest timestamp
 RowResult getRow(String row, long ts)
          Get all the data for the specified row at a specified timestamp
 RowResult getRow(String row, String[] columns)
          Get selected columns for the specified row at the latest timestamp
 RowResult getRow(String row, String[] columns, long ts)
          Get selected columns for the specified row at a specified timestamp
 RowResult getRow(org.apache.hadoop.io.Text row)
          Deprecated. Use String or byte [] overload instead
 RowResult getRow(org.apache.hadoop.io.Text row, long ts)
          Deprecated. Use String or byte [] overload instead
 RowResult getRow(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text[] columns)
          Deprecated. Use String or byte [] overload instead
 RowResult getRow(org.apache.hadoop.io.Text row, org.apache.hadoop.io.Text[] columns, long ts)
          Deprecated. Use String or byte [] overload instead
 Scanner getScanner(byte[][] columns)
          Get a scanner on the current table starting at first row.
 Scanner getScanner(byte[][] columns, byte[] startRow)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(byte[][] columns, byte[] startRow, byte[] stopRow)
          Get a scanner on the current table starting at the specified row and ending just before stopRow.
 Scanner getScanner(byte[][] columns, byte[] startRow, byte[] stopRow, long timestamp)
          Get a scanner on the current table starting at the specified row and ending just before stopRow.
 Scanner getScanner(byte[][] columns, byte[] startRow, long timestamp)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(byte[][] columns, byte[] startRow, RowFilterInterface filter)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(String[] columns)
          Get a scanner on the current table starting at first row.
 Scanner getScanner(String[] columns, String startRow)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(String[] columns, String startRow, long timestamp, RowFilterInterface filter)
          Get a scanner on the current table starting at the specified row.
 Scanner getScanner(String[] columns, String startRow, String stopRow, long timestamp)
          Get a scanner on the current table starting at the specified row and ending just before stopRow.
 Scanner getScanner(org.apache.hadoop.io.Text[] columns)
          Deprecated. Use String or byte [] overload instead
 Scanner getScanner(org.apache.hadoop.io.Text[] columns, org.apache.hadoop.io.Text startRow)
          Deprecated. Use String or byte [] overload instead
 Scanner getScanner(org.apache.hadoop.io.Text[] columns, org.apache.hadoop.io.Text startRow, long timestamp, RowFilterInterface filter)
          Deprecated. Use String or byte [] overload instead
 Scanner getScanner(org.apache.hadoop.io.Text[] columns, org.apache.hadoop.io.Text startRow, org.apache.hadoop.io.Text stopRow, long timestamp)
          Deprecated. Use String or byte [] overload instead
 byte[][] getStartKeys()
          Gets the starting row key for every region in the currently open table
 HTableDescriptor getTableDescriptor()
           
 byte[] getTableName()
           
static boolean isTableEnabled(byte[] tableName)
           
static boolean isTableEnabled(HBaseConfiguration conf, byte[] tableName)
           
static boolean isTableEnabled(HBaseConfiguration conf, String tableName)
           
static boolean isTableEnabled(HBaseConfiguration conf, org.apache.hadoop.io.Text tableName)
          Deprecated. Use String or byte [] overload instead
static boolean isTableEnabled(String tableName)
           
static boolean isTableEnabled(org.apache.hadoop.io.Text tableName)
          Deprecated. Use String or byte [] overload instead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTable

@Deprecated
public HTable(org.apache.hadoop.io.Text tableName)
       throws IOException
Deprecated. Use String or byte [] overload instead

Creates an object to access a HBase table

Parameters:
tableName - name of the table
Throws:
IOException

HTable

public HTable(String tableName)
       throws IOException
Creates an object to access a HBase table

Parameters:
tableName - name of the table
Throws:
IOException

HTable

public HTable(byte[] tableName)
       throws IOException
Creates an object to access a HBase table

Parameters:
tableName - name of the table
Throws:
IOException

HTable

@Deprecated
public HTable(HBaseConfiguration conf,
                         org.apache.hadoop.io.Text tableName)
       throws IOException
Deprecated. Use String or byte [] overload instead

Creates an object to access a HBase table

Parameters:
conf - configuration object
tableName - name of the table
Throws:
IOException

HTable

public HTable(HBaseConfiguration conf,
              String tableName)
       throws IOException
Creates an object to access a HBase table

Parameters:
conf - configuration object
tableName - name of the table
Throws:
IOException

HTable

public HTable(HBaseConfiguration conf,
              byte[] tableName)
       throws IOException
Creates an object to access a HBase table

Parameters:
conf - configuration object
tableName - name of the table
Throws:
IOException
Method Detail

isTableEnabled

@Deprecated
public static boolean isTableEnabled(org.apache.hadoop.io.Text tableName)
                              throws IOException
Deprecated. Use String or byte [] overload instead

Parameters:
tableName - name of table to check
Returns:
true if table is on-line
Throws:
IOException

isTableEnabled

public static boolean isTableEnabled(String tableName)
                              throws IOException
Parameters:
tableName - name of table to check
Returns:
true if table is on-line
Throws:
IOException

isTableEnabled

public static boolean isTableEnabled(byte[] tableName)
                              throws IOException
Parameters:
tableName - name of table to check
Returns:
true if table is on-line
Throws:
IOException

isTableEnabled

@Deprecated
public static boolean isTableEnabled(HBaseConfiguration conf,
                                                org.apache.hadoop.io.Text tableName)
                              throws IOException
Deprecated. Use String or byte [] overload instead

Parameters:
conf - HBaseConfiguration object
tableName - name of table to check
Returns:
true if table is on-line
Throws:
IOException

isTableEnabled

public static boolean isTableEnabled(HBaseConfiguration conf,
                                     String tableName)
                              throws IOException
Parameters:
conf - HBaseConfiguration object
tableName - name of table to check
Returns:
true if table is on-line
Throws:
IOException

isTableEnabled

public static boolean isTableEnabled(HBaseConfiguration conf,
                                     byte[] tableName)
                              throws IOException
Parameters:
conf - HBaseConfiguration object
tableName - name of table to check
Returns:
true if table is on-line
Throws:
IOException

getRegionLocation

@Deprecated
public HRegionLocation getRegionLocation(org.apache.hadoop.io.Text row)
                                  throws IOException
Deprecated. Use String or byte [] overload instead

Find region location hosting passed row using cached info

Parameters:
row - Row to find.
Returns:
Location of row.
Throws:
IOException

getRegionLocation

public HRegionLocation getRegionLocation(String row)
                                  throws IOException
Find region location hosting passed row using cached info

Parameters:
row - Row to find.
Returns:
Location of row.
Throws:
IOException

getRegionLocation

public HRegionLocation getRegionLocation(byte[] row)
                                  throws IOException
Find region location hosting passed row using cached info

Parameters:
row - Row to find.
Returns:
Location of row.
Throws:
IOException

getTableName

public byte[] getTableName()
Returns:
the table name

getConnection

public HConnection getConnection()
Used by unit tests and tools to do low-level manipulations. Not for general use.

Returns:
An HConnection instance.

getMetadata

@Deprecated
public HTableDescriptor getMetadata()
                             throws IOException
Deprecated. 

Returns:
table metadata
Throws:
IOException

getTableDescriptor

public HTableDescriptor getTableDescriptor()
                                    throws IOException
Returns:
table metadata
Throws:
IOException

getStartKeys

public byte[][] getStartKeys()
                      throws IOException
Gets the starting row key for every region in the currently open table

Returns:
Array of region starting row keys
Throws:
IOException

getRegionsInfo

public Map<HRegionInfo,HServerAddress> getRegionsInfo()
                                               throws IOException
Get all the regions and their address for this table

Returns:
A map of HRegionInfo with it's server address
Throws:
IOException

get

@Deprecated
public Cell get(org.apache.hadoop.io.Text row,
                           org.apache.hadoop.io.Text column)
         throws IOException
Deprecated. Use String or byte [] overload instead

Get a single value for the specified row and column

Parameters:
row - row key
column - column name
Returns:
value for specified row/column
Throws:
IOException

get

@Deprecated
public Cell[] get(org.apache.hadoop.io.Text row,
                             org.apache.hadoop.io.Text column,
                             int numVersions)
           throws IOException
Deprecated. Use String or byte [] overload instead

Get a single value for the specified row and column

Parameters:
row - row key
column - column name
numVersions - - number of versions to retrieve
Returns:
value for specified row/column
Throws:
IOException

get

public Cell get(String row,
                String column)
         throws IOException
Get a single value for the specified row and column

Parameters:
row - row key
column - column name
Returns:
value for specified row/column
Throws:
IOException

get

public Cell[] get(String row,
                  String column,
                  int numVersions)
           throws IOException
Get a single value for the specified row and column

Parameters:
row - row key
column - column name
numVersions - - number of versions to retrieve
Returns:
value for specified row/column
Throws:
IOException

get

public Cell get(byte[] row,
                byte[] column)
         throws IOException
Get a single value for the specified row and column

Parameters:
row - row key
column - column name
Returns:
value for specified row/column
Throws:
IOException

get

public Cell[] get(byte[] row,
                  byte[] column,
                  int numVersions)
           throws IOException
Get the specified number of versions of the specified row and column

Parameters:
row - row key
column - column name
numVersions - number of versions to retrieve
Returns:
Array of Cells.
Throws:
IOException

get

@Deprecated
public Cell[] get(org.apache.hadoop.io.Text row,
                             org.apache.hadoop.io.Text column,
                             long timestamp,
                             int numVersions)
           throws IOException
Deprecated. Use String or byte [] overload instead

Get the specified number of versions of the specified row and column with the specified timestamp.

Parameters:
row - - row key
column - - column name
timestamp - - timestamp
numVersions - - number of versions to retrieve
Returns:
- array of values that match the above criteria
Throws:
IOException

get

public Cell[] get(String row,
                  String column,
                  long timestamp,
                  int numVersions)
           throws IOException
Get the specified number of versions of the specified row and column with the specified timestamp.

Parameters:
row - - row key
column - - column name
timestamp - - timestamp
numVersions - - number of versions to retrieve
Returns:
- array of values that match the above criteria
Throws:
IOException

get

public Cell[] get(byte[] row,
                  byte[] column,
                  long timestamp,
                  int numVersions)
           throws IOException
Get the specified number of versions of the specified row and column with the specified timestamp.

Parameters:
row - - row key
column - - column name
timestamp - - timestamp
numVersions - - number of versions to retrieve
Returns:
- array of values that match the above criteria
Throws:
IOException

getRow

@Deprecated
public RowResult getRow(org.apache.hadoop.io.Text row)
                 throws IOException
Deprecated. Use String or byte [] overload instead

Get all the data for the specified row at the latest timestamp

Parameters:
row - row key
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row)
                 throws IOException
Get all the data for the specified row at the latest timestamp

Parameters:
row - row key
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row)
                 throws IOException
Get all the data for the specified row at the latest timestamp

Parameters:
row - row key
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

@Deprecated
public RowResult getRow(org.apache.hadoop.io.Text row,
                                   long ts)
                 throws IOException
Deprecated. Use String or byte [] overload instead

Get all the data for the specified row at a specified timestamp

Parameters:
row - row key
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        long ts)
                 throws IOException
Get all the data for the specified row at a specified timestamp

Parameters:
row - row key
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        long ts)
                 throws IOException
Get all the data for the specified row at a specified timestamp

Parameters:
row - row key
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

@Deprecated
public RowResult getRow(org.apache.hadoop.io.Text row,
                                   org.apache.hadoop.io.Text[] columns)
                 throws IOException
Deprecated. Use String or byte [] overload instead

Get selected columns for the specified row at the latest timestamp

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        String[] columns)
                 throws IOException
Get selected columns for the specified row at the latest timestamp

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        byte[][] columns)
                 throws IOException
Get selected columns for the specified row at the latest timestamp

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

@Deprecated
public RowResult getRow(org.apache.hadoop.io.Text row,
                                   org.apache.hadoop.io.Text[] columns,
                                   long ts)
                 throws IOException
Deprecated. Use String or byte [] overload instead

Get selected columns for the specified row at a specified timestamp

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        String[] columns,
                        long ts)
                 throws IOException
Get selected columns for the specified row at a specified timestamp

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        byte[][] columns,
                        long ts)
                 throws IOException
Get selected columns for the specified row at a specified timestamp

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
ts - timestamp
Returns:
RowResult is empty if row does not exist.
Throws:
IOException

getScanner

@Deprecated
public Scanner getScanner(org.apache.hadoop.io.Text[] columns)
                   throws IOException
Deprecated. Use String or byte [] overload instead

Get a scanner on the current table starting at first row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(String[] columns)
                   throws IOException
Get a scanner on the current table starting at first row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
Returns:
scanner
Throws:
IOException

getScanner

@Deprecated
public Scanner getScanner(org.apache.hadoop.io.Text[] columns,
                                     org.apache.hadoop.io.Text startRow)
                   throws IOException
Deprecated. Use String or byte [] overload instead

Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(String[] columns,
                          String startRow)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns)
                   throws IOException
Get a scanner on the current table starting at first row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns,
                          byte[] startRow)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns,
                          byte[] startRow,
                          long timestamp)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
timestamp - only return results whose timestamp <= this value
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns,
                          byte[] startRow,
                          RowFilterInterface filter)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
filter - a row filter using row-key regexp and/or column data filter.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns,
                          byte[] startRow,
                          byte[] stopRow)
                   throws IOException
Get a scanner on the current table starting at the specified row and ending just before stopRow. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
stopRow - Row to stop scanning on. Once we hit this row we stop returning values; i.e. we return the row before this one but not the stopRow itself.
Returns:
scanner
Throws:
IOException

getScanner

@Deprecated
public Scanner getScanner(org.apache.hadoop.io.Text[] columns,
                                     org.apache.hadoop.io.Text startRow,
                                     org.apache.hadoop.io.Text stopRow,
                                     long timestamp)
                   throws IOException
Deprecated. Use String or byte [] overload instead

Get a scanner on the current table starting at the specified row and ending just before stopRow. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
stopRow - Row to stop scanning on. Once we hit this row we stop returning values; i.e. we return the row before this one but not the stopRow itself.
timestamp - only return results whose timestamp <= this value
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(String[] columns,
                          String startRow,
                          String stopRow,
                          long timestamp)
                   throws IOException
Get a scanner on the current table starting at the specified row and ending just before stopRow. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
stopRow - Row to stop scanning on. Once we hit this row we stop returning values; i.e. we return the row before this one but not the stopRow itself.
timestamp - only return results whose timestamp <= this value
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns,
                          byte[] startRow,
                          byte[] stopRow,
                          long timestamp)
                   throws IOException
Get a scanner on the current table starting at the specified row and ending just before stopRow. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
stopRow - Row to stop scanning on. Once we hit this row we stop returning values; i.e. we return the row before this one but not the stopRow itself.
timestamp - only return results whose timestamp <= this value
Returns:
scanner
Throws:
IOException

getScanner

@Deprecated
public Scanner getScanner(org.apache.hadoop.io.Text[] columns,
                                     org.apache.hadoop.io.Text startRow,
                                     long timestamp,
                                     RowFilterInterface filter)
                   throws IOException
Deprecated. Use String or byte [] overload instead

Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
timestamp - only return results whose timestamp <= this value
filter - a row filter using row-key regexp and/or column data filter.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(String[] columns,
                          String startRow,
                          long timestamp,
                          RowFilterInterface filter)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
timestamp - only return results whose timestamp <= this value
filter - a row filter using row-key regexp and/or column data filter.
Returns:
scanner
Throws:
IOException

getScanner

public Scanner getScanner(byte[][] columns,
                          byte[] startRow,
                          long timestamp,
                          RowFilterInterface filter)
                   throws IOException
Get a scanner on the current table starting at the specified row. Return the specified columns.

Parameters:
columns - columns to scan. If column name is a column family, all columns of the specified column family are returned. Its also possible to pass a regex in the column qualifier. A column qualifier is judged to be a regex if it contains at least one of the following characters: \+|^&*$[]]}{)(.
startRow - starting row in table to scan
timestamp - only return results whose timestamp <= this value
filter - a row filter using row-key regexp and/or column data filter.
Returns:
scanner
Throws:
IOException

deleteAll

public void deleteAll(byte[] row)
               throws IOException
Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
Throws:
IOException

deleteAll

@Deprecated
public void deleteAll(org.apache.hadoop.io.Text row)
               throws IOException
Deprecated. Use String or byte [] overload instead

Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
Throws:
IOException

deleteAll

public void deleteAll(String row)
               throws IOException
Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
Throws:
IOException

deleteAll

public void deleteAll(byte[] row,
                      byte[] column)
               throws IOException
Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
column - column to be deleted
Throws:
IOException

deleteAll

public void deleteAll(byte[] row,
                      long ts)
               throws IOException
Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAll

public void deleteAll(String row,
                      long ts)
               throws IOException
Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAll

@Deprecated
public void deleteAll(org.apache.hadoop.io.Text row,
                                 long ts)
               throws IOException
Deprecated. Use String or byte [] overload instead

Completely delete the row's cells.

Parameters:
row - Key of the row you want to completely delete.
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAll

@Deprecated
public void deleteAll(org.apache.hadoop.io.Text row,
                                 org.apache.hadoop.io.Text column)
               throws IOException
Deprecated. Use String or byte [] overload instead

Delete all cells that match the passed row and column.

Parameters:
row - Row to update
column - name of column whose value is to be deleted
Throws:
IOException

deleteAll

public void deleteAll(String row,
                      String column)
               throws IOException
Delete all cells that match the passed row and column.

Parameters:
row - Row to update
column - name of column whose value is to be deleted
Throws:
IOException

deleteAll

@Deprecated
public void deleteAll(org.apache.hadoop.io.Text row,
                                 org.apache.hadoop.io.Text column,
                                 long ts)
               throws IOException
Deprecated. Use String or byte [] overload instead

Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.

Parameters:
row - Row to update
column - name of column whose value is to be deleted
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAll

public void deleteAll(String row,
                      String column,
                      long ts)
               throws IOException
Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.

Parameters:
row - Row to update
column - name of column whose value is to be deleted
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAll

public void deleteAll(byte[] row,
                      byte[] column,
                      long ts)
               throws IOException
Delete all cells that match the passed row and column and whose timestamp is equal-to or older than the passed timestamp.

Parameters:
row - Row to update
column - name of column whose value is to be deleted
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteFamily

@Deprecated
public void deleteFamily(org.apache.hadoop.io.Text row,
                                    org.apache.hadoop.io.Text family,
                                    long timestamp)
                  throws IOException
Deprecated. Use String or byte [] overload instead

Delete all cells for a row with matching column family at all timestamps.

Parameters:
row - The row to operate on
family - The column family to match
timestamp - Timestamp to match
Throws:
IOException

deleteFamily

public void deleteFamily(String row,
                         String family)
                  throws IOException
Delete all cells for a row with matching column family at all timestamps.

Parameters:
row - The row to operate on
family - The column family to match
Throws:
IOException

deleteFamily

public void deleteFamily(byte[] row,
                         byte[] family)
                  throws IOException
Delete all cells for a row with matching column family at all timestamps.

Parameters:
row - The row to operate on
family - The column family to match
Throws:
IOException

deleteFamily

public void deleteFamily(String row,
                         String family,
                         long timestamp)
                  throws IOException
Delete all cells for a row with matching column family at all timestamps.

Parameters:
row - The row to operate on
family - The column family to match
timestamp - Timestamp to match
Throws:
IOException

deleteFamily

public void deleteFamily(byte[] row,
                         byte[] family,
                         long timestamp)
                  throws IOException
Delete all cells for a row with matching column family with timestamps less than or equal to timestamp.

Parameters:
row - The row to operate on
family - The column family to match
timestamp - Timestamp to match
Throws:
IOException

commit

public void commit(BatchUpdate batchUpdate)
            throws IOException
Commit a BatchUpdate to the table.

Parameters:
batchUpdate -
Throws:
IOException

commit

public void commit(List<BatchUpdate> batchUpdates)
            throws IOException
Commit a RowsBatchUpdate to the table.

Parameters:
batchUpdates -
Throws:
IOException


Copyright © 2008 The Apache Software Foundation