Class 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
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • 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
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        equals, hashCode
    • 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)
      • 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 interface QueryController
      • 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 interface QueryController
        Returns:
        time in milliseconds covered by each block.