public class DatabasePollingViewable extends Object implements HistoricalEventViewable
Constructor and Description |
---|
DatabasePollingViewable(int myStreamNumber,
List<String> inputParameters,
PollExecStrategy pollExecStrategy,
DataCache dataCache,
EventType eventType)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
View |
addView(View view)
Add a view to the viewable object.
|
ThreadLocal<DataCache> |
getDataCacheThreadLocal()
Historical views are expected to provide a thread-local data cache
for use in keeping row (
EventBean references) returned during iteration
stable, since the concept of a primary key does not exist. |
EventType |
getEventType()
Provides metadata information about the type of object the event collection contains.
|
DataCache |
getOptionalDataCache() |
SortedSet<Integer> |
getRequiredStreams()
Returns the a set of stream numbers of all streams that provide property values
in any of the parameter expressions to the stream.
|
View[] |
getViews()
Returns all added views.
|
boolean |
hasRequiredStreams()
Returns true if the parameters expressions to the historical require other stream's data,
or false if there are no parameters or all parameter expressions are only contants and variables without
properties of other stream events.
|
boolean |
hasViews()
Test is there are any views to the Viewable.
|
Iterator<EventBean> |
iterator()
Allows iteration through all elements in this event collection.
|
EventTable[][] |
poll(EventBean[][] lookupEventsPerStream,
PollResultIndexingStrategy indexingStrategy,
ExprEvaluatorContext exprEvaluatorContext)
Poll for stored historical or reference data using events per stream and
returing for each event-per-stream row a separate list with events
representing the poll result.
|
void |
removeAllViews()
Remove all views.
|
boolean |
removeView(View view)
Remove a view.
|
void |
stop()
Stops the underlying resources.
|
void |
validate(EngineImportService engineImportService,
StreamTypeService streamTypeService,
TimeProvider timeProvider,
VariableService variableService,
TableService tableService,
ExprEvaluatorContext exprEvaluatorContext,
ConfigurationInformation configSnapshot,
SchedulingService schedulingService,
String engineURI,
Map<Integer,List<ExprNode>> sqlParameters,
EventAdapterService eventAdapterService,
StatementContext statementContext)
Validate the view.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public DatabasePollingViewable(int myStreamNumber, List<String> inputParameters, PollExecStrategy pollExecStrategy, DataCache dataCache, EventType eventType)
myStreamNumber
- is the stream number of the viewinputParameters
- are the event property names providing input parameter keyspollExecStrategy
- is the strategy to use for retrieving resultsdataCache
- is looked up before using the strategyeventType
- is the type of events generated by the viewpublic void stop()
StopCallback
stop
in interface StopCallback
public DataCache getOptionalDataCache()
getOptionalDataCache
in interface HistoricalEventViewable
public void validate(EngineImportService engineImportService, StreamTypeService streamTypeService, TimeProvider timeProvider, VariableService variableService, TableService tableService, ExprEvaluatorContext exprEvaluatorContext, ConfigurationInformation configSnapshot, SchedulingService schedulingService, String engineURI, Map<Integer,List<ExprNode>> sqlParameters, EventAdapterService eventAdapterService, StatementContext statementContext) throws ExprValidationException
ValidatedView
validate
in interface ValidatedView
engineImportService
- engine importsstreamTypeService
- supplies the types of streams against which to validatetimeProvider
- for providing current timevariableService
- for access to variablestableService
- tablesexprEvaluatorContext
- context for expression evaluationconfigSnapshot
- configurationschedulingService
- schedulingengineURI
- engine URIsqlParameters
- parameterseventAdapterService
- event type infostatementContext
- statement contextExprValidationException
- is thrown to indicate an exception in validating the viewpublic EventTable[][] poll(EventBean[][] lookupEventsPerStream, PollResultIndexingStrategy indexingStrategy, ExprEvaluatorContext exprEvaluatorContext)
HistoricalEventViewable
poll
in interface HistoricalEventViewable
lookupEventsPerStream
- is the events per stream where the
first dimension is a number of rows (often 1 depending on windows used) and
the second dimension is the number of streams participating in a join.indexingStrategy
- the strategy to use for converting poll results into a indexed table for fast lookupexprEvaluatorContext
- context for expression evalauationpublic View addView(View view)
Viewable
public View[] getViews()
Viewable
public boolean removeView(View view)
Viewable
removeView
in interface Viewable
view
- to removepublic boolean hasViews()
Viewable
public EventType getEventType()
EventCollection
getEventType
in interface EventCollection
public Iterator<EventBean> iterator()
EventCollection
iterator
in interface EventCollection
iterator
in interface Iterable<EventBean>
public SortedSet<Integer> getRequiredStreams()
HistoricalEventViewable
getRequiredStreams
in interface HistoricalEventViewable
public boolean hasRequiredStreams()
HistoricalEventViewable
hasRequiredStreams
in interface HistoricalEventViewable
public ThreadLocal<DataCache> getDataCacheThreadLocal()
HistoricalEventViewable
EventBean
references) returned during iteration
stable, since the concept of a primary key does not exist.getDataCacheThreadLocal
in interface HistoricalEventViewable
public void removeAllViews()
Viewable
removeAllViews
in interface Viewable