org.apache.hadoop.hbase.client
Class HTable

java.lang.Object
  extended by org.apache.hadoop.hbase.client.HTable
Direct Known Subclasses:
TransactionalTable

public class HTable
extends Object

Used to communicate with a single HBase table

This class is not MT safe for writing.


Nested Class Summary
protected  class HTable.ClientScanner
          Implements the scanner interface for the HBase client.
protected  class HTable.OldClientScanner
          Scanner implementation made on top of a ResultScanner.
 
Field Summary
protected  int scannerCaching
           
protected  int scannerTimeout
           
 
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(String tableName)
          Creates an object to access a HBase table
 
Method Summary
 boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put)
          Atomically checks if a row/family/qualifier value match the expectedValue.
 boolean checkAndSave(BatchUpdate batchUpdate, HbaseMapWritable<byte[],byte[]> expectedValues, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by checkAndPut(byte[], byte[], byte[], byte[], org.apache.hadoop.hbase.client.Put)
 void close()
          Release held resources
 void commit(BatchUpdate batchUpdate)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete) or put(Put)
 void commit(BatchUpdate batchUpdate, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete) or put(Put)
 void commit(List<BatchUpdate> batchUpdates)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete) or put(List)
 void delete(Delete delete)
           
 void deleteAll(byte[] row)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(byte[] row, byte[] column)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(byte[] row, byte[] column, long ts)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(byte[] row, byte[] column, long ts, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(byte[] row, long ts)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(String row)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(String row, long ts)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(String row, String column)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAll(String row, String column, long ts)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAllByRegex(byte[] row, String colRegex, long ts)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAllByRegex(byte[] row, String colRegex, long ts, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAllByRegex(String row, String colRegex)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteAllByRegex(String row, String colRegex, long ts)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamily(byte[] row, byte[] family)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamily(byte[] row, byte[] family, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamily(byte[] row, byte[] family, long timestamp, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamily(String row, String family)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamily(String row, String family, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamilyByRegex(byte[] row, String familyRegex)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamilyByRegex(byte[] row, String familyRegex, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamilyByRegex(byte[] row, String familyRegex, long timestamp, RowLock r1)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamilyByRegex(String row, String familyRegex)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 void deleteFamilyByRegex(String row, String familyRegex, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by delete(Delete)
 boolean exists(byte[] row)
          Deprecated. As of hbase 0.20.0, replaced by exists(Get)
 boolean exists(byte[] row, byte[] column)
          Deprecated. As of hbase 0.20.0, replaced by exists(Get)
 boolean exists(byte[] row, byte[] column, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by exists(Get)
 boolean exists(byte[] row, byte[] column, long timestamp, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by exists(Get)
 boolean exists(Get get)
          Test for the existence of columns in the table, as specified in the Get.
 void flushCommits()
          Commit to the table the buffer of BatchUpdate.
 Cell get(byte[] row, byte[] column)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 Cell[] get(byte[] row, byte[] column, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 Cell[] get(byte[] row, byte[] column, long timestamp, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 Result get(Get get)
          Method for getting data from a row
 Cell get(String row, String column)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 Cell[] get(String row, String column, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 Cell[] get(String row, String column, long timestamp, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getClosestRowBefore(byte[] row, byte[] family)
          Deprecated. As of hbase 0.20.0, replaced by getRowOrBefore(byte[], byte[])
 HConnection getConnection()
          Used by unit tests and tools to do low-level manipulations.
 byte[][] getEndKeys()
          Gets the ending row key for every region in the currently open table
 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
 Map<HRegionInfo,HServerAddress> getRegionsInfo()
          Get all the regions and their address for this table
 RowResult getRow(byte[] row)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, byte[][] columns)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, byte[][] columns, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, byte[][] columns, long ts)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, byte[][] columns, long ts, int numVersions, RowLock rl)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, long ts)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(byte[] row, long timestamp, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, long ts)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, long ts, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, String[] columns)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, String[] columns, int numVersions)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, String[] columns, long ts)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 RowResult getRow(String row, String[] columns, long timestamp, int numVersions, RowLock rowLock)
          Deprecated. As of hbase 0.20.0, replaced by get(Get)
 Result getRowOrBefore(byte[] row, byte[] family)
          Return the row that matches row exactly, or the one that immediately preceeds it.
 ResultScanner getScanner(byte[] family)
          Get a scanner on the current table as specified by the Scan object
 Scanner getScanner(byte[][] columns)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(byte[][] columns, byte[] startRow)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(byte[][] columns, byte[] startRow, byte[] stopRow)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(byte[][] columns, byte[] startRow, byte[] stopRow, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(byte[][] columns, byte[] startRow, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(byte[][] columns, byte[] startRow, RowFilterInterface filter)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 ResultScanner getScanner(byte[] family, byte[] qualifier)
          Get a scanner on the current table as specified by the Scan object
 ResultScanner getScanner(Scan scan)
          Get a scanner on the current table as specified by the Scan object
 Scanner getScanner(String[] columns)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(String[] columns, String startRow)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(String[] columns, String startRow, long timestamp, RowFilterInterface filter)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 Scanner getScanner(String[] columns, String startRow, String stopRow, long timestamp)
          Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)
 int getScannerCaching()
          Get the number of rows for caching that will be passed to scanners
 Pair<byte[][],byte[][]> getStartEndKeys()
          Gets the starting and ending row keys for every region in the currently open table
 byte[][] getStartKeys()
          Gets the starting row key for every region in the currently open table
 HTableDescriptor getTableDescriptor()
           
 byte[] getTableName()
           
 long getWriteBufferSize()
          Get the maximum size in bytes of the write buffer for this HTable
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount)
          Atomically increments a column value.
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
          Atomically increments a column value.
 boolean isAutoFlush()
          Get the value of autoFlush.
static boolean isTableEnabled(byte[] tableName)
           
static boolean isTableEnabled(HBaseConfiguration conf, byte[] tableName)
           
static boolean isTableEnabled(HBaseConfiguration conf, String tableName)
           
static boolean isTableEnabled(String tableName)
           
 RowLock lockRow(byte[] row)
          Obtain a row lock
 void put(List<Put> puts)
          Commit a List of Puts to the table.
 void put(Put put)
          Commit a Put to the table.
 void setAutoFlush(boolean autoFlush)
          Set if this instanciation of HTable will autoFlush
 void setScannerCaching(int scannerCaching)
          Set the number of rows for caching that will be passed to scanners
 void setWriteBufferSize(long writeBufferSize)
          Set the size of the buffer in bytes.
 void unlockRow(RowLock rl)
          Release a row lock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scannerTimeout

protected final int scannerTimeout

scannerCaching

protected int scannerCaching
Constructor Detail

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

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

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

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

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.

getScannerCaching

public int getScannerCaching()
Get the number of rows for caching that will be passed to scanners

Returns:
the number of rows for caching

setScannerCaching

public void setScannerCaching(int scannerCaching)
Set the number of rows for caching that will be passed to scanners

Parameters:
scannerCaching - the number of rows for caching

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

getEndKeys

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

Returns:
Array of region ending row keys
Throws:
IOException

getStartEndKeys

public Pair<byte[][],byte[][]> getStartEndKeys()
                                        throws IOException
Gets the starting and ending row keys for every region in the currently open table

Returns:
Pair of arrays of region starting and ending 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

getRowOrBefore

public Result getRowOrBefore(byte[] row,
                             byte[] family)
                      throws IOException
Return the row that matches row exactly, or the one that immediately preceeds it.

Parameters:
row - row key
family - Column family to look for row in.
Returns:
map of values
Throws:
IOException
Since:
0.20.0

getClosestRowBefore

public RowResult getClosestRowBefore(byte[] row,
                                     byte[] family)
                              throws IOException
Deprecated. As of hbase 0.20.0, replaced by getRowOrBefore(byte[], byte[])

Return the row that matches row exactly, or the one that immediately preceeds it.

Parameters:
row - row key
family - Column family to look for row in.
Returns:
map of values
Throws:
IOException

getScanner

public ResultScanner getScanner(Scan scan)
                         throws IOException
Get a scanner on the current table as specified by the Scan object

Parameters:
scan - a configured Scan object
Returns:
scanner
Throws:
IOException
Since:
0.20.0

getScanner

public ResultScanner getScanner(byte[] family)
                         throws IOException
Get a scanner on the current table as specified by the Scan object

Parameters:
family - The column family to scan.
Returns:
The scanner.
Throws:
IOException
Since:
0.20.0

getScanner

public ResultScanner getScanner(byte[] family,
                                byte[] qualifier)
                         throws IOException
Get a scanner on the current table as specified by the Scan object

Parameters:
family - The column family to scan.
qualifier - The column qualifier to scan.
Returns:
The scanner.
Throws:
IOException
Since:
0.20.0

get

public Result get(Get get)
           throws IOException
Method for getting data from a row

Parameters:
get - the Get to fetch
Returns:
the result
Throws:
IOException
Since:
0.20.0

delete

public void delete(Delete delete)
            throws IOException
Parameters:
delete -
Throws:
IOException
Since:
0.20.0

put

public void put(Put put)
         throws IOException
Commit a Put to the table.

If autoFlush is false, the update is buffered.

Parameters:
put -
Throws:
IOException
Since:
0.20.0

put

public void put(List<Put> puts)
         throws IOException
Commit a List of Puts to the table.

If autoFlush is false, the update is buffered.

Parameters:
puts -
Throws:
IOException
Since:
0.20.0

incrementColumnValue

public long incrementColumnValue(byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount)
                          throws IOException
Atomically increments a column value. If the column value already exists and is not a big-endian long, this could throw an exception.

Parameters:
row -
family -
qualifier -
amount -
Returns:
The new value.
Throws:
IOException

incrementColumnValue

public long incrementColumnValue(byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount,
                                 boolean writeToWAL)
                          throws IOException
Atomically increments a column value. If the column value already exists and is not a big-endian long, this could throw an exception.

Setting writeToWAL to false means that in a fail scenario, you will lose any increments that have not been flushed.

Parameters:
row -
family -
qualifier -
amount -
writeToWAL - true if increment should be applied to WAL, false if not
Returns:
The new value.
Throws:
IOException

checkAndPut

public boolean checkAndPut(byte[] row,
                           byte[] family,
                           byte[] qualifier,
                           byte[] value,
                           Put put)
                    throws IOException
Atomically checks if a row/family/qualifier value match the expectedValue. If it does, it adds the put.

Parameters:
row -
family -
qualifier -
value - the expected value
put -
Returns:
true if the new put was execute, false otherwise
Throws:
IOException

exists

public boolean exists(Get get)
               throws IOException
Test for the existence of columns in the table, as specified in the Get.

This will return true if the Get matches one or more keys, false if not.

This is a server-side call so it prevents any data from being transfered to the client.

Parameters:
get -
Returns:
true if the specified Get matches one or more keys, false if not
Throws:
IOException

flushCommits

public void flushCommits()
                  throws IOException
Commit to the table the buffer of BatchUpdate. Called automatically in the commit methods when autoFlush is true.

Throws:
IOException

close

public void close()
           throws IOException
Release held resources

Throws:
IOException

lockRow

public RowLock lockRow(byte[] row)
                throws IOException
Obtain a row lock

Parameters:
row - The row to lock
Returns:
rowLock RowLock containing row and lock id
Throws:
IOException

unlockRow

public void unlockRow(RowLock rl)
               throws IOException
Release a row lock

Parameters:
rl - The row lock to release
Throws:
IOException

isAutoFlush

public boolean isAutoFlush()
Get the value of autoFlush. If true, updates will not be buffered

Returns:
value of autoFlush

setAutoFlush

public void setAutoFlush(boolean autoFlush)
Set if this instanciation of HTable will autoFlush

Parameters:
autoFlush -

getWriteBufferSize

public long getWriteBufferSize()
Get the maximum size in bytes of the write buffer for this HTable

Returns:
the size of the write buffer in bytes

setWriteBufferSize

public void setWriteBufferSize(long writeBufferSize)
                        throws IOException
Set the size of the buffer in bytes. If the new size is lower than the current size of data in the write buffer, the buffer is flushed.

Parameters:
writeBufferSize -
Throws:
IOException

get

public Cell get(String row,
                String column)
         throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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

public Cell[] get(String row,
                  String column,
                  long timestamp,
                  int numVersions)
           throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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

public RowResult getRow(String row)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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

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

getRow

public RowResult getRow(byte[] row)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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

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

getRow

public RowResult getRow(String row,
                        int numVersions)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of all columns for the specified row

Parameters:
row - row key
numVersions - number of versions to return
Returns:
RowResult is null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        int numVersions)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of all columns for the specified row

Parameters:
row - row key
numVersions - number of versions to return
Returns:
RowResult is null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        long ts)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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

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

getRow

public RowResult getRow(byte[] row,
                        long ts)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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

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

getRow

public RowResult getRow(String row,
                        long ts,
                        int numVersions)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of all columns for the specified row at a specified timestamp

Parameters:
row - row key
ts - timestamp
numVersions - number of versions to return
Returns:
RowResult is null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        long timestamp,
                        int numVersions)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of all columns for the specified row at a specified timestamp

Parameters:
row - row key
timestamp - timestamp
numVersions - number of versions to return
Returns:
RowResult is null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        String[] columns)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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 null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        byte[][] columns)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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 null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        String[] columns,
                        int numVersions)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of selected columns for the specified row

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

getRow

public RowResult getRow(byte[] row,
                        byte[][] columns,
                        int numVersions)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of selected columns for the specified row

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

getRow

public RowResult getRow(String row,
                        String[] columns,
                        long ts)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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 null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        byte[][] columns,
                        long ts)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

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 null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(String row,
                        String[] columns,
                        long timestamp,
                        int numVersions,
                        RowLock rowLock)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get more than one version of selected columns for the specified row, using an existing row lock.

Parameters:
row - row key
columns - Array of column names and families you want to retrieve.
numVersions - number of versions to return
rowLock - previously acquired row lock
Returns:
RowResult is null if row does not exist.
Throws:
IOException

getRow

public RowResult getRow(byte[] row,
                        byte[][] columns,
                        long ts,
                        int numVersions,
                        RowLock rl)
                 throws IOException
Deprecated. As of hbase 0.20.0, replaced by get(Get)

Get selected columns for the specified row at a specified timestamp using existing row lock.

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

getScanner

public Scanner getScanner(String[] columns)
                   throws IOException
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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,
                          String startRow)
                   throws IOException
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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

public Scanner getScanner(String[] columns,
                          String startRow,
                          String stopRow,
                          long timestamp)
                   throws IOException
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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,
                          long timestamp,
                          RowFilterInterface filter)
                   throws IOException
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by getScanner(Scan)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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,
                      String column)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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,
                      long ts)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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,
                      RowLock rl)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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

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.
rl - Existing row lock
Throws:
IOException

deleteAllByRegex

public void deleteAllByRegex(String row,
                             String colRegex)
                      throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

Delete all cells that match the passed row and column.

Parameters:
row - Row to update
colRegex - column regex expression
Throws:
IOException

deleteAllByRegex

public void deleteAllByRegex(String row,
                             String colRegex,
                             long ts)
                      throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
colRegex - Column Regex expression
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAllByRegex

public void deleteAllByRegex(byte[] row,
                             String colRegex,
                             long ts)
                      throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
colRegex - Column Regex expression
ts - Delete all cells of the same timestamp or older.
Throws:
IOException

deleteAllByRegex

public void deleteAllByRegex(byte[] row,
                             String colRegex,
                             long ts,
                             RowLock rl)
                      throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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

Parameters:
row - Row to update
colRegex - Column regex expression
ts - Delete all cells of the same timestamp or older.
rl - Existing row lock
Throws:
IOException

deleteFamily

public void deleteFamily(String row,
                         String family)
                  throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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

deleteFamily

public void deleteFamily(byte[] row,
                         byte[] family,
                         long timestamp)
                  throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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

deleteFamily

public void deleteFamily(byte[] row,
                         byte[] family,
                         long timestamp,
                         RowLock rl)
                  throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

Delete all cells for a row with matching column family with timestamps less than or equal to timestamp, using existing row lock.

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

deleteFamilyByRegex

public void deleteFamilyByRegex(String row,
                                String familyRegex)
                         throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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

Parameters:
row - The row to operate on
familyRegex - Column family regex
Throws:
IOException

deleteFamilyByRegex

public void deleteFamilyByRegex(byte[] row,
                                String familyRegex)
                         throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

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

Parameters:
row - The row to operate on
familyRegex - Column family regex
Throws:
IOException

deleteFamilyByRegex

public void deleteFamilyByRegex(String row,
                                String familyRegex,
                                long timestamp)
                         throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

Delete all cells for a row with matching column family regex with timestamps less than or equal to timestamp.

Parameters:
row - The row to operate on
familyRegex - Column family regex
timestamp - Timestamp to match
Throws:
IOException

deleteFamilyByRegex

public void deleteFamilyByRegex(byte[] row,
                                String familyRegex,
                                long timestamp)
                         throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

Delete all cells for a row with matching column family regex with timestamps less than or equal to timestamp.

Parameters:
row - The row to operate on
familyRegex - Column family regex
timestamp - Timestamp to match
Throws:
IOException

deleteFamilyByRegex

public void deleteFamilyByRegex(byte[] row,
                                String familyRegex,
                                long timestamp,
                                RowLock r1)
                         throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete)

Delete all cells for a row with matching column family regex with timestamps less than or equal to timestamp, using existing row lock.

Parameters:
row - The row to operate on
familyRegex - Column Family Regex
timestamp - Timestamp to match
r1 - Existing row lock
Throws:
IOException

exists

public boolean exists(byte[] row)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by exists(Get)

Test for the existence of a row in the table.

Parameters:
row - The row
Returns:
true if the row exists, false otherwise
Throws:
IOException

exists

public boolean exists(byte[] row,
                      byte[] column)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by exists(Get)

Test for the existence of a row and column in the table.

Parameters:
row - The row
column - The column
Returns:
true if the row exists, false otherwise
Throws:
IOException

exists

public boolean exists(byte[] row,
                      byte[] column,
                      long timestamp)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by exists(Get)

Test for the existence of a coordinate in the table.

Parameters:
row - The row
column - The column
timestamp - The timestamp
Returns:
true if the specified coordinate exists
Throws:
IOException

exists

public boolean exists(byte[] row,
                      byte[] column,
                      long timestamp,
                      RowLock rl)
               throws IOException
Deprecated. As of hbase 0.20.0, replaced by exists(Get)

Test for the existence of a coordinate in the table.

Parameters:
row - The row
column - The column
timestamp - The timestamp
rl - Existing row lock
Returns:
true if the specified coordinate exists
Throws:
IOException

commit

public void commit(BatchUpdate batchUpdate)
            throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete) or put(Put)

Commit a BatchUpdate to the table. If autoFlush is false, the update is buffered

Parameters:
batchUpdate -
Throws:
IOException

commit

public void commit(BatchUpdate batchUpdate,
                   RowLock rl)
            throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete) or put(Put)

Commit a BatchUpdate to the table using existing row lock. If autoFlush is false, the update is buffered

Parameters:
batchUpdate -
rl - Existing row lock
Throws:
IOException

commit

public void commit(List<BatchUpdate> batchUpdates)
            throws IOException
Deprecated. As of hbase 0.20.0, replaced by delete(Delete) or put(List)

Commit a List of BatchUpdate to the table. If autoFlush is false, the updates are buffered

Parameters:
batchUpdates -
Throws:
IOException

checkAndSave

public boolean checkAndSave(BatchUpdate batchUpdate,
                            HbaseMapWritable<byte[],byte[]> expectedValues,
                            RowLock rl)
                     throws IOException
Deprecated. As of hbase 0.20.0, replaced by checkAndPut(byte[], byte[], byte[], byte[], org.apache.hadoop.hbase.client.Put)

Atomically checks if a row's values match the expectedValues. If it does, it uses the batchUpdate to update the row.

This operation is not currently supported, use checkAndPut(byte[], byte[], byte[], byte[], org.apache.hadoop.hbase.client.Put)

Parameters:
batchUpdate - batchupdate to apply if check is successful
expectedValues - values to check
rl - rowlock
Throws:
IOException


Copyright © 2009 The Apache Software Foundation