|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.HTable
public class HTable
Used to communicate with a single HBase table. This class is not thread safe. Use one instance per thread. Puts, deletes, checkAndPut and incrementColumnValue are done in an exclusive (and thus serial) fashion for each row. These calls acquire a row lock which is shared with the lockRow calls. Gets and Scans will not return half written data. That is, all mutation operations are atomic on a row basis with respect to other concurrent readers and writers.
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()
Releases any resources help or pending changes in internal buffers. |
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(ArrayList<Delete> deletes)
Deletes the specified cells/rows in bulk. |
void |
delete(Delete delete)
Deletes the specified cells/row. |
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()
Executes all the buffered Put operations. |
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)
Extracts certain cells from a given 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()
INTERNAL 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)
Finds the region on which the given row is being served. |
HRegionLocation |
getRegionLocation(String row)
Find region location hosting passed row using cached info |
Map<HRegionInfo,HServerAddress> |
getRegionsInfo()
Gets 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 precedes it. |
ResultScanner |
getScanner(byte[] family)
Gets a scanner on the current table for the given family. |
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)
Gets a scanner on the current table for the given family and qualifier. |
ResultScanner |
getScanner(Scan scan)
Returns 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()
Gets the number of rows that a scanner will fetch at once. |
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()
Gets the table descriptor for this table. |
byte[] |
getTableName()
Gets the name of this table. |
ArrayList<Put> |
getWriteBuffer()
Get the write buffer |
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()
Tells whether or not 'auto-flush' is turned on. |
static boolean |
isTableEnabled(byte[] tableName)
Tells whether or not a table is enabled or not. |
static boolean |
isTableEnabled(HBaseConfiguration conf,
byte[] tableName)
Tells whether or not a table is enabled or not. |
static boolean |
isTableEnabled(HBaseConfiguration conf,
String tableName)
Tells whether or not a table is enabled or not. |
static boolean |
isTableEnabled(String tableName)
Tells whether or not a table is enabled or not. |
RowLock |
lockRow(byte[] row)
Obtains a lock on a row. |
void |
put(List<Put> puts)
Puts some data in the table, in batch. |
void |
put(Put put)
Puts some data in the table. |
void |
setAutoFlush(boolean autoFlush)
Turns on or off 'auto-flush' on this instance. |
void |
setScannerCaching(int scannerCaching)
Sets the number of rows that a scanner will fetch at once. |
void |
setWriteBufferSize(long writeBufferSize)
Set the size of the buffer in bytes. |
void |
unlockRow(RowLock rl)
Releases a row lock. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final int scannerTimeout
protected int scannerCaching
Constructor Detail |
---|
public HTable(String tableName) throws IOException
tableName
- Name of the table.
IOException
- if a remote or network exception occurspublic HTable(byte[] tableName) throws IOException
tableName
- Name of the table.
IOException
- if a remote or network exception occurspublic HTable(HBaseConfiguration conf, String tableName) throws IOException
conf
- Configuration object to use.tableName
- Name of the table.
IOException
- if a remote or network exception occurspublic HTable(HBaseConfiguration conf, byte[] tableName) throws IOException
conf
- Configuration object to use.tableName
- Name of the table.
IOException
- if a remote or network exception occursMethod Detail |
---|
public static boolean isTableEnabled(String tableName) throws IOException
tableName
- Name of table to check.
true
if table is online.
IOException
- if a remote or network exception occurspublic static boolean isTableEnabled(byte[] tableName) throws IOException
tableName
- Name of table to check.
true
if table is online.
IOException
- if a remote or network exception occurspublic static boolean isTableEnabled(HBaseConfiguration conf, String tableName) throws IOException
conf
- The Configuration object to use.tableName
- Name of table to check.
true
if table is online.
IOException
- if a remote or network exception occurspublic static boolean isTableEnabled(HBaseConfiguration conf, byte[] tableName) throws IOException
conf
- The Configuration object to use.tableName
- Name of table to check.
true
if table is online.
IOException
- if a remote or network exception occurspublic HRegionLocation getRegionLocation(String row) throws IOException
row
- Row to find.
IOException
- if a remote or network exception occurspublic HRegionLocation getRegionLocation(byte[] row) throws IOException
row
- Row to find.
IOException
- if a remote or network exception occurspublic byte[] getTableName()
public HConnection getConnection()
public int getScannerCaching()
The default value comes from hbase.client.scanner.caching
.
public void setScannerCaching(int scannerCaching)
This will override the value specified by
hbase.client.scanner.caching
.
Increasing this value will reduce the amount of work needed each time
next()
is called on a scanner, at the expense of memory use
(since more rows will need to be maintained in memory by the scanners).
scannerCaching
- the number of rows a scanner will fetch at once.public HTableDescriptor getTableDescriptor() throws IOException
table descriptor
for this table.
IOException
- if a remote or network exception occurs.public byte[][] getStartKeys() throws IOException
This is mainly useful for the MapReduce integration.
IOException
- if a remote or network exception occurspublic byte[][] getEndKeys() throws IOException
This is mainly useful for the MapReduce integration.
IOException
- if a remote or network exception occurspublic Pair<byte[][],byte[][]> getStartEndKeys() throws IOException
This is mainly useful for the MapReduce integration.
IOException
- if a remote or network exception occurspublic Map<HRegionInfo,HServerAddress> getRegionsInfo() throws IOException
This is mainly useful for the MapReduce integration.
IOException
- if a remote or network exception occurspublic Result getRowOrBefore(byte[] row, byte[] family) throws IOException
row
- A row key.family
- Column family to include in the Result
.
IOException
- if a remote or network exception occurs.public RowResult getClosestRowBefore(byte[] row, byte[] family) throws IOException
getRowOrBefore(byte[], byte[])
row
- row keyfamily
- Column family to look for row in.
IOException
public ResultScanner getScanner(Scan scan) throws IOException
Scan
object.
scan
- A configured Scan
object.
IOException
- if a remote or network exception occurs.public ResultScanner getScanner(byte[] family) throws IOException
family
- The column family to scan.
IOException
- if a remote or network exception occurs.public ResultScanner getScanner(byte[] family, byte[] qualifier) throws IOException
family
- The column family to scan.qualifier
- The column qualifier to scan.
IOException
- if a remote or network exception occurs.public Result get(Get get) throws IOException
get
- The object that specifies what data to fetch and from which row.
Result
instance returned won't
contain any KeyValue
, as indicated by Result.isEmpty()
.
IOException
- if a remote or network exception occurs.public void delete(Delete delete) throws IOException
delete
- The object that specifies what to delete.
IOException
- if a remote or network exception occurs.public void delete(ArrayList<Delete> deletes) throws IOException
deletes
- List of things to delete. List gets modified by this
method (in particular it gets re-ordered, so the order in which the elements
are inserted in the list gives no guarantee as to the order in which the
Delete
s are executed).
IOException
- if a remote or network exception occurs. In that case
the deletes
argument will contain the Delete
instances
that have not be successfully applied.public void put(Put put) throws IOException
If isAutoFlush
is false, the update is buffered
until the internal buffer is full.
put
- The data to put.
IOException
- if a remote or network exception occurs.public void put(List<Put> puts) throws IOException
If isAutoFlush
is false, the update is buffered
until the internal buffer is full.
puts
- The list of mutations to apply. The list gets modified by this
method (in particular it gets re-ordered, so the order in which the elements
are inserted in the list gives no guarantee as to the order in which the
Put
s are executed).
IOException
- if a remote or network exception occurs. In that case
the puts
argument will contain the Put
instances that
have not be successfully applied.public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount) throws IOException
Equivalent to {@link #incrementColumnValue(byte[], byte[], byte[],
long, boolean) incrementColumnValue}(row, family, qualifier, amount,
<b>true</b>)
row
- The row that contains the cell to increment.family
- The column family of the cell to increment.qualifier
- The column qualifier of the cell to increment.amount
- The amount to increment the cell with (or decrement, if the
amount is negative).
IOException
- if a remote or network exception occurs.public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL) throws IOException
amount
and
written to the specified column.
Setting writeToWAL to false means that in a fail scenario, you will lose any increments that have not been flushed.
row
- The row that contains the cell to increment.family
- The column family of the cell to increment.qualifier
- The column qualifier of the cell to increment.amount
- The amount to increment the cell with (or decrement, if the
amount is negative).writeToWAL
- if true
, the operation will be applied to the
Write Ahead Log (WAL). This makes the operation slower but safer, as if
the call returns successfully, it is guaranteed that the increment will
be safely persisted. When set to false
, the call may return
successfully before the increment is safely persisted, so it's possible
that the increment be lost in the event of a failure happening before the
operation gets persisted.
IOException
- if a remote or network exception occurs.public boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put) throws IOException
row
- family
- qualifier
- value
- the expected valueput
-
IOException
public boolean exists(Get get) throws IOException
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.
get
-
IOException
public void flushCommits() throws IOException
Put
operations.
This method gets called once automatically for every Put
or batch
of Put
s (when put(List)
is used) when
isAutoFlush()
is true
.
IOException
- if a remote or network exception occurs.public void close() throws IOException
IOException
- if a remote or network exception occurs.public RowLock lockRow(byte[] row) throws IOException
row
- The row to lock.
RowLock
containing the row and lock id.
IOException
- if a remote or network exception occurs.RowLock
,
unlockRow(org.apache.hadoop.hbase.client.RowLock)
public void unlockRow(RowLock rl) throws IOException
rl
- The row lock to release.
IOException
- if a remote or network exception occurs.RowLock
,
lockRow(byte[])
public boolean isAutoFlush()
true
if 'auto-flush' is enabled (default), meaning
Put
operations don't get buffered/delayed and are immediately
executed.setAutoFlush(boolean)
public void setAutoFlush(boolean autoFlush)
autoFlush
- Whether or not to use 'auto-flush'.isAutoFlush()
public long getWriteBufferSize()
public void setWriteBufferSize(long writeBufferSize) throws IOException
writeBufferSize
-
IOException
public ArrayList<Put> getWriteBuffer()
public Cell get(String row, String column) throws IOException
get(Get)
row
- row keycolumn
- column name
IOException
public Cell[] get(String row, String column, int numVersions) throws IOException
get(Get)
row
- row keycolumn
- column namenumVersions
- - number of versions to retrieve
IOException
public Cell get(byte[] row, byte[] column) throws IOException
get(Get)
row
- row keycolumn
- column name
IOException
public Cell[] get(byte[] row, byte[] column, int numVersions) throws IOException
get(Get)
row
- row keycolumn
- column namenumVersions
- number of versions to retrieve
IOException
public Cell[] get(String row, String column, long timestamp, int numVersions) throws IOException
get(Get)
row
- - row keycolumn
- - column nametimestamp
- - timestampnumVersions
- - number of versions to retrieve
IOException
public Cell[] get(byte[] row, byte[] column, long timestamp, int numVersions) throws IOException
get(Get)
row
- - row keycolumn
- - column nametimestamp
- - timestampnumVersions
- - number of versions to retrieve
IOException
public RowResult getRow(String row) throws IOException
get(Get)
row
- row key
null
if row does not exist.
IOException
public RowResult getRow(byte[] row) throws IOException
get(Get)
row
- row key
null
if row does not exist.
IOException
public RowResult getRow(String row, int numVersions) throws IOException
get(Get)
row
- row keynumVersions
- number of versions to return
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, int numVersions) throws IOException
get(Get)
row
- row keynumVersions
- number of versions to return
null
if row does not exist.
IOException
public RowResult getRow(String row, long ts) throws IOException
get(Get)
row
- row keyts
- timestamp
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, long ts) throws IOException
get(Get)
row
- row keyts
- timestamp
null
if row does not exist.
IOException
public RowResult getRow(String row, long ts, int numVersions) throws IOException
get(Get)
row
- row keyts
- timestampnumVersions
- number of versions to return
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, long timestamp, int numVersions) throws IOException
get(Get)
row
- row keytimestamp
- timestampnumVersions
- number of versions to return
null
if row does not exist.
IOException
public RowResult getRow(String row, String[] columns) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, byte[][] columns) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.
null
if row does not exist.
IOException
public RowResult getRow(String row, String[] columns, int numVersions) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.numVersions
- number of versions to return
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, byte[][] columns, int numVersions) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.numVersions
- number of versions to return
null
if row does not exist.
IOException
public RowResult getRow(String row, String[] columns, long ts) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.ts
- timestamp
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, byte[][] columns, long ts) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.ts
- timestamp
null
if row does not exist.
IOException
public RowResult getRow(String row, String[] columns, long timestamp, int numVersions, RowLock rowLock) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.numVersions
- number of versions to returnrowLock
- previously acquired row lock
null
if row does not exist.
IOException
public RowResult getRow(byte[] row, byte[][] columns, long ts, int numVersions, RowLock rl) throws IOException
get(Get)
row
- row keycolumns
- Array of column names and families you want to retrieve.ts
- timestampnumVersions
- rl
- row lock
null
if row does not exist.
IOException
public Scanner getScanner(String[] columns) throws IOException
getScanner(Scan)
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:
\+|^&*$[]]}{)(
.
IOException
public Scanner getScanner(String[] columns, String startRow) throws IOException
getScanner(Scan)
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
IOException
public Scanner getScanner(byte[][] columns) throws IOException
getScanner(Scan)
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:
\+|^&*$[]]}{)(
.
IOException
public Scanner getScanner(byte[][] columns, byte[] startRow) throws IOException
getScanner(Scan)
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
IOException
public Scanner getScanner(byte[][] columns, byte[] startRow, long timestamp) throws IOException
getScanner(Scan)
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 scantimestamp
- only return results whose timestamp <= this value
IOException
public Scanner getScanner(byte[][] columns, byte[] startRow, RowFilterInterface filter) throws IOException
getScanner(Scan)
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 scanfilter
- a row filter using row-key regexp and/or column data filter.
IOException
public Scanner getScanner(byte[][] columns, byte[] startRow, byte[] stopRow) throws IOException
getScanner(Scan)
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 scanstopRow
- 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
public Scanner getScanner(String[] columns, String startRow, String stopRow, long timestamp) throws IOException
getScanner(Scan)
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 scanstopRow
- 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
public Scanner getScanner(byte[][] columns, byte[] startRow, byte[] stopRow, long timestamp) throws IOException
getScanner(Scan)
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 scanstopRow
- 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
public Scanner getScanner(String[] columns, String startRow, long timestamp, RowFilterInterface filter) throws IOException
getScanner(Scan)
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 scantimestamp
- only return results whose timestamp <= this valuefilter
- a row filter using row-key regexp and/or column data filter.
IOException
public Scanner getScanner(byte[][] columns, byte[] startRow, long timestamp, RowFilterInterface filter) throws IOException
getScanner(Scan)
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 scantimestamp
- only return results whose timestamp <= this valuefilter
- a row filter using row-key regexp and/or column data filter.
IOException
public void deleteAll(byte[] row) throws IOException
delete(Delete)
row
- Key of the row you want to completely delete.
IOException
public void deleteAll(String row) throws IOException
delete(Delete)
row
- Key of the row you want to completely delete.
IOException
public void deleteAll(byte[] row, byte[] column) throws IOException
delete(Delete)
row
- Key of the row you want to completely delete.column
- column to be deleted
IOException
public void deleteAll(byte[] row, long ts) throws IOException
delete(Delete)
row
- Key of the row you want to completely delete.ts
- Delete all cells of the same timestamp or older.
IOException
public void deleteAll(String row, long ts) throws IOException
delete(Delete)
row
- Key of the row you want to completely delete.ts
- Delete all cells of the same timestamp or older.
IOException
public void deleteAll(String row, String column) throws IOException
delete(Delete)
row
- Row to updatecolumn
- name of column whose value is to be deleted
IOException
public void deleteAll(String row, String column, long ts) throws IOException
delete(Delete)
row
- Row to updatecolumn
- name of column whose value is to be deletedts
- Delete all cells of the same timestamp or older.
IOException
public void deleteAll(byte[] row, byte[] column, long ts) throws IOException
delete(Delete)
row
- Row to updatecolumn
- name of column whose value is to be deletedts
- Delete all cells of the same timestamp or older.
IOException
public void deleteAll(byte[] row, byte[] column, long ts, RowLock rl) throws IOException
delete(Delete)
row
- Row to updatecolumn
- name of column whose value is to be deletedts
- Delete all cells of the same timestamp or older.rl
- Existing row lock
IOException
public void deleteAllByRegex(String row, String colRegex) throws IOException
delete(Delete)
row
- Row to updatecolRegex
- column regex expression
IOException
public void deleteAllByRegex(String row, String colRegex, long ts) throws IOException
delete(Delete)
row
- Row to updatecolRegex
- Column Regex expressionts
- Delete all cells of the same timestamp or older.
IOException
public void deleteAllByRegex(byte[] row, String colRegex, long ts) throws IOException
delete(Delete)
row
- Row to updatecolRegex
- Column Regex expressionts
- Delete all cells of the same timestamp or older.
IOException
public void deleteAllByRegex(byte[] row, String colRegex, long ts, RowLock rl) throws IOException
delete(Delete)
row
- Row to updatecolRegex
- Column regex expressionts
- Delete all cells of the same timestamp or older.rl
- Existing row lock
IOException
public void deleteFamily(String row, String family) throws IOException
delete(Delete)
row
- The row to operate onfamily
- The column family to match
IOException
public void deleteFamily(byte[] row, byte[] family) throws IOException
delete(Delete)
row
- The row to operate onfamily
- The column family to match
IOException
public void deleteFamily(String row, String family, long timestamp) throws IOException
delete(Delete)
row
- The row to operate onfamily
- The column family to matchtimestamp
- Timestamp to match
IOException
public void deleteFamily(byte[] row, byte[] family, long timestamp) throws IOException
delete(Delete)
row
- The row to operate onfamily
- The column family to matchtimestamp
- Timestamp to match
IOException
public void deleteFamily(byte[] row, byte[] family, long timestamp, RowLock rl) throws IOException
delete(Delete)
row
- The row to operate onfamily
- The column family to matchtimestamp
- Timestamp to matchrl
- Existing row lock
IOException
public void deleteFamilyByRegex(String row, String familyRegex) throws IOException
delete(Delete)
row
- The row to operate onfamilyRegex
- Column family regex
IOException
public void deleteFamilyByRegex(byte[] row, String familyRegex) throws IOException
delete(Delete)
row
- The row to operate onfamilyRegex
- Column family regex
IOException
public void deleteFamilyByRegex(String row, String familyRegex, long timestamp) throws IOException
delete(Delete)
row
- The row to operate onfamilyRegex
- Column family regextimestamp
- Timestamp to match
IOException
public void deleteFamilyByRegex(byte[] row, String familyRegex, long timestamp) throws IOException
delete(Delete)
row
- The row to operate onfamilyRegex
- Column family regextimestamp
- Timestamp to match
IOException
public void deleteFamilyByRegex(byte[] row, String familyRegex, long timestamp, RowLock r1) throws IOException
delete(Delete)
row
- The row to operate onfamilyRegex
- Column Family Regextimestamp
- Timestamp to matchr1
- Existing row lock
IOException
public boolean exists(byte[] row) throws IOException
exists(Get)
row
- The row
IOException
public boolean exists(byte[] row, byte[] column) throws IOException
exists(Get)
row
- The rowcolumn
- The column
IOException
public boolean exists(byte[] row, byte[] column, long timestamp) throws IOException
exists(Get)
row
- The rowcolumn
- The columntimestamp
- The timestamp
IOException
public boolean exists(byte[] row, byte[] column, long timestamp, RowLock rl) throws IOException
exists(Get)
row
- The rowcolumn
- The columntimestamp
- The timestamprl
- Existing row lock
IOException
public void commit(BatchUpdate batchUpdate) throws IOException
delete(Delete)
or
put(Put)
batchUpdate
-
IOException
public void commit(BatchUpdate batchUpdate, RowLock rl) throws IOException
delete(Delete)
or
put(Put)
batchUpdate
- rl
- Existing row lock
IOException
public void commit(List<BatchUpdate> batchUpdates) throws IOException
delete(Delete)
or
put(List)
batchUpdates
-
IOException
public boolean checkAndSave(BatchUpdate batchUpdate, HbaseMapWritable<byte[],byte[]> expectedValues, RowLock rl) throws IOException
checkAndPut(byte[], byte[], byte[], byte[], org.apache.hadoop.hbase.client.Put)
This operation is not currently supported, use checkAndPut(byte[], byte[], byte[], byte[], org.apache.hadoop.hbase.client.Put)
batchUpdate
- batchupdate to apply if check is successfulexpectedValues
- values to checkrl
- rowlock
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |