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
ConstructorsModifierConstructorDescriptionprotectedAbstractHistoryLoader(QueryController controller, QueryMetrics metrics) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidThe reading has been ended, clean up any resources.final voidIf startReading was called, this function must be called (that is, it should be in a finally block).protected longprotected abstract LoggerExprotected Stringprotected longprotected abstract longgetTimestampFor(V value) booleanhasMore()Returns TRUE if there is more data available to be written on call to processData()voidInitializes the query, performing any actions necessary to get the information required to run the query.protected abstract longPuts the value into the appropriate column.longnextTime()The timestamp of the next value.protected StringpathToString(QualifiedPath path) protected abstract voidThis function starts the read process, and gets the system ready for the first call to readNextFromSourcelongPuts the next value(s) into the appropriate column, returning the latest timestamp loaded, or -1 if no data was loaded.protected voidreadNext()Primes the nextValueprotected abstract Vprotected voidsetErrored(DataQuality code) protected voidsetPostValues(List<? extends V> postValues) protected voidsetSeedValues(List<? extends V> seedValues) protected booleanHelper function to determine whether bounding values should be read.final voidExecutes query to begin data read.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:HistoryQueryExecutorInitializes the query, performing any actions necessary to get the information required to run the query.- Specified by:
initializein 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:
startReadingin 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:HistoryQueryExecutorIf startReading was called, this function must be called (that is, it should be in a finally block).- Specified by:
endReadingin interfaceHistoryQueryExecutor
-
closeRead
protected abstract void closeRead()The reading has been ended, clean up any resources. -
hasMore
public boolean hasMore()Description copied from interface:HistoryQueryExecutorReturns TRUE if there is more data available to be written on call to processData()- Specified by:
hasMorein interfaceHistoryQueryExecutor
-
getTimestampFor
-
nextTime
public long nextTime()Description copied from interface:HistoryQueryExecutorThe timestamp of the next value. -1 if no value is available.- Specified by:
nextTimein interfaceHistoryQueryExecutor
-
processData
Description copied from interface:HistoryQueryExecutorPuts the next value(s) into the appropriate column, returning the latest timestamp loaded, or -1 if no data was loaded.- Specified by:
processDatain interfaceHistoryQueryExecutor- Throws:
Exception
-
readNext
Primes the nextValue- Throws:
Exception
-
readNextFromSource
- Throws:
Exception
-
loadValue
Puts the value into the appropriate column.
-