Class PropertyCompositeEventTableImpl
java.lang.Object
com.espertech.esper.common.internal.epl.index.composite.PropertyCompositeEventTable
com.espertech.esper.common.internal.epl.index.composite.PropertyCompositeEventTableImpl
- All Implemented Interfaces:
EventTable
,Iterable<EventBean>
For use when the index comprises of either two or more ranges or a unique key in combination with a range.
Organizes into a TreeMap<key, TreeMap<key2, Set<EventBean>>, for short. The top level can also be just Map<HashableMultiKey, TreeMap...>.
Expected at least either (A) one key and one range or (B) zero keys and 2 ranges.
An alternative implementatation could have been based on "TreeMap<ComparableMultiKey, Set<EventBean>>>", however the following implication arrive - not applicable for range-only lookups (since there the key can be the value itself - not applicable for multiple nested range as ordering not nested - each add/remove and lookup would also need to construct a key object.
-
Field Summary
Modifier and TypeFieldDescriptionIndex table (sorted and/or keyed, always nested).Fields inherited from class com.espertech.esper.common.internal.epl.index.composite.PropertyCompositeEventTable
factory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(EventBean theEvent, ExprEvaluatorContext exprEvaluatorContext) Add event to table.void
clear()
Clear out index.void
destroy()
Destroy index.getIndex()
Return the index object itself, or an object-array for multiple index structures.int
If the index retains events using some key-based organization this returns the number of keys, and may return -1 to indicate that either the number of keys is not available or costly to obtain.boolean
isEmpty()
Returns true if the index is definitely empty, or false if is not definitely empty but we can not certain.iterator()
Returns an iterator over events in the table.void
remove
(EventBean theEvent, ExprEvaluatorContext exprEvaluatorContext) Remove event from table.Methods inherited from class com.espertech.esper.common.internal.epl.index.composite.PropertyCompositeEventTable
add, addRemove, getMultiKeyTransform, getNumberOfEvents, getOptKeyCoercedTypes, getOptRangeCoercedTypes, getOrganization, remove, toQueryPlan, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
index
Index table (sorted and/or keyed, always nested).
-
-
Constructor Details
-
PropertyCompositeEventTableImpl
-
-
Method Details
-
getIndex
Description copied from interface:EventTable
Return the index object itself, or an object-array for multiple index structures.May return null if the information is not readily available, i.e. externally maintained index
- Specified by:
getIndex
in interfaceEventTable
- Specified by:
getIndex
in classPropertyCompositeEventTable
- Returns:
- index object
-
add
Description copied from interface:EventTable
Add event to table.- Parameters:
theEvent
- to addexprEvaluatorContext
- evaluator context
-
remove
Description copied from interface:EventTable
Remove event from table.- Parameters:
theEvent
- to removeexprEvaluatorContext
- evaluator context
-
isEmpty
public boolean isEmpty()Description copied from interface:EventTable
Returns true if the index is definitely empty, or false if is not definitely empty but we can not certain.- Returns:
- true for definitely empty index, false for there-may-be-rows and please-check-by-iterating
-
iterator
Description copied from interface:EventTable
Returns an iterator over events in the table. Not required to be implemented for all indexes. Full table scans and providers that have easy access to an iterator may implement.- Returns:
- table iterator
-
clear
public void clear()Description copied from interface:EventTable
Clear out index. -
destroy
public void destroy()Description copied from interface:EventTable
Destroy index. -
getNumKeys
public int getNumKeys()Description copied from interface:EventTable
If the index retains events using some key-based organization this returns the number of keys, and may return -1 to indicate that either the number of keys is not available or costly to obtain.The number returned can be an estimate and may not be accurate.
- Returns:
- number of keys
-
getProviderClass
-
getPostProcessor
- Specified by:
getPostProcessor
in classPropertyCompositeEventTable
-