Package com.streambase.liveview.client
Interface SnapshotResult
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
DeleteQueryListener
,SnapshotQueryListener
public interface SnapshotResult extends Closeable
A blocking iterator pattern for retrieving snapshot only results.- Since:
- 2.0 SnapshotResult extends Iterable<Tuple>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
closes any resource associated with the snapshot resultList<Schema.Field>
getFields()
Retrieves the fields describing the tuples that will be returned.boolean
hasNext()
See if there are more tuples to retrieve.Tuple
next()
Retrieves the next tuple in the result.
-
-
-
Method Detail
-
hasNext
boolean hasNext() throws LiveViewException
See if there are more tuples to retrieve. If there are not currently any Tuples waiting to be read, this will block until either the next Tuple or the Snapshot end arrives.- Returns:
- true if more tuples exist in result
- Throws:
LiveViewException
-
next
Tuple next() throws LiveViewException, NoSuchElementException
Retrieves the next tuple in the result. If there are not currently any Tuples waiting to be read, this will block until either the next Tuple or the Snapshot end arrives.- Returns:
- the next tuple
- Throws:
LiveViewException
- if exception occurs on the QueryNoSuchElementException
- if no more tuples exist to retrieve
-
getFields
List<Schema.Field> getFields() throws LiveViewException
Retrieves the fields describing the tuples that will be returned.- Returns:
- the fields describing the tuples
- Throws:
LiveViewException
- if exception occurs on the Query
-
close
void close()
closes any resource associated with the snapshot result- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-