public final class SnapshotQueryListener extends Object implements SnapshotResult, QueryListener
QueryListener that provides a pull based iterator pattern for iterating over snapshot queries.
This should be used with snapshot queries only. Snapshots that hit the row limit are ended without any special notification.| Constructor and Description |
|---|
SnapshotQueryListener() |
SnapshotQueryListener(int dataQueueCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
closes any resource associated with the snapshot result
|
void |
deleteBegin(BeginDeleteEvent event)
Event to indicate the start of delete query.
|
void |
deleteEnd(EndDeleteEvent event)
Event to indicate the delete query is complete.
|
void |
exceptionRaised(QueryExceptionEvent event)
Event when an exception occurs during the query.
|
List<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.
|
void |
queryClosed(QueryClosedEvent event)
Event when a query being listened to is closed.
|
void |
setQuery(Query queryImpl) |
void |
snapshotBegin(BeginSnapshotEvent event)
Event to indicate the start of the result snapshot.
|
void |
snapshotEnd(EndSnapshotEvent event)
Event to indicate the query snapshot is complete.
|
void |
tupleAdded(TupleAddedEvent event)
Event when a new tuple is added to the result.
|
void |
tupleRemoved(TupleRemovedEvent event)
Event when an existing tuple is removed from the result.
|
void |
tupleUpdated(TupleUpdatedEvent event)
Event when an existing tuple in the result is updated.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggMarkBegin, aggMarkEndpublic SnapshotQueryListener()
public SnapshotQueryListener(int dataQueueCapacity)
public List<Schema.Field> getFields() throws LiveViewException
getFields in interface SnapshotResultLiveViewException - if exception occurs on the Querypublic boolean hasNext()
throws LiveViewException
hasNext in interface SnapshotResultLiveViewExceptionpublic Tuple next() throws LiveViewException
next in interface SnapshotResultLiveViewException - if exception occurs on the Querypublic void tupleAdded(TupleAddedEvent event)
tupleAdded in interface QueryListenerevent - add eventpublic void tupleUpdated(TupleUpdatedEvent event)
tupleUpdated in interface QueryListenerevent - update eventpublic void tupleRemoved(TupleRemovedEvent event)
tupleRemoved in interface QueryListenerevent - remove eventpublic void snapshotBegin(BeginSnapshotEvent event)
snapshotBegin in interface QueryListenerevent - snapshot beginpublic void snapshotEnd(EndSnapshotEvent event)
snapshotEnd in interface QueryListenerevent - snapshot endpublic void exceptionRaised(QueryExceptionEvent event)
exceptionRaised in interface QueryListenerevent - exception eventpublic void queryClosed(QueryClosedEvent event)
queryClosed in interface QueryListenerevent - query closed eventpublic void setQuery(Query queryImpl)
public void close()
SnapshotResultclose in interface SnapshotResultclose in interface Closeableclose in interface AutoCloseablepublic void deleteBegin(BeginDeleteEvent event)
QueryListenerdeleteBegin in interface QueryListenerevent - delete beginpublic void deleteEnd(EndDeleteEvent event)
QueryListenerdeleteEnd in interface QueryListenerevent - delete endCopyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.