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>

public class PropertyCompositeEventTableImpl extends PropertyCompositeEventTable
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 Details

    • index

      protected final Map<Object,Object> index
      Index table (sorted and/or keyed, always nested).
  • Constructor Details

  • Method Details

    • getIndex

      public Map<Object,Object> 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 interface EventTable
      Specified by:
      getIndex in class PropertyCompositeEventTable
      Returns:
      index object
    • add

      public void add(EventBean theEvent, ExprEvaluatorContext exprEvaluatorContext)
      Description copied from interface: EventTable
      Add event to table.
      Parameters:
      theEvent - to add
      exprEvaluatorContext - evaluator context
    • remove

      public void remove(EventBean theEvent, ExprEvaluatorContext exprEvaluatorContext)
      Description copied from interface: EventTable
      Remove event from table.
      Parameters:
      theEvent - to remove
      exprEvaluatorContext - 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

      public Iterator<EventBean> 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

      public Class getProviderClass()
    • getPostProcessor

      public CompositeIndexQueryResultPostProcessor getPostProcessor()
      Specified by:
      getPostProcessor in class PropertyCompositeEventTable