Class MultiIndexEventTable
- All Implemented Interfaces:
EventTable
,Iterable<EventBean>
Does not allow iteration, adding and removing events. Does allow clearing all tables and asking for filled or empty tables. All tables are expected to be filled and empty at the same time, reflecting multiple indexes on a single set of data.
-
Constructor Summary
ConstructorDescriptionMultiIndexEventTable
(EventTable[] tables, EventTableOrganization organization) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(EventBean[] events, ExprEvaluatorContext exprEvaluatorContext) Add events to table.void
add
(EventBean event, ExprEvaluatorContext exprEvaluatorContext) Add event to table.void
addRemove
(EventBean[] newData, EventBean[] oldData, ExprEvaluatorContext exprEvaluatorContext) Add and remove events from table.void
clear()
Clear out index.void
destroy()
Destroy index.getIndex()
Return the index object itself, or an object-array for multiple index structures.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.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.Returns all tables.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[] events, ExprEvaluatorContext exprEvaluatorContext) Remove events from table.void
remove
(EventBean event, ExprEvaluatorContext exprEvaluatorContext) Remove event from table.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MultiIndexEventTable
Ctor.- Parameters:
tables
- tables to holdorganization
- organization
-
-
Method Details
-
getTables
Returns all tables.- Returns:
- tables
-
addRemove
public void addRemove(EventBean[] newData, EventBean[] oldData, ExprEvaluatorContext exprEvaluatorContext) Description copied from interface:EventTable
Add and remove events from table.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.
- Specified by:
addRemove
in interfaceEventTable
- Parameters:
newData
- to addoldData
- to removeexprEvaluatorContext
- evaluator context
-
add
Description copied from interface:EventTable
Add events to table.- Specified by:
add
in interfaceEventTable
- Parameters:
events
- to addexprEvaluatorContext
- evaluator context
-
add
Description copied from interface:EventTable
Add event to table.- Specified by:
add
in interfaceEventTable
- Parameters:
event
- to addexprEvaluatorContext
- evaluator context
-
remove
Description copied from interface:EventTable
Remove events from table.- Specified by:
remove
in interfaceEventTable
- Parameters:
events
- to removeexprEvaluatorContext
- evaluator context
-
remove
Description copied from interface:EventTable
Remove event from table.- Specified by:
remove
in interfaceEventTable
- Parameters:
event
- to removeexprEvaluatorContext
- evaluator context
-
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 interfaceEventTable
- Specified by:
iterator
in interfaceIterable<EventBean>
- Returns:
- table iterator
-
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 interfaceEventTable
- Returns:
- true for definitely empty index, false for there-may-be-rows and please-check-by-iterating
-
clear
public void clear()Description copied from interface:EventTable
Clear out index.- Specified by:
clear
in interfaceEventTable
-
destroy
public void destroy()Description copied from interface:EventTable
Destroy index.- Specified by:
destroy
in interfaceEventTable
-
toQueryPlan
- Specified by:
toQueryPlan
in interfaceEventTable
-
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 interfaceEventTable
- Returns:
- number of events
-
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 interfaceEventTable
- Returns:
- number of keys
-
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
- Returns:
- index object
-
getOrganization
- Specified by:
getOrganization
in interfaceEventTable
-
getProviderClass
- Specified by:
getProviderClass
in interfaceEventTable
-