public abstract class PropertySortedEventTable extends Object implements EventTable
Modifier and Type | Field and Description |
---|---|
protected EventTableOrganization |
organization |
protected EventPropertyGetter |
propertyGetter |
Constructor and Description |
---|
PropertySortedEventTable(EventPropertyGetter propertyGetter,
EventTableOrganization organization) |
Modifier and Type | Method and Description |
---|---|
void |
add(EventBean[] events,
ExprEvaluatorContext exprEvaluatorContext)
Add an array of events.
|
void |
addRemove(EventBean[] newData,
EventBean[] oldData,
ExprEvaluatorContext exprEvaluatorContext)
Add and remove events from table.
|
protected Object |
getIndexedValue(EventBean theEvent)
Determine multikey for index access.
|
Integer |
getNumberOfEvents()
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.
|
EventTableOrganization |
getOrganization() |
abstract Set<EventBean> |
lookupConstants(RangeIndexLookupValue lookupValueBase) |
abstract Set<EventBean> |
lookupGreater(Object keyStart) |
abstract Collection<EventBean> |
lookupGreaterColl(Object keyStart) |
abstract Set<EventBean> |
lookupGreaterEqual(Object keyStart) |
abstract Collection<EventBean> |
lookupGreaterEqualColl(Object keyStart) |
abstract Set<EventBean> |
lookupLess(Object keyStart) |
abstract Set<EventBean> |
lookupLessEqual(Object keyStart) |
abstract Collection<EventBean> |
lookupLessEqualColl(Object keyStart) |
abstract Collection<EventBean> |
lookupLessThenColl(Object keyStart) |
abstract Set<EventBean> |
lookupRange(Object keyStart,
boolean includeStart,
Object keyEnd,
boolean includeEnd,
boolean allowRangeReversal) |
abstract Collection<EventBean> |
lookupRangeColl(Object keyStart,
boolean includeStart,
Object keyEnd,
boolean includeEnd,
boolean allowRangeReversal) |
abstract Set<EventBean> |
lookupRangeInverted(Object keyStart,
boolean includeStart,
Object keyEnd,
boolean includeEnd) |
abstract Collection<EventBean> |
lookupRangeInvertedColl(Object keyStart,
boolean includeStart,
Object keyEnd,
boolean includeEnd) |
protected static Set<EventBean> |
normalize(SortedMap<Object,Set<EventBean>> submap) |
protected static Set<EventBean> |
normalize(SortedMap<Object,Set<EventBean>> submapOne,
SortedMap<Object,Set<EventBean>> submapTwo) |
protected static Collection<EventBean> |
normalizeCollection(SortedMap<Object,Set<EventBean>> submap) |
protected static Collection<EventBean> |
normalizeCollection(SortedMap<Object,Set<EventBean>> submapOne,
SortedMap<Object,Set<EventBean>> submapTwo) |
void |
remove(EventBean[] events,
ExprEvaluatorContext exprEvaluatorContext)
Remove events.
|
String |
toQueryPlan() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, clear, destroy, getIndex, getNumKeys, getProviderClass, isEmpty, iterator, remove
forEach, spliterator
protected final EventPropertyGetter propertyGetter
protected final EventTableOrganization organization
public PropertySortedEventTable(EventPropertyGetter propertyGetter, EventTableOrganization organization)
public abstract Set<EventBean> lookupRange(Object keyStart, boolean includeStart, Object keyEnd, boolean includeEnd, boolean allowRangeReversal)
public abstract Collection<EventBean> lookupRangeColl(Object keyStart, boolean includeStart, Object keyEnd, boolean includeEnd, boolean allowRangeReversal)
public abstract Set<EventBean> lookupRangeInverted(Object keyStart, boolean includeStart, Object keyEnd, boolean includeEnd)
public abstract Collection<EventBean> lookupRangeInvertedColl(Object keyStart, boolean includeStart, Object keyEnd, boolean includeEnd)
public abstract Collection<EventBean> lookupLessThenColl(Object keyStart)
public abstract Collection<EventBean> lookupLessEqualColl(Object keyStart)
public abstract Collection<EventBean> lookupGreaterEqualColl(Object keyStart)
public abstract Collection<EventBean> lookupGreaterColl(Object keyStart)
public abstract Set<EventBean> lookupConstants(RangeIndexLookupValue lookupValueBase)
protected Object getIndexedValue(EventBean theEvent)
theEvent
- to get properties from for keypublic void addRemove(EventBean[] newData, EventBean[] oldData, ExprEvaluatorContext exprEvaluatorContext)
EventTable
It is up to the index to decide whether to add first and then remove, or whether to remove and then add.
It is important to note that a given event can be in both the removed and the added events. This means that unique indexes probably need to remove first and then add. Most other non-unique indexes will add first and then remove since the an event can be both in the add and the remove stream.
addRemove
in interface EventTable
newData
- to addoldData
- to removeexprEvaluatorContext
- evaluator contextpublic void add(EventBean[] events, ExprEvaluatorContext exprEvaluatorContext)
add
in interface EventTable
events
- to addexprEvaluatorContext
- evaluator contextIllegalArgumentException
- if the event was already existed in the indexpublic void remove(EventBean[] events, ExprEvaluatorContext exprEvaluatorContext)
remove
in interface EventTable
events
- to be removed, can be null instead of an empty array.exprEvaluatorContext
- evaluator contextIllegalArgumentException
- when the event could not be removed as its not in the indexpublic Integer getNumberOfEvents()
EventTable
getNumberOfEvents
in interface EventTable
protected static Collection<EventBean> normalizeCollection(SortedMap<Object,Set<EventBean>> submap)
protected static Collection<EventBean> normalizeCollection(SortedMap<Object,Set<EventBean>> submapOne, SortedMap<Object,Set<EventBean>> submapTwo)
protected static Set<EventBean> normalize(SortedMap<Object,Set<EventBean>> submapOne, SortedMap<Object,Set<EventBean>> submapTwo)
public String toQueryPlan()
toQueryPlan
in interface EventTable
public EventTableOrganization getOrganization()
getOrganization
in interface EventTable