Class HistorianQueryExecutor
- java.lang.Object
-
- com.inductiveautomation.gateway.tags.history.tsdb.HistorianQueryExecutor
-
- All Implemented Interfaces:
HistoryQueryExecutor
public class HistorianQueryExecutor extends java.lang.Object implements HistoryQueryExecutor
Created by Colby on 4/6/2016.
-
-
Constructor Summary
Constructors Constructor Description HistorianQueryExecutor(Historian historian, java.util.List<ColumnQueryDefinition> paths, QueryController controller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HistoryNode
buildRealNode(PathInfo pi, ColumnQueryDefinition def)
void
endReading()
If startReading was called, this function must be called (that is, it should be in a finally block).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.boolean
hasMore()
Returns TRUE if there is more data available to be written on call to processData()protected HistoricalValue
historicalValue(ResultDataPoint data)
void
initialize()
Initializes the query, performing any actions necessary to get the information required to run the query.protected void
moveForward()
long
nextTime()
The timestamp of the next value.long
processData()
Puts the next value(s) into the appropriate column, returning the latest timestamp loaded, or -1 if no data was loaded.protected java.lang.String
standardizePath(QualifiedPath p)
void
startReading()
Begins reading data.protected DataTypeClass
toDataTypeClass(DataType t)
-
-
-
Constructor Detail
-
HistorianQueryExecutor
public HistorianQueryExecutor(Historian historian, java.util.List<ColumnQueryDefinition> paths, QueryController controller)
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:HistoryQueryExecutor
Initializes the query, performing any actions necessary to get the information required to run the query.- Specified by:
initialize
in interfaceHistoryQueryExecutor
-
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.- Specified by:
getColumnNodes
in interfaceHistoryQueryExecutor
-
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.- Specified by:
getEffectiveWindowSizeMS
in interfaceHistoryQueryExecutor
-
standardizePath
protected java.lang.String standardizePath(QualifiedPath p)
-
startReading
public void startReading()
Description copied from interface:HistoryQueryExecutor
Begins reading data. IMPORTANT: endReading should always be called at some point after calling startReading.- Specified by:
startReading
in interfaceHistoryQueryExecutor
-
buildRealNode
protected HistoryNode buildRealNode(PathInfo pi, ColumnQueryDefinition def)
-
toDataTypeClass
protected DataTypeClass toDataTypeClass(DataType t)
-
endReading
public void endReading()
Description copied from interface:HistoryQueryExecutor
If startReading was called, this function must be called (that is, it should be in a finally block).- Specified by:
endReading
in interfaceHistoryQueryExecutor
-
hasMore
public boolean hasMore()
Description copied from interface:HistoryQueryExecutor
Returns TRUE if there is more data available to be written on call to processData()- Specified by:
hasMore
in interfaceHistoryQueryExecutor
-
moveForward
protected void moveForward()
-
nextTime
public long nextTime()
Description copied from interface:HistoryQueryExecutor
The timestamp of the next value. -1 if no value is available.- Specified by:
nextTime
in interfaceHistoryQueryExecutor
-
processData
public long processData()
Description copied from interface:HistoryQueryExecutor
Puts the next value(s) into the appropriate column, returning the latest timestamp loaded, or -1 if no data was loaded.- Specified by:
processData
in interfaceHistoryQueryExecutor
-
historicalValue
protected HistoricalValue historicalValue(ResultDataPoint data)
-
-