Class 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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected LoggerEx ganLogger  
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 return DelegatingHistoryNodes, which get filled in later.
        Specified by:
        getColumnNodes in interface HistoryQueryExecutor
      • 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 interface HistoryQueryExecutor
      • closeStream

        protected void closeStream()
      • 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 interface HistoryQueryExecutor
        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 interface HistoryQueryExecutor
        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 interface HistoryQueryExecutor
      • 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 interface HistoryQueryExecutor
      • 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 interface HistoryQueryExecutor
        Throws:
        java.lang.Exception