com.tibco.datagrid

## Interface RowSet

- All Superinterfaces:
    java.lang.AutoCloseable, java.lang.Iterable<Row>

      public interface RowSet
      extends java.lang.Iterable<Row>, java.lang.AutoCloseable

  A RowSet object is used to iterate over some or all of the rows in a Table

  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.

- - ### Field Summary

    Fields
    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.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close a RowSet object.
    `java.util.Iterator<Row>` | `iterator()` Returns the `Iterator` for this RowSet.

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### TIBDG_ITERATOR_PROPERTY_LONG_PREFETCH

          static final java.lang.String TIBDG_ITERATOR_PROPERTY_LONG_PREFETCH

      Property name for RowSet prefetch; long.

      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.

      See Also:
        Constant Field Values

    - #### TIBDG_ITERATOR_CONSISTENCY_GLOBAL_SNAPSHOT

          static final java.lang.String TIBDG_ITERATOR_CONSISTENCY_GLOBAL_SNAPSHOT

      Global snapshot consistency; property value constant. This constant is one possible value of the property `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.
      See Also:
        Constant Field Values

    - #### TIBDG_ITERATOR_CONSISTENCY_SNAPSHOT

          static final java.lang.String TIBDG_ITERATOR_CONSISTENCY_SNAPSHOT

      Snapshot consistency; property value constant. This constant is one possible value of the property `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.
      See Also:
        Constant Field Values

    - #### TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY

          static final java.lang.String TIBDG_ITERATOR_PROPERTY_STRING_CONSISTENCY

      Property name for RowSet consistency; string.

      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`

      See Also:
        Constant Field Values

    - #### TIBDG_ITERATOR_PROPERTY_DOUBLE_FETCH_TIMEOUT

          static final java.lang.String TIBDG_ITERATOR_PROPERTY_DOUBLE_FETCH_TIMEOUT

      Property name for the iterator fetch timeout; double.

      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. The use of an unlimited timeout is NOT advised in production environments because there are certain error situations that can result in the application waiting forever for a response that will not come. An unlimited timeout could be used in testing/development to discover how long a given iterator takes to execute so that a meaningful timeout can be set in production. When creating an iterator, supply this property to `Table.createRowSet`.

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### iterator

          java.util.Iterator<Row> iterator()

      Returns the `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.
      Specified by:
        `iterator` in interface `java.lang.Iterable<Row>`
      Returns:
        Iterator

    - #### close

          void close()
              throws DataGridException

      Close a RowSet object.

      Releases all resources associated with this RowSet object.

      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `DataGridException` - in case of failures