Class QueryContext
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<java.lang.String,java.lang.Object>
-
- com.inductiveautomation.ignition.gateway.sqltags.history.query.processing.QueryContext
-
- All Implemented Interfaces:
QueryController
,java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.Object>
public class QueryContext extends java.util.HashMap<java.lang.String,java.lang.Object> implements QueryController
The query context provides information about the overall query that might be useful to aggregation functions.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description QueryContext(QueryController controller, LoggerEx logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getBlockId(long time)
Returns which block the time belongs to.long
getBlockSize()
Returns the size of the blocks in milliseconds.LoggerEx
getLogger()
This returns a logger that can be used to log information about processing.long
getQueryEnd()
java.lang.String
getQueryId()
TagHistoryQueryParams
getQueryParameters()
The parameters for the current query.long
getQueryStart()
void
logDebug(java.lang.String message, java.lang.Object... args)
void
logInfo(java.lang.String message, java.lang.Object... args)
void
logTrace(java.lang.String message, java.lang.Object... args)
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Constructor Detail
-
QueryContext
public QueryContext(QueryController controller, LoggerEx logger)
-
-
Method Detail
-
getLogger
public LoggerEx getLogger()
This returns a logger that can be used to log information about processing.
-
logInfo
public void logInfo(java.lang.String message, java.lang.Object... args)
-
logDebug
public void logDebug(java.lang.String message, java.lang.Object... args)
-
logTrace
public void logTrace(java.lang.String message, java.lang.Object... args)
-
getQueryId
public java.lang.String getQueryId()
- Specified by:
getQueryId
in interfaceQueryController
-
getBlockId
public long getBlockId(long time)
Description copied from interface:QueryController
Returns which block the time belongs to. Generally, will be some multiple of the block window on top of the start time. There is one special case that we accommodate: seed values. Those belong to a block BEFORE the start time. For that reason, we calculate everything off of the start time, and not the block end.- Specified by:
getBlockId
in interfaceQueryController
-
getBlockSize
public long getBlockSize()
Description copied from interface:QueryController
Returns the size of the blocks in milliseconds. Will be 0 if the results should be raw data.- Specified by:
getBlockSize
in interfaceQueryController
- Returns:
- time in milliseconds covered by each block.
-
getQueryStart
public long getQueryStart()
- Specified by:
getQueryStart
in interfaceQueryController
-
getQueryEnd
public long getQueryEnd()
- Specified by:
getQueryEnd
in interfaceQueryController
-
getQueryParameters
public TagHistoryQueryParams getQueryParameters()
Description copied from interface:QueryController
The parameters for the current query.- Specified by:
getQueryParameters
in interfaceQueryController
-
-