public interface RowSet extends java.lang.Iterable<Row>, java.lang.AutoCloseable
A RowSet becomes invalid when the table that created it becomes invalid.
To create a DataGrid iterator object, call
Table.createRowSet
.
A program that creates a RowSet must explicitly call
RowSet.close
to reclaim its resources.
This interface is implemented internally. Applications do not implement this interface.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TIBDG_ITERATOR_CONSISTENCY_GLOBAL_SNAPSHOT
Global snapshot consistency; property value constant.
|
static java.lang.String |
TIBDG_ITERATOR_CONSISTENCY_SNAPSHOT
Snapshot consistency; property value constant.
|
static java.lang.String |
TIBDG_ITERATOR_PROPERTY_DOUBLE_FETCH_TIMEOUT
Property name for the iterator fetch timeout; double.
|
static java.lang.String |
TIBDG_ITERATOR_PROPERTY_LONG_PREFETCH
Property name for RowSet prefetch; long.
|
static java.lang.String |
TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY
Property name for RowSet consistency; string.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close a RowSet object.
|
java.util.Iterator<Row> |
iterator()
Returns the
Iterator for this RowSet. |
static final java.lang.String TIBDG_ITERATOR_PROPERTY_LONG_PREFETCH
When creating a RowSet,
supply this property to table.createRowSet
.
Its value determines
the maximum number of rows that will be prefetched from the data grid.
If not specified or a value less than or equal to 0 is specified, a default prefetch of 256 is used.
static final java.lang.String TIBDG_ITERATOR_CONSISTENCY_GLOBAL_SNAPSHOT
RowSet.TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY
in the method Table.createRowSet
.
This value will cause a global snapshot to be taken across all
nodes in the grid, which will then be used when iterating through the results.
A global snapshot will ensure no partially committed transactions that span multiple nodes
are observed in the iterator results at the cost of needing to coordinate the global
snapshot when creating the iterator.static final java.lang.String TIBDG_ITERATOR_CONSISTENCY_SNAPSHOT
RowSet.TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY
in the method Table.createRowSet
.
This value will cause a snapshot to be taken at each node independently,
which will then be used when iterating through the results.
A snapshot taken at each node does not require waiting to create a global
snapshot across the entire grid when creating the iterator but could result
in a partially committed transaction that spanned multiple nodes being
observed in the results.static final java.lang.String TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY
When creating a RowSet,
supply this property to table.createRowSet
.
Its value determines the consistency of the iterator and
whether or not a global snapshot needs to be taken.
RowSet.TIBDG_ITERATOR_CONSISTENCY_GLOBAL_SNAPSHOT
RowSet.TIBDG_ITERATOR_CONSISTENCY_SNAPSHOT
static final java.lang.String TIBDG_ITERATOR_PROPERTY_DOUBLE_FETCH_TIMEOUT
This value determines how long (in seconds) the application will wait for the next batch
of rows before timing out. If this property is not supplied the current timeout for the
parent Connection is used. If a value of zero is supplied then there will be no limit to
how long the application will wait.
When creating an iterator, supply this property to Table.createRowSet
.
java.util.Iterator<Row> iterator()
Iterator
for this RowSet. Each RowSet has only one Iterator so
repeated calls to this method will always return the same Iterator. If you need to
restart the iteration you must create a new RowSet.iterator
in interface java.lang.Iterable<Row>
void close() throws DataGridException
Releases all resources associated with this RowSet object.
close
in interface java.lang.AutoCloseable
DataGridException
- in case of failures