public interface Table
extends java.lang.AutoCloseable
RowSet
for
iterating over some or all of the data in the table.
The call that creates a table is
Session.openTable
.
A program that creates a table must explicitly call
Table.close
to reclaim its resources.
This interface is implemented internally. Applications do not implement this interface.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close a table.
|
Row |
createRow()
Create an empty row object.
|
RowSet |
createRowSet(java.lang.String filter,
java.util.Properties props)
Create a RowSet to selectively get rows in the table.
|
TableListener |
createTableListener(java.lang.String filter,
TableEventHandler eventHandler)
Create a TableListener
|
void |
delete(Row key)
Delete a row from a table.
|
Row |
get(Row key)
Get a row from a table.
|
java.lang.String |
getName()
Get the name of the table.
|
Session |
getSession()
Get the session object that was used to create the table.
|
void |
put(Row keyValue)
Put a row into a table.
|
Row createRow() throws DataGridException
This function returns an empty row object. The application can set columns
in the empty row object and use the object as a keyValue for Table.createRow
or as a key for Table.get
or Table.delete
.
Row
objectDataGridException
- in case of failuresvoid put(Row keyValue) throws DataGridException
The contents of the row contain the information to be placed into the designated table. This must include the values for the columns that make up primary key. Values for the other columns are optional.
keyValue
- The row to be placed in the table.DataGridException
- in case of failuresRow get(Row key) throws DataGridException
Using the columns set in the key, this call fetches the row from the table and returns it.
Note: Do not use a row object obtained from one table for operations in a different table. The schemas of the tables may not be compatible and the operations may fail.
Any row object obtained from this function must be released by calling Row.destroy
key
- The key information used to fetch the row.Row
objectDataGridException
- in case of failuresRowSet createRowSet(java.lang.String filter, java.util.Properties props) throws DataGridException
This call creates an RowSet object that contains an iterator which returns rows matching the filter.
filter
- A string containing a valid query or null to include all the rows in the tableprops
- Optional, null to omit
RowSet
DataGridException
- in case of failuresvoid delete(Row key) throws DataGridException
Using the columns in the key, this call deletes the row from the table.
key
- The key used to identify row in the table.DataGridException
- in case of failuresjava.lang.String getName() throws DataGridException
DataGridException
- in case of failuresSession getSession() throws DataGridException
Session
DataGridException
- in case of failuresTableListener createTableListener(java.lang.String filter, TableEventHandler eventHandler) throws DataGridException
filter
- The filter string to for the listener to useeventHandler
- the object to deliver events to (see TableEventHandler
)TableListener
DataGridException
- in case of failuresvoid close() throws DataGridException
Release all resources associated with this table object.
Note that pending operations on this table, e.g., transactional puts, gets or deletes, are marked as "rollback only" if this table is closed before the operations are committed.
close
in interface java.lang.AutoCloseable
DataGridException
- in case of failures