public class MethodPollingViewable extends java.lang.Object implements HistoricalEventViewable
Constructor and Description |
---|
MethodPollingViewable(MethodStreamSpec methodStreamSpec,
int myStreamNumber,
java.util.List<ExprNode> inputParameters,
PollExecStrategy pollExecStrategy,
DataCache dataCache,
EventType eventType,
ExprEvaluatorContext exprEvaluatorContext)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
View |
addView(View view)
Add a view to the viewable object.
|
java.lang.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.
|
java.util.SortedSet<java.lang.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.
|
java.util.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,
MethodResolutionService methodResolutionService,
TimeProvider timeProvider,
VariableService variableService,
ExprEvaluatorContext exprEvaluatorContext,
ConfigurationInformation configSnapshot,
SchedulingService schedulingService,
java.lang.String engineURI,
java.util.Map<java.lang.Integer,java.util.List<ExprNode>> sqlParameters,
EventAdapterService eventAdapterService,
java.lang.String statementName,
java.lang.String statementId,
java.lang.annotation.Annotation[] annotations)
Validate the view.
|
public MethodPollingViewable(MethodStreamSpec methodStreamSpec, int myStreamNumber, java.util.List<ExprNode> inputParameters, PollExecStrategy pollExecStrategy, DataCache dataCache, EventType eventType, ExprEvaluatorContext exprEvaluatorContext)
methodStreamSpec
- defines class and method namesmyStreamNumber
- is the stream numberinputParameters
- the input parameter expressionspollExecStrategy
- the execution strategydataCache
- the cache to useeventType
- the type of event returnedexprEvaluatorContext
- expression evaluation contextpublic void stop()
StopCallback
stop
in interface StopCallback
public java.lang.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 validate(EngineImportService engineImportService, StreamTypeService streamTypeService, MethodResolutionService methodResolutionService, TimeProvider timeProvider, VariableService variableService, ExprEvaluatorContext exprEvaluatorContext, ConfigurationInformation configSnapshot, SchedulingService schedulingService, java.lang.String engineURI, java.util.Map<java.lang.Integer,java.util.List<ExprNode>> sqlParameters, EventAdapterService eventAdapterService, java.lang.String statementName, java.lang.String statementId, java.lang.annotation.Annotation[] annotations) throws ExprValidationException
ValidatedView
validate
in interface ValidatedView
streamTypeService
- supplies the types of streams against which to validatemethodResolutionService
- for resolving imports and classes and methodstimeProvider
- for providing current timevariableService
- for access to variablesexprEvaluatorContext
- context for expression evaluationExprValidationException
- 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 void removeAllViews()
Viewable
removeAllViews
in interface Viewable
public boolean hasViews()
Viewable
public EventType getEventType()
EventCollection
getEventType
in interface EventCollection
public java.util.Iterator<EventBean> iterator()
EventCollection
iterator
in interface EventCollection
iterator
in interface java.lang.Iterable<EventBean>
public java.util.SortedSet<java.lang.Integer> getRequiredStreams()
HistoricalEventViewable
getRequiredStreams
in interface HistoricalEventViewable
public boolean hasRequiredStreams()
HistoricalEventViewable
hasRequiredStreams
in interface HistoricalEventViewable