public interface TableAccessor
Operator.getTableAccessor(String)
.Modifier and Type | Field and Description |
---|---|
static String |
QUERY_ARGUMENT_QUALIFIER |
Modifier and Type | Method and Description |
---|---|
Tuple |
createRow() |
Tuple |
delete(Tuple pkey)
Delete a row in the table based on primary key.
|
List<Schema.Field> |
getPrimaryKeyFields()
The fields from the schema which make up the primary key.
|
Schema |
getSchema()
The schema for rows in this table.
|
void |
insert(Tuple row)
Insert a new row into the table.
|
PreparedQuery |
prepare(String predicate,
Schema args)
Prepare an index-accessing query.
|
Tuple |
readPrimary(Tuple pkey)
Read a row from the table by primary key.
|
Tuple |
replace(Tuple row)
Replace a row in the table, or insert if there is no existing row with matching primary key.
|
long |
size(boolean slowAndAccurate)
Return the number of rows in the table
|
void |
truncate()
Truncate the table, by removing all rows
|
static final String QUERY_ARGUMENT_QUALIFIER
Schema getSchema()
List<Schema.Field> getPrimaryKeyFields()
Tuple createRow()
Tuple readPrimary(Tuple pkey) throws StreamBaseException
pkey
- row object with primary key material populated.StreamBaseException
- if the key is invalidPreparedQuery prepare(String predicate, Schema args) throws StreamBaseException
predicate
- Predicate which may reference table fields and fields present in args
. Table fields may be referenced
unqualified (as defined in the table), args
fields may be referenced by the "input" prefix.args
- Schema for tuples that will be an argument to this prepared query. May be null if not needed.StreamBaseException
- if the predicate fails to parse or there is some other issue with preparing the queryPreparedQuery
void insert(Tuple row) throws StreamBaseException
row
- Row values to insert into the able. Should not collide with existing row.StreamBaseException
- If the table is read only or if the row collides with another row.Tuple replace(Tuple row) throws StreamBaseException
row
- Row to replace with.StreamBaseException
- if the table is read onlyTuple delete(Tuple pkey) throws StreamBaseException
pkey
- Row object to use for primary key data.StreamBaseException
- if the table is read onlyvoid truncate() throws StreamBaseException
StreamBaseException
long size(boolean slowAndAccurate)
slowAndAccurate
- For some table implementations accurate results can be expensive.
For in-memory query tables, exact results are inexpensive and always returned.