Class AbstractHistoryLoader<V>
java.lang.Object
com.inductiveautomation.historian.gateway.query.execution.AbstractHistoryLoader<V>
- All Implemented Interfaces:
HistoryQueryExecutor
- Direct Known Subclasses:
AbstractHistoryQueryExecutor
Provides a base level of functionality that should serve any type of history loader.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractHistoryLoader
(QueryController controller, QueryMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
The reading has been ended, clean up any resources.final void
If startReading was called, this function must be called (that is, it should be in a finally block).protected long
protected abstract LoggerEx
protected String
protected long
protected abstract long
getTimestampFor
(V value) boolean
hasMore()
Returns TRUE if there is more data available to be written on call to processData()void
Initializes the query, performing any actions necessary to get the information required to run the query.protected abstract long
Puts the value into the appropriate column.long
nextTime()
The timestamp of the next value.protected String
pathToString
(QualifiedPath path) protected abstract void
This function starts the read process, and gets the system ready for the first call to readNextFromSourcelong
Puts the next value(s) into the appropriate column, returning the latest timestamp loaded, or -1 if no data was loaded.protected void
readNext()
Primes the nextValueprotected abstract V
protected void
setErrored
(DataQuality code) protected void
setPostValues
(List<? extends V> postValues) protected void
setSeedValues
(List<? extends V> seedValues) protected boolean
Helper function to determine whether bounding values should be read.final void
Executes query to begin data read.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.gateway.sqltags.history.query.HistoryQueryExecutor
getColumnNodes, getEffectiveWindowSizeMS
-
Field Details
-
startTime
protected long startTime -
endTime
protected long endTime
-
-
Constructor Details
-
AbstractHistoryLoader
-
-
Method Details
-
getQueryId
-
getController
-
getLogger
-
getStartTime
protected long getStartTime() -
getEndTime
protected long getEndTime() -
shouldReadBoundaryValues
protected boolean shouldReadBoundaryValues()Helper function to determine whether bounding values should be read. -
pathToString
-
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
- Throws:
Exception
-
setErrored
-
getSeedValues
-
setSeedValues
-
setPostValues
-
startReading
Executes query to begin data read. Important: endReading should be called in finally block of invoking method.- Specified by:
startReading
in interfaceHistoryQueryExecutor
- Throws:
Exception
-
primeRead
This function starts the read process, and gets the system ready for the first call to readNextFromSource- Throws:
Exception
-
endReading
public final 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
-
closeRead
protected abstract void closeRead()The reading has been ended, clean up any resources. -
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
-
getTimestampFor
-
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
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
- Throws:
Exception
-
readNext
Primes the nextValue- Throws:
Exception
-
readNextFromSource
- Throws:
Exception
-
loadValue
Puts the value into the appropriate column.
-