com.espertech.esper.event.vaevent
Class VAEVariantProcessor

java.lang.Object
  extended by com.espertech.esper.event.vaevent.VAEVariantProcessor
All Implemented Interfaces:
ValueAddEventProcessor

public class VAEVariantProcessor
extends Object
implements ValueAddEventProcessor

Represents a variant event stream, allowing events of disparate event types to be treated polymophically.


Constructor Summary
VAEVariantProcessor(VariantSpec variantSpec)
          Ctor.
 
Method Summary
 Collection<EventBean> getSnapshot(EPStatementHandle createWindowStmtHandle, Viewable parent)
          Handle iteration over revision event contents.
 EventBean getValueAddEventBean(EventBean event)
          For use in executing an insert-into, wraps the given event applying the revision event type, but not yet computing a new revision.
 EventType getValueAddEventType()
          Returns the event type that this revision processor generates.
 void onUpdate(EventBean[] newData, EventBean[] oldData, NamedWindowRootView namedWindowRootView, NamedWindowIndexRepository indexRepository)
          Upon new events arriving into a named window (new data), and upon events being deleted via on-delete (old data), update child views of the root view and apply to index repository as required (fast deletion).
 void removeOldData(EventBean[] oldData, NamedWindowIndexRepository indexRepository)
          Called each time a data window posts a remove stream event, to indicate that a data window remove an event as it expired according to a specified expiration policy.
 void validateEventType(EventType eventType)
          For use in checking insert-into statements, validates that the given type is eligible for revision event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VAEVariantProcessor

public VAEVariantProcessor(VariantSpec variantSpec)
Ctor.

Parameters:
variantSpec - specifies how to handle the disparate events
Method Detail

getValueAddEventType

public EventType getValueAddEventType()
Description copied from interface: ValueAddEventProcessor
Returns the event type that this revision processor generates.

Specified by:
getValueAddEventType in interface ValueAddEventProcessor
Returns:
event type

validateEventType

public void validateEventType(EventType eventType)
                       throws ExprValidationException
Description copied from interface: ValueAddEventProcessor
For use in checking insert-into statements, validates that the given type is eligible for revision event.

Specified by:
validateEventType in interface ValueAddEventProcessor
Parameters:
eventType - the type of the event participating in revision event type (or not)
Throws:
ExprValidationException - if the validation fails

getValueAddEventBean

public EventBean getValueAddEventBean(EventBean event)
Description copied from interface: ValueAddEventProcessor
For use in executing an insert-into, wraps the given event applying the revision event type, but not yet computing a new revision.

Specified by:
getValueAddEventBean in interface ValueAddEventProcessor
Parameters:
event - to wrap
Returns:
revision event bean

onUpdate

public void onUpdate(EventBean[] newData,
                     EventBean[] oldData,
                     NamedWindowRootView namedWindowRootView,
                     NamedWindowIndexRepository indexRepository)
Description copied from interface: ValueAddEventProcessor
Upon new events arriving into a named window (new data), and upon events being deleted via on-delete (old data), update child views of the root view and apply to index repository as required (fast deletion).

Specified by:
onUpdate in interface ValueAddEventProcessor
Parameters:
newData - new events
oldData - remove stream
namedWindowRootView - the root view
indexRepository - delete and select indexes

getSnapshot

public Collection<EventBean> getSnapshot(EPStatementHandle createWindowStmtHandle,
                                         Viewable parent)
Description copied from interface: ValueAddEventProcessor
Handle iteration over revision event contents.

Specified by:
getSnapshot in interface ValueAddEventProcessor
Parameters:
createWindowStmtHandle - statement handle for safe iteration
parent - the provider of data
Returns:
collection to iterate

removeOldData

public void removeOldData(EventBean[] oldData,
                          NamedWindowIndexRepository indexRepository)
Description copied from interface: ValueAddEventProcessor
Called each time a data window posts a remove stream event, to indicate that a data window remove an event as it expired according to a specified expiration policy.

Specified by:
removeOldData in interface ValueAddEventProcessor
Parameters:
oldData - to remove
indexRepository - the indexes to update

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com