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:
java.lang.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.


Field Summary
 
Fields inherited from class net.esper.view.ViewSupport
parent
 
Constructor Summary
OutputProcessView(ResultSetProcessor resultSetProcessor, int streamCount, OutputLimitSpec outputLimitSpec, ViewServiceContext viewContext)
          Ctor.
 
Method Summary
 java.lang.String attachesTo(Viewable parentViewable)
          Return null if the view will accept being attached to a particular object.
protected  void continueOutputProcessingJoin(boolean forceUpdate)
          Called once the output condition has been met.
protected  void continueOutputProcessingView(boolean forceUpdate)
          Called once the output condition has been met.
 EventType getEventType()
          Provides metadata information about the type of object the event collection contains.
 java.util.Iterator<EventBean> iterator()
          Allows iteration through all elements in this event collection.
 void process(java.util.Set<MultiKey<EventBean>> newEvents, java.util.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, shallowCopyView, 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,
                         ViewServiceContext viewContext)
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)
viewContext - 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(java.util.Set<MultiKey<EventBean>> newEvents,
                    java.util.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 forceUpdate)
Called once the output condition has been met. Invokes the result set processor. Used for non-join event data.

Parameters:
forceUpdate - is a flag to indicate that even if there is no data, child views should still be updated.

continueOutputProcessingJoin

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

Parameters:
forceUpdate - is a flag to indicate that even if there is no data, child views should still be updated.

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 java.util.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 java.lang.Iterable<EventBean>
Specified by:
iterator in interface EventCollection
Returns:
an iterator which will go through all current elements in the collection.

attachesTo

public java.lang.String attachesTo(Viewable parentViewable)
Description copied from interface: View
Return null if the view will accept being attached to a particular object.

Specified by:
attachesTo in interface View
Parameters:
parentViewable - is the potential parent for this view
Returns:
null if this view can successfully attach to the parent, an error message if it cannot.