Class NetricsRecQuerySource

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getPosition()
      Get the position in the record source.
      int getQueriesProduced()
      Retrieve the number of queries produced.
      int getQueryLimit()
      Retrieve the query limit.
      boolean isEOS()
      Check if the scan is complete.
      KeyedQuery next()
      Gets the next query from the source.
      void setQueryLimit​(int limit)
      Set a limit on the number of queries produced.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NetricsRecQuerySource

        public NetricsRecQuerySource​(com.netrics.likeit.NetricsBaseRecSrc recSource,
                                     QueryBuilder<KeyedNetricsRecord> queryBuilder)
        Create a NetricsRecQuerySource instance.
        Parameters:
        recSource - A source of records to build queries from.
        queryBuilder - Defines how to build a KeyedQuery from a source record. (The row is represented as a NetricsBaseRecord.)
    • Method Detail

      • getPosition

        public java.lang.String getPosition()
        Get the position in the record source.
        Specified by:
        getPosition in interface KeyedQuerySource
        Returns:
        an opaque string indicating the scan position. This string can be stored and later passed into setPosition on another KeyedQuerySource instance of the same type.
      • isEOS

        public boolean isEOS()
                      throws com.netrics.likeit.NetricsRecSrcException
        Description copied from interface: KeyedQuerySource
        Check if the scan is complete.
        Specified by:
        isEOS in interface KeyedQuerySource
        Returns:
        true if there are no more queries available.
        Throws:
        com.netrics.likeit.NetricsRecSrcException
      • next

        public KeyedQuery next()
                        throws com.netrics.likeit.NetricsRecSrcException,
                               QueryBuildException
        Description copied from interface: KeyedQuerySource
        Gets the next query from the source.
        Specified by:
        next in interface KeyedQuerySource
        Returns:
        The query. Returns null if no query is desired for the particular source entry. (This allows for consistent batch sizing.)
        Throws:
        com.netrics.likeit.NetricsRecSrcException
        QueryBuildException
      • setQueryLimit

        public void setQueryLimit​(int limit)
        Set a limit on the number of queries produced.
        Parameters:
        limit - The limit. Set to 0 for no limit.
      • getQueryLimit

        public int getQueryLimit()
        Retrieve the query limit.
        Returns:
        The query limit, or 0 if there is no limit.
      • getQueriesProduced

        public int getQueriesProduced()
        Retrieve the number of queries produced.
        Returns:
        The number of queries produced.