net.esper.eql.view
Class OutputProcessView

java.lang.Object
  extended by net.esper.view.ViewSupport
      extended by net.esper.eql.view.OutputProcessView
All Implemented Interfaces:
Iterable<EventBean>, JoinSetIndicator, JoinSetProcessor, EventCollection, View, Viewable

public class OutputProcessView
extends ViewSupport
implements JoinSetIndicator

A view that prepares output events, batching incoming events and invoking the result set processor as necessary.


Nested Class Summary
static class OutputProcessView.OutputProcessTransform
          Method to transform an event based on the select expression.
 
Field Summary
 
Fields inherited from class net.esper.view.ViewSupport
parent
 
Constructor Summary
OutputProcessView(ResultSetProcessor resultSetProcessor, int streamCount, OutputLimitSpec outputLimitSpec, StatementServiceContext statementContext)
          Ctor.
 
Method Summary
protected  void continueOutputProcessingJoin(boolean doOutput, boolean forceUpdate)
          Called once the output condition has been met.
protected  void continueOutputProcessingView(boolean doOutput, boolean forceUpdate)
          Called once the output condition has been met.
 EventType getEventType()
          Provides metadata information about the type of object the event collection contains.
 Iterator<EventBean> iterator()
          Allows iteration through all elements in this event collection.
 void process(Set<MultiKey<EventBean>> newEvents, Set<MultiKey<EventBean>> oldEvents)
          This process (update) method is for participation in a join.
 void update(EventBean[] newData, EventBean[] oldData)
          The update method is called if the view does not participate in a join.
 
Methods inherited from class net.esper.view.ViewSupport
addView, dumpChildViews, dumpUpdateParams, findDescendent, getParent, getViews, hasViews, removeView, setParent, updateChildren, updateChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputProcessView

public OutputProcessView(ResultSetProcessor resultSetProcessor,
                         int streamCount,
                         OutputLimitSpec outputLimitSpec,
                         StatementServiceContext statementContext)
Ctor.

Parameters:
resultSetProcessor - is processing the result set for publishing it out
streamCount - is the number of streams, indicates whether or not this view participates in a join
outputLimitSpec - is the specification for limiting output (the output condition and the result set processor)
statementContext - is the services the output condition may depend on
Method Detail

update

public void update(EventBean[] newData,
                   EventBean[] oldData)
The update method is called if the view does not participate in a join.

Specified by:
update in interface View
Parameters:
newData - - new events
oldData - - old events

process

public void process(Set<MultiKey<EventBean>> newEvents,
                    Set<MultiKey<EventBean>> oldEvents)
This process (update) method is for participation in a join.

Specified by:
process in interface JoinSetProcessor
Parameters:
newEvents - - new events
oldEvents - - old events

continueOutputProcessingView

protected void continueOutputProcessingView(boolean doOutput,
                                            boolean forceUpdate)
Called once the output condition has been met. Invokes the result set processor. Used for non-join event data.

Parameters:
doOutput - - true if the batched events should actually be output as well as processed, false if they should just be processed
forceUpdate - - true if output should be made even when no updating events have arrived

continueOutputProcessingJoin

protected void continueOutputProcessingJoin(boolean doOutput,
                                            boolean forceUpdate)
Called once the output condition has been met. Invokes the result set processor. Used for join event data.

Parameters:
doOutput - - true if the batched events should actually be output as well as processed, false if they should just be processed
forceUpdate - - true if output should be made even when no updating events have arrived

getEventType

public EventType getEventType()
Description copied from interface: EventCollection
Provides metadata information about the type of object the event collection contains.

Specified by:
getEventType in interface EventCollection
Returns:
metadata for the objects in the collection

iterator

public Iterator<EventBean> iterator()
Description copied from interface: EventCollection
Allows iteration through all elements in this event collection. The iterator will return the elements in the collection in their natural order, or, if there is no natural ordering, in some unpredictable order.

Specified by:
iterator in interface Iterable<EventBean>
Specified by:
iterator in interface EventCollection
Returns:
an iterator which will go through all current elements in the collection.