Class RemoteTagHistoryQueryExecutor
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.sqltags.history.distributed.RemoteTagHistoryQueryExecutor
-
- All Implemented Interfaces:
HistoryQueryExecutor
public class RemoteTagHistoryQueryExecutor extends java.lang.Object implements HistoryQueryExecutor
This history query executor executes a query against a remote gateway.
-
-
Constructor Summary
Constructors Constructor Description RemoteTagHistoryQueryExecutor(com.inductiveautomation.metro.api.services.Service<TagHistoryService> service, java.util.List<ColumnQueryDefinition> paths, QueryController controller, LoggerEx logger)
The paths here have been transformed to the remote provider's name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeStream()
protected StreamingDataset
data()
void
endReading()
If startReading was called, this function must be called (that is, it should be in a finally block).protected ProcessedHistoryColumn
getColumn(int ndx)
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()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()
Since we load all of the data at once on start read, we return the max timestamp received here as the processed timestamp.protected void
readColumnData()
void
startReading()
Begins reading data.
-
-
-
Field Detail
-
ganLogger
protected LoggerEx ganLogger
-
-
Constructor Detail
-
RemoteTagHistoryQueryExecutor
public RemoteTagHistoryQueryExecutor(com.inductiveautomation.metro.api.services.Service<TagHistoryService> service, java.util.List<ColumnQueryDefinition> paths, QueryController controller, LoggerEx logger)
The paths here have been transformed to the remote provider's name.
-
-
Method Detail
-
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
-
data
protected StreamingDataset data()
-
closeStream
protected void closeStream()
-
getColumn
protected ProcessedHistoryColumn getColumn(int ndx)
-
initialize
public void initialize() throws java.lang.Exception
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
- Throws:
java.lang.Exception
-
readColumnData
protected void readColumnData() throws java.lang.Exception
- Throws:
java.lang.Exception
-
moveForward
protected void moveForward() throws java.lang.Exception
- Throws:
java.lang.Exception
-
startReading
public void startReading() throws java.lang.Exception
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
- Throws:
java.lang.Exception
-
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
-
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() throws java.lang.Exception
Since we load all of the data at once on start read, we return the max timestamp received here as the processed timestamp.- Specified by:
processData
in interfaceHistoryQueryExecutor
- Throws:
java.lang.Exception
-
-