Class AbstractHistoryQueryExecutor
java.lang.Object
com.inductiveautomation.historian.gateway.query.execution.AbstractHistoryLoader<IndexedQualifiedValue>
com.inductiveautomation.historian.gateway.query.execution.AbstractHistoryQueryExecutor
- All Implemented Interfaces:
HistoryQueryExecutor
- Direct Known Subclasses:
Query
,SimulatorHistorianQuery
public abstract class AbstractHistoryQueryExecutor
extends AbstractHistoryLoader<IndexedQualifiedValue>
This can be a base for simple historical query executors. It manages the column nodes, and the sub type only has
to read the data and provide data types.
Remember when implementing that if you need boundary values, you need to load those and call setSeed/Post values.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Holds the datatype of a column. -
Field Summary
Fields inherited from class com.inductiveautomation.historian.gateway.query.execution.AbstractHistoryLoader
endTime, startTime
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractHistoryQueryExecutor
(QueryController controller, List<ColumnQueryDefinition> paths, LoggerEx logger, QueryMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionprotected ValueBasedResultNode
buildRealNode
(int index, ColumnQueryDefinition def, AbstractHistoryQueryExecutor.ColumnDataType dtype) List<? extends ResultNode>
Returns the HistoryNodes of this executor.int
When "natural" results are requested, this will be called to let the query executors say what they think "natural" means.protected long
protected long
loadValue
(IndexedQualifiedValue value) Puts the value into the appropriate column.protected final void
This function starts the read process, and gets the system ready for the first call to readNextFromSourceprotected abstract List<AbstractHistoryQueryExecutor.ColumnDataType>
startReadingData
(List<QualifiedPath> paths) Should do the following: 1) Start reading the data.Methods inherited from class com.inductiveautomation.historian.gateway.query.execution.AbstractHistoryLoader
closeRead, endReading, getController, getEndTime, getQueryId, getSeedValues, getStartTime, hasMore, initialize, nextTime, pathToString, processData, readNext, readNextFromSource, setErrored, setPostValues, setSeedValues, shouldReadBoundaryValues, startReading
-
Constructor Details
-
AbstractHistoryQueryExecutor
protected AbstractHistoryQueryExecutor(QueryController controller, List<ColumnQueryDefinition> paths, LoggerEx logger, QueryMetrics metrics)
-
-
Method Details
-
getLogger
- Specified by:
getLogger
in classAbstractHistoryLoader<IndexedQualifiedValue>
-
getEffectiveWindowSizeMS
public int getEffectiveWindowSizeMS()Description copied from interface:HistoryQueryExecutor
When "natural" results are requested, this will be called to let the query executors say what they think "natural" means. If a query executor does not support natural results, it should return -1. If all of the query executors return -1, a raw query will be performed. -
getColumnNodes
Description copied from interface:HistoryQueryExecutor
Returns the HistoryNodes of this executor. There MUST be one for every tag path, and they must be in the same order as the paths provided to the executor when it was created. Also, these values must be available as soon as the executor is created. However, they won't be consulted for their data type until after initialize is called, so the normal procedure is to create and returnDelegatingResultNode
s, which get filled in later. -
getTimestampFor
- Specified by:
getTimestampFor
in classAbstractHistoryLoader<IndexedQualifiedValue>
-
primeRead
Description copied from class:AbstractHistoryLoader
This function starts the read process, and gets the system ready for the first call to readNextFromSource- Specified by:
primeRead
in classAbstractHistoryLoader<IndexedQualifiedValue>
- Throws:
Exception
-
startReadingData
protected abstract List<AbstractHistoryQueryExecutor.ColumnDataType> startReadingData(List<QualifiedPath> paths) throws Exception Should do the following: 1) Start reading the data. Values should be produced with a 1-to-1 index into these paths. If there are boundary values, those maps should be set with calls to setSeed/PostValues 2) Collect and return the data types of the paths/columns.- Throws:
Exception
-
buildRealNode
protected ValueBasedResultNode buildRealNode(int index, ColumnQueryDefinition def, AbstractHistoryQueryExecutor.ColumnDataType dtype) -
loadValue
Description copied from class:AbstractHistoryLoader
Puts the value into the appropriate column.- Specified by:
loadValue
in classAbstractHistoryLoader<IndexedQualifiedValue>
-