Class PropertyHashedEventTableUnique

java.lang.Object
com.espertech.esper.common.internal.epl.index.hash.PropertyHashedEventTable
com.espertech.esper.common.internal.epl.index.hash.PropertyHashedEventTableUnique
All Implemented Interfaces:
EventTable, EventTableAsSet, Iterable<EventBean>

public class PropertyHashedEventTableUnique extends PropertyHashedEventTable implements EventTableAsSet
Unique index.
  • Constructor Details

  • Method Details

    • lookup

      public Set<EventBean> lookup(Object key)
      Specified by:
      lookup in class PropertyHashedEventTable
    • lookupFAF

      public Set<EventBean> lookupFAF(Object key)
      Specified by:
      lookupFAF in class PropertyHashedEventTable
    • 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.

      Specified by:
      getNumKeys in interface EventTable
      Returns:
      number of keys
    • getIndex

      public 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
      Returns:
      index object
    • addRemove

      public void addRemove(EventBean[] newData, EventBean[] oldData, ExprEvaluatorContext exprEvaluatorContext)
      Remove then add events.
      Specified by:
      addRemove in interface EventTable
      Overrides:
      addRemove in class PropertyHashedEventTable
      Parameters:
      newData - to add
      oldData - to remove
      exprEvaluatorContext - evaluator context
    • add

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

      public void remove(EventBean theEvent, ExprEvaluatorContext exprEvaluatorContext)
      Description copied from interface: EventTable
      Remove event from table.
      Specified by:
      remove in interface EventTable
      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.
      Specified by:
      isEmpty in interface EventTable
      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.
      Specified by:
      iterator in interface EventTable
      Specified by:
      iterator in interface Iterable<EventBean>
      Returns:
      table iterator
    • clear

      public void clear()
      Description copied from interface: EventTable
      Clear out index.
      Specified by:
      clear in interface EventTable
    • destroy

      public void destroy()
      Description copied from interface: EventTable
      Destroy index.
      Specified by:
      destroy in interface EventTable
    • toString

      public String toString()
      Overrides:
      toString in class PropertyHashedEventTable
    • getNumberOfEvents

      public Integer getNumberOfEvents()
      Description copied from interface: EventTable
      If the number of events is readily available, an implementation will return that number or it may return null to indicate that the count is not readily available.
      Specified by:
      getNumberOfEvents in interface EventTable
      Returns:
      number of events
    • allValues

      public Set<EventBean> allValues()
      Specified by:
      allValues in interface EventTableAsSet
    • getProviderClass

      public Class getProviderClass()
      Specified by:
      getProviderClass in interface EventTable
    • getPropertyIndex

      public Map<Object,EventBean> getPropertyIndex()
    • handleUniqueIndexViolation

      public static EPException handleUniqueIndexViolation(String indexName, Object key)