Class AbstractHistoryQueryExecutor
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryLoader<IndexedQualifiedValue>
-
- com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryQueryExecutor
-
- All Implemented Interfaces:
HistoryQueryExecutor
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 Classes Modifier and Type Class Description protected static class
AbstractHistoryQueryExecutor.ColumnDataType
Holds the datatype of a column.
-
Field Summary
-
Fields inherited from class com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryLoader
endTime, startTime
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractHistoryQueryExecutor(QueryController controller, java.util.List<ColumnQueryDefinition> paths, LoggerEx logger)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected HistoryColumn
buildRealNode(int index, ColumnQueryDefinition def, AbstractHistoryQueryExecutor.ColumnDataType dtype)
java.util.List<? extends HistoryNode>
getColumnNodes()
Returns the HistoryNodes of this executor.int
getEffectiveWindowSizeMS()
When "natural" results are requested, this will be called to let the query executors say what they think "natural" means.LoggerEx
getLogger()
protected long
getTimestampFor(IndexedQualifiedValue value)
protected HistoricalValue
historicalValueFor(IndexedQualifiedValue value)
protected long
loadValue(IndexedQualifiedValue value)
Puts the value into the appropriate column.protected void
primeRead()
This function starts the read process, and gets the system ready for the first call to readNextFromSourceprotected abstract java.util.List<AbstractHistoryQueryExecutor.ColumnDataType>
startReadingData(java.util.List<QualifiedPath> paths)
Should do the following: 1) Start reading the data.-
Methods inherited from class com.inductiveautomation.ignition.gateway.sqltags.history.query.AbstractHistoryLoader
closeRead, endReading, getController, getEndTime, getQueryId, getSeedValues, getStartTime, hasMore, initialize, nextTime, pathToString, processData, readNext, readNextFromSource, setErrored, setPostValues, setSeedValues, shouldReadBoundaryValues, startReading
-
-
-
-
Constructor Detail
-
AbstractHistoryQueryExecutor
protected AbstractHistoryQueryExecutor(QueryController controller, java.util.List<ColumnQueryDefinition> paths, LoggerEx logger)
-
-
Method Detail
-
getLogger
public LoggerEx 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
public java.util.List<? extends HistoryNode> 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 returnDelegatingHistoryNode
s, which get filled in later.
-
getTimestampFor
protected long getTimestampFor(IndexedQualifiedValue value)
- Specified by:
getTimestampFor
in classAbstractHistoryLoader<IndexedQualifiedValue>
-
primeRead
protected final void primeRead() throws java.lang.Exception
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:
java.lang.Exception
-
startReadingData
protected abstract java.util.List<AbstractHistoryQueryExecutor.ColumnDataType> startReadingData(java.util.List<QualifiedPath> paths) throws java.lang.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:
java.lang.Exception
-
buildRealNode
protected HistoryColumn buildRealNode(int index, ColumnQueryDefinition def, AbstractHistoryQueryExecutor.ColumnDataType dtype)
-
loadValue
protected long loadValue(IndexedQualifiedValue value)
Description copied from class:AbstractHistoryLoader
Puts the value into the appropriate column.- Specified by:
loadValue
in classAbstractHistoryLoader<IndexedQualifiedValue>
-
historicalValueFor
protected HistoricalValue historicalValueFor(IndexedQualifiedValue value)
-
-