Class AbstractBatchedQueryListener

    • Constructor Detail

      • AbstractBatchedQueryListener

        public AbstractBatchedQueryListener()
        Constructs a listener with quarter-second interval and the maximum batch size.
      • AbstractBatchedQueryListener

        public AbstractBatchedQueryListener​(long interval,
                                            TimeUnit unit,
                                            boolean collapseEvents)
        Constructor to set an interval for receiving batched results.
        Parameters:
        interval - notification interval
        unit - notification interval unit
        collapseEvents - whether or not to collapsed multiple updates in the same batch
      • AbstractBatchedQueryListener

        public AbstractBatchedQueryListener​(long interval,
                                            TimeUnit unit,
                                            boolean collapseEvents,
                                            int maxBatchSize)
        Constructor to set an interval for receiving batched results.
        Parameters:
        interval - notification interval
        unit - notification interval unit
        collapseEvents - whether or not to collapsed multiple updates in the same batch
        maxBatchSize - max batch size before notification
    • Method Detail

      • snapshot

        public abstract void snapshot​(List<TupleAddedEvent> eventList,
                                      boolean complete)
        This batch method is called one or more times for snapshot results.
        Parameters:
        eventList - the added tuples
        complete - indicator whether the snapshot is complete or not
      • update

        public abstract void update​(List<AbstractTupleEvent> eventList)
        This batch method is called zero or more times for continuous updates.
        Parameters:
        eventList - the continuous tuple events
      • snapshotBegin

        public void snapshotBegin​(BeginSnapshotEvent event)
        Event to indicate the start of the result snapshot. This is the first method called when a query starts returning results, but this method is also called to indicate a reset (a complete restart of the query.)

        This method may be extended, ensuring a super call is made.

        Specified by:
        snapshotBegin in interface QueryListener
        Overrides:
        snapshotBegin in class AbstractQueryListener
        Parameters:
        event - snapshot begin
      • close

        public void close()
        Closes the thread that calls the batch methods periodically
      • finalize

        public void finalize()
        Overrides:
        finalize in class Object