|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.rest.client.RemoteHTable
public class RemoteHTable
HTable interface to remote tables accessed via REST gateway
| Constructor Summary | |
|---|---|
RemoteHTable(Client client,
org.apache.hadoop.conf.Configuration conf,
byte[] name,
String accessToken)
Constructor |
|
RemoteHTable(Client client,
org.apache.hadoop.conf.Configuration conf,
String name,
String accessToken)
Constructor |
|
RemoteHTable(Client client,
String name)
Constructor |
|
RemoteHTable(Client client,
String name,
String accessToken)
Constructor |
|
| Method Summary | |
|---|---|
protected CellSetModel |
buildModelFromPut(Put put)
|
protected Result[] |
buildResultFromModel(CellSetModel model)
|
protected String |
buildRowSpec(byte[] row,
Map familyMap,
long startTime,
long endTime,
int maxVersions)
|
boolean |
checkAndDelete(byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
Delete delete)
Atomically checks if a row/family/qualifier value matches the expected value. |
boolean |
checkAndPut(byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
Put put)
Atomically checks if a row/family/qualifier value matches the expected value. |
void |
close()
Releases any resources help or pending changes in internal buffers. |
void |
delete(Delete delete)
Deletes the specified cells/row. |
void |
delete(List<Delete> deletes)
Deletes the specified cells/rows in bulk. |
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. |
Result |
get(Get get)
Extracts certain cells from a given row. |
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns the Configuration object used by this instance. |
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. |
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. |
HTableDescriptor |
getTableDescriptor()
Gets the table descriptor for this table. |
byte[] |
getTableName()
Gets the name of this table. |
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. |
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 |
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 |
| Constructor Detail |
|---|
public RemoteHTable(Client client,
String name)
client - name -
public RemoteHTable(Client client,
String name,
String accessToken)
client - name - accessToken -
public RemoteHTable(Client client,
org.apache.hadoop.conf.Configuration conf,
String name,
String accessToken)
client - conf - name - accessToken -
public RemoteHTable(Client client,
org.apache.hadoop.conf.Configuration conf,
byte[] name,
String accessToken)
conf - | Method Detail |
|---|
protected String buildRowSpec(byte[] row,
Map familyMap,
long startTime,
long endTime,
int maxVersions)
protected Result[] buildResultFromModel(CellSetModel model)
protected CellSetModel buildModelFromPut(Put put)
public byte[] getTableName()
HTableInterface
getTableName in interface HTableInterfacepublic org.apache.hadoop.conf.Configuration getConfiguration()
HTableInterfaceConfiguration object used by this instance.
The reference returned is not a copy, so any change made to it will affect this instance.
getConfiguration in interface HTableInterface
public HTableDescriptor getTableDescriptor()
throws IOException
HTableInterfacetable descriptor for this table.
getTableDescriptor in interface HTableInterfaceIOException - if a remote or network exception occurs.
public void close()
throws IOException
HTableInterface
close in interface HTableInterfaceIOException - if a remote or network exception occurs.
public Result get(Get get)
throws IOException
HTableInterface
get in interface HTableInterfaceget - 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 boolean exists(Get get)
throws IOException
HTableInterfaceThis 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.
exists in interface HTableInterfaceget - the Get
IOException - e
public void put(Put put)
throws IOException
HTableInterface
If isAutoFlush is false, the update is buffered
until the internal buffer is full.
put in interface HTableInterfaceput - The data to put.
IOException - if a remote or network exception occurs.
public void put(List<Put> puts)
throws IOException
HTableInterface
If isAutoFlush is false, the update is buffered
until the internal buffer is full.
put in interface HTableInterfaceputs - 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
Puts 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 void delete(Delete delete)
throws IOException
HTableInterface
delete in interface HTableInterfacedelete - The object that specifies what to delete.
IOException - if a remote or network exception occurs.
public void delete(List<Delete> deletes)
throws IOException
HTableInterface
delete in interface HTableInterfacedeletes - 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
Deletes 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 flushCommits()
throws IOException
HTableInterfacePut operations.
This method gets called once automatically for every Put or batch
of Puts (when #put(List is used) when
HTableInterface.isAutoFlush() is true.
flushCommits in interface HTableInterfaceIOException - if a remote or network exception occurs.
public ResultScanner getScanner(Scan scan)
throws IOException
HTableInterfaceScan
object.
getScanner in interface HTableInterfacescan - A configured Scan object.
IOException - if a remote or network exception occurs.
public ResultScanner getScanner(byte[] family)
throws IOException
HTableInterface
getScanner in interface HTableInterfacefamily - The column family to scan.
IOException - if a remote or network exception occurs.
public ResultScanner getScanner(byte[] family,
byte[] qualifier)
throws IOException
HTableInterface
getScanner in interface HTableInterfacefamily - The column family to scan.qualifier - The column qualifier to scan.
IOException - if a remote or network exception occurs.public boolean isAutoFlush()
HTableInterface
isAutoFlush in interface HTableInterfacetrue if 'auto-flush' is enabled (default), meaning
Put operations don't get buffered/delayed and are immediately
executed.
public Result getRowOrBefore(byte[] row,
byte[] family)
throws IOException
HTableInterface
getRowOrBefore in interface HTableInterfacerow - A row key.family - Column family to include in the Result.
IOException - if a remote or network exception occurs.
public RowLock lockRow(byte[] row)
throws IOException
HTableInterface
lockRow in interface HTableInterfacerow - The row to lock.
RowLock containing the row and lock id.
IOException - if a remote or network exception occurs.RowLock,
HTableInterface.unlockRow(org.apache.hadoop.hbase.client.RowLock)
public void unlockRow(RowLock rl)
throws IOException
HTableInterface
unlockRow in interface HTableInterfacerl - The row lock to release.
IOException - if a remote or network exception occurs.RowLock,
HTableInterface.unlockRow(org.apache.hadoop.hbase.client.RowLock)
public boolean checkAndPut(byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
Put put)
throws IOException
HTableInterface
checkAndPut in interface HTableInterfacerow - to checkfamily - column family to checkqualifier - column qualifier to checkvalue - the expected valueput - data to put if check succeeds
IOException - e
public boolean checkAndDelete(byte[] row,
byte[] family,
byte[] qualifier,
byte[] value,
Delete delete)
throws IOException
HTableInterface
checkAndDelete in interface HTableInterfacerow - to checkfamily - column family to checkqualifier - column qualifier to checkvalue - the expected valuedelete - data to delete if check succeeds
IOException - e
public long incrementColumnValue(byte[] row,
byte[] family,
byte[] qualifier,
long amount)
throws IOException
HTableInterface
Equivalent to {@link #incrementColumnValue(byte[], byte[], byte[],
long, boolean) incrementColumnValue}(row, family, qualifier, amount,
<b>true</b>)
incrementColumnValue in interface HTableInterfacerow - 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
HTableInterfaceamount 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.
incrementColumnValue in interface HTableInterfacerow - 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||