com.espertech.esper.core.service
Interface ExpressionResultCacheService

All Known Implementing Classes:
ExpressionResultCacheServiceAgentInstance, ExpressionResultCacheServiceThreadlocal

public interface ExpressionResultCacheService

Provides 3 caches on the statement-level:

(A) On the level of indexed event properties: Properties that are wrapped in EventBean instances, such as for Enumeration Methods, get wrapped only once for the same event. The cache is keyed by property-name and EventBean reference and maintains a Collection.

(B) On the level of enumeration method: If a enumeration method expression is invoked within another enumeration method expression (not counting expression declarations), for example "source.where(a => source.minBy(b => b.x))" the "source.minBy(b => b.x)" is not dependent on any other lambda so the result gets cached. The cache is keyed by the enumeration-method-node as an IdentityHashMap and verified by a context stack (Long[]) that is built in nested evaluation calls.

(C) On the level of expression declaration: a) for non-enum evaluation and for enum-evaluation a separate cache b) The cache is keyed by the prototype-node as an IdentityHashMap and verified by a events-per-stream (EventBean[]) that is maintained or rewritten.


Method Summary
 ExpressionResultCacheEntry<EventBean[],java.util.Collection<EventBean>> getDeclaredExpressionLastColl(java.lang.Object node, EventBean[] eventsPerStream)
           
 ExpressionResultCacheEntry<EventBean[],java.lang.Object> getDeclaredExpressionLastValue(java.lang.Object node, EventBean[] eventsPerStream)
           
 ExpressionResultCacheEntry<java.lang.Long[],java.lang.Object> getEnumerationMethodLastValue(java.lang.Object node)
           
 ExpressionResultCacheEntry<EventBean,java.util.Collection<EventBean>> getPropertyColl(java.lang.String propertyNameFullyQualified, EventBean reference)
           
 java.util.Deque<ExpressionResultCacheStackEntry> getStack()
           
 void popContext()
           
 boolean popLambda()
           
 void pushContext(long contextNumber)
           
 void pushStack(ExpressionResultCacheStackEntry lambda)
           
 void saveDeclaredExpressionLastColl(java.lang.Object node, EventBean[] eventsPerStream, java.util.Collection<EventBean> result)
           
 void saveDeclaredExpressionLastValue(java.lang.Object node, EventBean[] eventsPerStream, java.lang.Object result)
           
 void saveEnumerationMethodLastValue(java.lang.Object node, java.lang.Object result)
           
 void savePropertyColl(java.lang.String propertyNameFullyQualified, EventBean reference, java.util.Collection<EventBean> events)
           
 

Method Detail

pushStack

void pushStack(ExpressionResultCacheStackEntry lambda)

popLambda

boolean popLambda()

getStack

java.util.Deque<ExpressionResultCacheStackEntry> getStack()

getPropertyColl

ExpressionResultCacheEntry<EventBean,java.util.Collection<EventBean>> getPropertyColl(java.lang.String propertyNameFullyQualified,
                                                                                      EventBean reference)

savePropertyColl

void savePropertyColl(java.lang.String propertyNameFullyQualified,
                      EventBean reference,
                      java.util.Collection<EventBean> events)

getDeclaredExpressionLastValue

ExpressionResultCacheEntry<EventBean[],java.lang.Object> getDeclaredExpressionLastValue(java.lang.Object node,
                                                                                        EventBean[] eventsPerStream)

saveDeclaredExpressionLastValue

void saveDeclaredExpressionLastValue(java.lang.Object node,
                                     EventBean[] eventsPerStream,
                                     java.lang.Object result)

getDeclaredExpressionLastColl

ExpressionResultCacheEntry<EventBean[],java.util.Collection<EventBean>> getDeclaredExpressionLastColl(java.lang.Object node,
                                                                                                      EventBean[] eventsPerStream)

saveDeclaredExpressionLastColl

void saveDeclaredExpressionLastColl(java.lang.Object node,
                                    EventBean[] eventsPerStream,
                                    java.util.Collection<EventBean> result)

getEnumerationMethodLastValue

ExpressionResultCacheEntry<java.lang.Long[],java.lang.Object> getEnumerationMethodLastValue(java.lang.Object node)

saveEnumerationMethodLastValue

void saveEnumerationMethodLastValue(java.lang.Object node,
                                    java.lang.Object result)

pushContext

void pushContext(long contextNumber)

popContext

void popContext()

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com