public abstract class AbstractBatchedQueryListener extends AbstractQueryListener
QueryListener that batches up multiple events
and sends them to the concrete implementation.
Concrete implementations must implement the abstract AbstractBatchedQueryListener.snapshot(List, boolean) and AbstractBatchedQueryListener.update(List) methods
to receive batched up events.
| Constructor and Description |
|---|
AbstractBatchedQueryListener()
Constructs a listener with quarter-second interval and the maximum batch size.
|
AbstractBatchedQueryListener(long interval,
TimeUnit unit,
boolean collapseEvents)
Constructor to set an interval for receiving batched results.
|
AbstractBatchedQueryListener(long interval,
TimeUnit unit,
boolean collapseEvents,
int maxBatchSize)
Constructor to set an interval for receiving batched results.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the thread that calls the batch methods periodically
|
void |
exceptionRaised(QueryExceptionEvent event)
Event when an exception occurs during the query.
|
void |
finalize() |
void |
queryClosed(QueryClosedEvent event)
Event when a query being listened to is closed.
|
abstract void |
snapshot(List<TupleAddedEvent> eventList,
boolean complete)
This batch method is called one or more times for snapshot results.
|
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.
|
abstract void |
update(List<AbstractTupleEvent> eventList)
This batch method is called zero or more times for continuous updates.
|
deleteBegin, deleteEndclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaggMarkBegin, aggMarkEndpublic AbstractBatchedQueryListener()
public AbstractBatchedQueryListener(long interval,
TimeUnit unit,
boolean collapseEvents)
interval - notification intervalunit - notification interval unitcollapseEvents - whether or not to collapsed multiple updates in the same batchpublic AbstractBatchedQueryListener(long interval,
TimeUnit unit,
boolean collapseEvents,
int maxBatchSize)
interval - notification intervalunit - notification interval unitcollapseEvents - whether or not to collapsed multiple updates in the same batchmaxBatchSize - max batch size before notificationpublic abstract void snapshot(List<TupleAddedEvent> eventList, boolean complete)
eventList - the added tuplescomplete - indicator whether the snapshot is complete or notpublic abstract void update(List<AbstractTupleEvent> eventList)
eventList - the continuous tuple eventspublic void tupleRemoved(TupleRemovedEvent event)
This method may be extended, ensuring a super call is made.
tupleRemoved in interface QueryListenertupleRemoved in class AbstractQueryListenerevent - remove eventpublic void tupleAdded(TupleAddedEvent event)
This method may be extended, ensuring a super call is made.
tupleAdded in interface QueryListenertupleAdded in class AbstractQueryListenerevent - add eventpublic void tupleUpdated(TupleUpdatedEvent event)
This method may be extended, ensuring a super call is made.
tupleUpdated in interface QueryListenertupleUpdated in class AbstractQueryListenerevent - update eventpublic void snapshotBegin(BeginSnapshotEvent event)
This method may be extended, ensuring a super call is made.
snapshotBegin in interface QueryListenersnapshotBegin in class AbstractQueryListenerevent - snapshot beginpublic void snapshotEnd(EndSnapshotEvent event)
This method may be extended, ensuring a super call is made.
snapshotEnd in interface QueryListenersnapshotEnd in class AbstractQueryListenerevent - snapshot endpublic void exceptionRaised(QueryExceptionEvent event)
This method may be extended, ensuring a super call is made.
exceptionRaised in interface QueryListenerexceptionRaised in class AbstractQueryListenerevent - exception eventpublic void queryClosed(QueryClosedEvent event)
This method may be extended, ensuring a super call is made.
queryClosed in interface QueryListenerqueryClosed in class AbstractQueryListenerevent - query closed eventpublic void close()
Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.