public final class HbaseSessions.Session extends BackendSession
| Constructor and Description |
|---|
Session() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
closed() |
Integer |
commit()
Commit all updates(put/delete) to DB
|
void |
delete(String table,
byte[] family,
byte[] rowkey)
Delete a record by rowkey from a table
|
HbaseSessions.RowIterator |
get(String table,
byte[] family,
byte[] rowkey)
Get a record by rowkey from a table
|
HbaseSessions.RowIterator |
get(String table,
byte[] family,
byte[] rowkey,
byte[] qualifier)
Get a record by rowkey and qualifier from a table
|
HbaseSessions.RowIterator |
get(String table,
byte[] family,
Set<byte[]> rowkeys)
Get multi records by rowkeys from a table
|
boolean |
hasChanges()
Any change in the session
|
long |
increase(String table,
byte[] family,
byte[] rowkey,
byte[] qualifier,
long value)
Increase a counter by rowkey and qualifier to a table
|
void |
put(String table,
byte[] family,
byte[] rowkey,
byte[] qualifier,
byte[] value)
Add a row record to a table(can be used when adding an index)
|
void |
put(String table,
byte[] family,
byte[] rowkey,
Collection<BackendEntry.BackendColumn> columns)
Add a row record to a table
|
void |
remove(String table,
byte[] family,
byte[] rowkey,
byte[] qualifier)
Delete a record by rowkey and qualifier from a table
|
void |
remove(String table,
byte[] family,
byte[] rowkey,
byte[] qualifier,
boolean latestVersion)
Delete a record by rowkey and qualifier from a table,
just delete the latest version of the specified column if need
|
void |
rollback()
Rollback all updates(put/delete) not committed
|
HbaseSessions.RowIterator |
scan(String table,
byte[] prefix)
Scan records by rowkey prefix from a table
|
HbaseSessions.RowIterator |
scan(String table,
byte[] startRow,
boolean inclusiveStart,
byte[] prefix)
Scan records by rowkey start and prefix from a table
|
HbaseSessions.RowIterator |
scan(String table,
byte[] startRow,
boolean inclusiveStart,
byte[] stopRow,
boolean inclusiveStop)
Scan records by rowkey range from a table
|
HbaseSessions.RowIterator |
scan(String table,
byte[] startRow,
byte[] stopRow)
Scan records by rowkey range from a table
|
HbaseSessions.RowIterator |
scan(String table,
long limit)
Scan all records from a table
|
HbaseSessions.RowIterator |
scan(String table,
Set<byte[]> prefixs)
Scan records by multi rowkey prefixs from a table
|
long |
storeSize(String table)
Get store size of specified table
|
public void close()
close in class BackendSessionpublic boolean closed()
closed in class BackendSessionpublic boolean hasChanges()
hasChanges in class BackendSessionpublic Integer commit()
commit in class BackendSessionpublic void rollback()
rollback in class BackendSessionpublic void put(String table, byte[] family, byte[] rowkey, Collection<BackendEntry.BackendColumn> columns)
public void put(String table, byte[] family, byte[] rowkey, byte[] qualifier, byte[] value)
public void remove(String table, byte[] family, byte[] rowkey, byte[] qualifier)
public void remove(String table, byte[] family, byte[] rowkey, byte[] qualifier, boolean latestVersion)
public void delete(String table, byte[] family, byte[] rowkey)
public HbaseSessions.RowIterator get(String table, byte[] family, byte[] rowkey, byte[] qualifier)
public HbaseSessions.RowIterator get(String table, byte[] family, byte[] rowkey)
public HbaseSessions.RowIterator get(String table, byte[] family, Set<byte[]> rowkeys)
public HbaseSessions.RowIterator scan(String table, long limit)
public HbaseSessions.RowIterator scan(String table, byte[] prefix)
public HbaseSessions.RowIterator scan(String table, Set<byte[]> prefixs)
public HbaseSessions.RowIterator scan(String table, byte[] startRow, boolean inclusiveStart, byte[] prefix)
public HbaseSessions.RowIterator scan(String table, byte[] startRow, byte[] stopRow)
public HbaseSessions.RowIterator scan(String table, byte[] startRow, boolean inclusiveStart, byte[] stopRow, boolean inclusiveStop)
public long increase(String table, byte[] family, byte[] rowkey, byte[] qualifier, long value)
public long storeSize(String table) throws IOException
IOExceptionCopyright © 2017–2019. All rights reserved.