@API.Public public interface Table extends AutoCloseable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Table.TableOption
Following are different table options:
EXCLUDEID: If this option is set to true then rowkey
(field "_id") won't be returned in the result of a find or findById operation. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkAndDelete(ByteBuffer id,
Condition condition) |
boolean |
checkAndDelete(String id,
Condition condition)
Atomically evaluates the condition on given row and if the
condition holds true for the row then it is atomically deleted.
|
boolean |
checkAndMutate(ByteBuffer id,
Condition condition,
Mutation m) |
boolean |
checkAndMutate(String id,
Condition condition,
Mutation m)
Atomically evaluates the condition on a given row and if the
condition holds true for the row then a mutation is applied on the row.
|
boolean |
checkAndReplace(ByteBuffer id,
Condition condition,
org.ojai.Document r) |
boolean |
checkAndReplace(String id,
Condition condition,
org.ojai.Document r)
Atomically evaluates the condition on the given row and if the
condition holds true for the row then it atomically replaces the row
with the given document.
|
void |
close()
Override
AutoCloseable.close() to avoid declaring a checked exception. |
void |
delete(ByteBuffer id) |
void |
delete(org.ojai.Document r) |
void |
delete(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey) |
void |
delete(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
Deletes a set of documents from the table represented by the document stream.
|
void |
delete(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey) |
void |
delete(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey) |
void |
delete(org.ojai.Document r,
String fieldAsKey) |
void |
delete(String id)
Deletes a row with the given rowkey.
|
org.ojai.DocumentStream<DBDocument> |
find()
Returns a document stream for all the rows in the table.
|
org.ojai.DocumentStream<DBDocument> |
find(Condition c)
Returns a document stream for all the rows in the table that match the
condition.
|
org.ojai.DocumentStream<DBDocument> |
find(Condition c,
org.ojai.FieldPath... paths) |
org.ojai.DocumentStream<DBDocument> |
find(Condition c,
String... paths)
Returns a document reader for all the rows in the table that match the
condition.
|
org.ojai.DocumentStream<DBDocument> |
find(org.ojai.FieldPath... paths) |
org.ojai.DocumentStream<DBDocument> |
find(String... paths)
Returns a document stream for all the rows in the table.
|
DBDocument |
findById(ByteBuffer id) |
DBDocument |
findById(ByteBuffer id,
Condition c) |
DBDocument |
findById(ByteBuffer id,
Condition c,
org.ojai.FieldPath... paths) |
DBDocument |
findById(ByteBuffer id,
Condition c,
String... paths) |
DBDocument |
findById(ByteBuffer id,
org.ojai.FieldPath... paths) |
DBDocument |
findById(ByteBuffer id,
String... paths) |
void |
findById(OpListener listener,
ByteBuffer id) |
void |
findById(OpListener listener,
ByteBuffer id,
Condition c) |
void |
findById(OpListener listener,
ByteBuffer id,
Condition c,
org.ojai.FieldPath... paths) |
void |
findById(OpListener listener,
ByteBuffer id,
Condition c,
String... paths) |
void |
findById(OpListener listener,
ByteBuffer id,
org.ojai.FieldPath... paths) |
void |
findById(OpListener listener,
ByteBuffer id,
String... paths) |
void |
findById(OpListener listener,
String id)
Non-blocking read operation that gets called back on the listener object
on success (with the document) or failure (with the error).
|
void |
findById(OpListener listener,
String id,
Condition c)
Non-blocking read operation that gets called back on the listener object
on success or failure.
|
void |
findById(OpListener listener,
String id,
Condition c,
org.ojai.FieldPath... paths) |
void |
findById(OpListener listener,
String id,
Condition c,
String... paths) |
void |
findById(OpListener listener,
String id,
org.ojai.FieldPath... paths) |
void |
findById(OpListener listener,
String id,
String... paths)
Non-blocking read operation which gets called back on the listener object
on success or failure.
|
DBDocument |
findById(String id)
Reads the entire document for a given key.
|
DBDocument |
findById(String id,
Condition c)
Reads the row parts that match the condition and projects only the
field paths requested.
|
DBDocument |
findById(String id,
Condition c,
org.ojai.FieldPath... paths) |
DBDocument |
findById(String id,
Condition c,
String... paths) |
DBDocument |
findById(String id,
org.ojai.FieldPath... paths) |
DBDocument |
findById(String id,
String... paths)
Reads the row and projects of only the field paths requested.
|
DBDocument |
findById(org.ojai.Value id) |
void |
flush()
Flushes all the buffered update operations on the client for this table.
|
String |
getName()
Returns just the name of the table (not the full path).
|
org.ojai.Value |
getOption(Table.TableOption option) |
org.apache.hadoop.fs.Path |
getPath()
Returns the full path of the table.
|
TableDescriptor |
getTableDescriptor() |
TabletInfo |
getTabletInfo(ByteBuffer _id) |
TabletInfo |
getTabletInfo(String _id) |
TabletInfo[] |
getTabletInfos() |
TabletInfo[] |
getTabletInfos(Condition c) |
void |
increment(ByteBuffer id,
String field,
BigDecimal inc) |
void |
increment(ByteBuffer id,
String field,
byte inc) |
void |
increment(ByteBuffer id,
String field,
double inc) |
void |
increment(ByteBuffer id,
String field,
float inc) |
void |
increment(ByteBuffer id,
String field,
int inc) |
void |
increment(ByteBuffer id,
String field,
long inc) |
void |
increment(ByteBuffer id,
String field,
short inc) |
void |
increment(String id,
String field,
BigDecimal inc) |
void |
increment(String id,
String field,
byte inc)
Atomically applies an increment to a given field (in dot separated notation)
of the given row id.
|
void |
increment(String id,
String field,
double inc) |
void |
increment(String id,
String field,
float inc) |
void |
increment(String id,
String field,
int inc) |
void |
increment(String id,
String field,
long inc) |
void |
increment(String id,
String field,
short inc) |
void |
insert(ByteBuffer id,
org.ojai.Document r) |
void |
insert(org.ojai.Document r) |
void |
insert(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey) |
void |
insert(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
Inserts a set of documents represented by the document stream into the table.
|
void |
insert(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey) |
void |
insert(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey) |
void |
insert(org.ojai.Document r,
String fieldAsKey) |
void |
insert(String id,
org.ojai.Document r)
Inserts a row with the given rowkey.
|
void |
insertOrReplace(ByteBuffer id,
org.ojai.Document r) |
void |
insertOrReplace(org.ojai.Document r)
Inserts a new document in the table.
|
void |
insertOrReplace(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey) |
void |
insertOrReplace(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
Inserts a set of documents represented by the document stream into the table.
|
void |
insertOrReplace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey) |
void |
insertOrReplace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey) |
void |
insertOrReplace(org.ojai.Document r,
String fieldAsKey) |
void |
insertOrReplace(String id,
org.ojai.Document r) |
void |
replace(ByteBuffer id,
org.ojai.Document r) |
void |
replace(org.ojai.Document r) |
void |
replace(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey) |
void |
replace(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
Replaces a set of documents represented by the document stream into the table.
|
void |
replace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey) |
void |
replace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey) |
void |
replace(org.ojai.Document r,
String fieldAsKey) |
void |
replace(String id,
org.ojai.Document r)
Replaces a document in the table.
|
Table |
setOption(Table.TableOption option,
boolean value) |
void |
update(ByteBuffer id,
Mutation m) |
void |
update(String id,
Mutation m)
Applies a row mutation on the row identified by the row id.
|
String getName()
org.apache.hadoop.fs.Path getPath()
TableDescriptor getTableDescriptor()
Table setOption(Table.TableOption option, boolean value)
org.ojai.Value getOption(Table.TableOption option)
void flush()
throws DBException
DBExceptionDBDocument findById(String id) throws DBException
id - document idDBExceptionDBDocument findById(ByteBuffer id) throws DBException
DBExceptionDBDocument findById(org.ojai.Value id) throws DBException
DBExceptionDBDocument findById(String id, String... paths) throws DBException
id - document idpaths - list of fields that should be returned in the read documentDBExceptionDBDocument findById(String id, org.ojai.FieldPath... paths) throws DBException
DBExceptionDBDocument findById(ByteBuffer id, String... paths) throws DBException
DBExceptionDBDocument findById(ByteBuffer id, org.ojai.FieldPath... paths) throws DBException
DBExceptionDBDocument findById(String id, Condition c) throws DBException
id - document idpaths - list of fields that should be returned in the read documentc - condition to check for the queryDBExceptionDBDocument findById(ByteBuffer id, Condition c) throws DBException
DBExceptionDBDocument findById(String id, Condition c, String... paths) throws DBException
DBExceptionDBDocument findById(String id, Condition c, org.ojai.FieldPath... paths) throws DBException
DBExceptionDBDocument findById(ByteBuffer id, Condition c, String... paths) throws DBException
DBExceptionDBDocument findById(ByteBuffer id, Condition c, org.ojai.FieldPath... paths) throws DBException
DBExceptionvoid findById(OpListener listener, String id)
listener - object to be used as the callbackid - document idvoid findById(OpListener listener, ByteBuffer id)
void findById(OpListener listener, String id, String... paths)
listener - object to be used as the callbackid - document idpaths - list of fields that should be returned in the read documentvoid findById(OpListener listener, String id, org.ojai.FieldPath... paths)
void findById(OpListener listener, ByteBuffer id, String... paths)
void findById(OpListener listener, ByteBuffer id, org.ojai.FieldPath... paths)
void findById(OpListener listener, String id, Condition c)
listener - object to be used as the callbackid - document idc - condition to check for the querypaths - list of fields that should be returned in the read documentvoid findById(OpListener listener, ByteBuffer id, Condition c)
void findById(OpListener listener, String id, Condition c, String... paths)
void findById(OpListener listener, String id, Condition c, org.ojai.FieldPath... paths)
void findById(OpListener listener, ByteBuffer id, Condition c, String... paths)
void findById(OpListener listener, ByteBuffer id, Condition c, org.ojai.FieldPath... paths)
org.ojai.DocumentStream<DBDocument> find() throws DBException
DBExceptionorg.ojai.DocumentStream<DBDocument> find(String... paths) throws DBException
paths - list of fields that should be returned in the read documentDBExceptionorg.ojai.DocumentStream<DBDocument> find(org.ojai.FieldPath... paths) throws DBException
DBExceptionorg.ojai.DocumentStream<DBDocument> find(Condition c) throws DBException
c - condition to check for the queryTableNotFoundException - when a table does not exist from which to get any rowDBExceptionorg.ojai.DocumentStream<DBDocument> find(Condition c, String... paths) throws DBException
c - condition to check for the querypaths - list of fields that should be returned in the read documentDBExceptionorg.ojai.DocumentStream<DBDocument> find(Condition c, org.ojai.FieldPath... paths) throws DBException
DBExceptionvoid insertOrReplace(org.ojai.Document r)
throws DBException
r - JSON document as the new value for the given rowid - to be used as the key for the documentfieldAsKey - document's field to be used as the key when an id is not
passed in and the document doesn't have an "_id" fieldDBExceptionvoid insertOrReplace(String id, org.ojai.Document r) throws DBException
DBExceptionvoid insertOrReplace(ByteBuffer id, org.ojai.Document r) throws DBException
DBExceptionvoid insertOrReplace(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey)
throws DBException
DBExceptionvoid insertOrReplace(org.ojai.Document r,
String fieldAsKey)
throws DBException
DBExceptionvoid insertOrReplace(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
throws MultiOpException
rs - document streamfieldAsKey - field from each document whose value is to be used as
the document key for insertionMultiOpException - which has a list of write-failed documents and
their errors.void insertOrReplace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid insertOrReplace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid update(String id, Mutation m) throws DBException
id - document idm - mutation object specifying the operation on paths of a rowDBExceptionvoid update(ByteBuffer id, Mutation m) throws DBException
DBExceptionvoid delete(String id) throws DBException
id - document idr - JSON document to be deletedfieldAsKey - document's field to be used as the key when an id is not
passed in and a document doesn't have an "_id" fieldDBExceptionvoid delete(ByteBuffer id) throws DBException
DBExceptionvoid delete(org.ojai.Document r)
throws DBException
DBExceptionvoid delete(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey)
throws DBException
DBExceptionvoid delete(org.ojai.Document r,
String fieldAsKey)
throws DBException
DBExceptionvoid delete(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
throws MultiOpException
rs - document streamfieldAsKey - a field from each document whose value is to be used as
the document key for deletionMultiOpException - which has a list of write-failed documents and
their errorsvoid delete(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid delete(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid insert(String id, org.ojai.Document r) throws DBException
r - JSON document as the new value for the given rowid - to be used as the key for the documentfieldAsKey - document's field to be used as the key when the id is not
passed in and document doesn't have an "_id" fieldTableNotFoundException - when a table does not exist to add this rowAccessDeniedException - when user credentials are a mismatchReadOnlyException - when a table is not accepting writesOpNotPermittedException - when the server returned EPERMDocumentExistsException - when a document with id already exists in tableDBExceptionvoid insert(ByteBuffer id, org.ojai.Document r) throws DBException
DBExceptionvoid insert(org.ojai.Document r)
throws DBException
DBExceptionvoid insert(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey)
throws DBException
DBExceptionvoid insert(org.ojai.Document r,
String fieldAsKey)
throws DBException
DBExceptionvoid insert(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
throws MultiOpException
rs - document streamfieldAsKey - a field from each document whose value is to be used as
the document key for deletionMultiOpException - which has a list of write-failed documents and
their errorsvoid insert(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid insert(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid replace(String id, org.ojai.Document r) throws DBException
r - JSON document as the new value for the given rowid - to be used as the key for the documentfieldAsKey - document's field to be used as the key when an id is not
passed in and document doesn't have an "_id" fieldTableNotFoundException - when a table does not exist to which to add this rowAccessDeniedException - when user credentials are a mismatchReadOnlyException - when a table is not accepting writesOpNotPermittedException - when the server returns EPERMDocumentNotFoundException - when a document with the id does not exist in tableDBExceptionvoid replace(ByteBuffer id, org.ojai.Document r) throws DBException
DBExceptionvoid replace(org.ojai.Document r)
throws DBException
DBExceptionvoid replace(org.ojai.Document r,
org.ojai.FieldPath fieldAsKey)
throws DBException
DBExceptionvoid replace(org.ojai.Document r,
String fieldAsKey)
throws DBException
DBExceptionvoid replace(org.ojai.DocumentStream<? extends org.ojai.Document> rs)
throws MultiOpException
rs - document streamfieldAsKey - field from each document whose value is to be used as
the document key for deletionMultiOpException - which has list of write-failed documents and
their errorsvoid replace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
org.ojai.FieldPath fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid replace(org.ojai.DocumentStream<? extends org.ojai.Document> rs,
String fieldAsKey)
throws MultiOpException
MultiOpExceptionvoid increment(String id, String field, byte inc) throws DBException
id - document idfield - the field name in dot separated notationinc - increment to apply to a field. Can be positive or negativeDBExceptionvoid increment(ByteBuffer id, String field, byte inc) throws DBException
DBExceptionvoid increment(String id, String field, short inc) throws DBException
DBExceptionvoid increment(ByteBuffer id, String field, short inc) throws DBException
DBExceptionvoid increment(String id, String field, int inc) throws DBException
DBExceptionvoid increment(ByteBuffer id, String field, int inc) throws DBException
DBExceptionvoid increment(String id, String field, long inc) throws DBException
DBExceptionvoid increment(ByteBuffer id, String field, long inc) throws DBException
DBExceptionvoid increment(String id, String field, float inc) throws DBException
DBExceptionvoid increment(ByteBuffer id, String field, float inc) throws DBException
DBExceptionvoid increment(String id, String field, double inc) throws DBException
DBExceptionvoid increment(ByteBuffer id, String field, double inc) throws DBException
DBExceptionvoid increment(String id, String field, BigDecimal inc) throws DBException
DBExceptionvoid increment(ByteBuffer id, String field, BigDecimal inc) throws DBException
DBExceptionboolean checkAndMutate(String id, Condition condition, Mutation m) throws DBException
id - document idcondition - the condition to evaluate on the rowm - mutation to apply on the rowDBException - if the condition passes but the mutate failsboolean checkAndMutate(ByteBuffer id, Condition condition, Mutation m) throws DBException
DBExceptionboolean checkAndDelete(String id, Condition condition) throws DBException
id - document idcondition - condition to evaluate on the rowDBException - if the condition passes but the delete failsboolean checkAndDelete(ByteBuffer id, Condition condition) throws DBException
DBExceptionboolean checkAndReplace(String id, Condition condition, org.ojai.Document r) throws DBException
id - document idcondition - the condition to evaluate on the rowr - document to replaceDBException - if the condition passes but the replace failsboolean checkAndReplace(ByteBuffer id, Condition condition, org.ojai.Document r) throws DBException
DBExceptionTabletInfo getTabletInfo(String _id) throws DBException
_id - the document id for which the TabletInfo is requiredTabletInfo for the tablet of this table
to which the specified key belongsDBExceptionTabletInfo getTabletInfo(ByteBuffer _id) throws DBException
_id - the document id for which the TabletInfo is requiredTabletInfo for the tablet of this table
to which the specified key belongsDBExceptionTabletInfo[] getTabletInfos() throws DBException
TabletInfo for all current tablets of this tableDBExceptionTabletInfo[] getTabletInfos(Condition c) throws DBException
Condition - a condition object provided by the user or applicationTabletInfo for all current tablets of this table that
has a start and end key matching the range specified by the
condition objectDBExceptionvoid close()
throws DBException
AutoCloseable.close() to avoid declaring a checked exception.close in interface AutoCloseableDBExceptionCopyright © 2015 Mapr Technologies, Inc.. All rights reserved.