Interface DaqReader<T extends java.io.Serializable>

  • Type Parameters:
    T - Data record type.
    All Superinterfaces:
    java.lang.AutoCloseable, DaqMXBean
    All Known Subinterfaces:
    DaqWriter<T>, NumericReader, NumericWriter

    public interface DaqReader<T extends java.io.Serializable>
    extends DaqMXBean, java.lang.AutoCloseable
    Generic DAQ DAO.
    Author:
    Dmitry Ovchinnikov.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DataRecord<T> fetchRecord​(long tag, long instant)
      Get a tag record by tag and timestamp.
      java.util.List<DataRecord<T>> fetchRecords​(long[] tags, long from, long to)
      Fetches all the records within the given time range.
      java.util.Map<java.lang.Long,​java.lang.String> hash​(long from, long to, boolean includeData, java.lang.String algorithm)
      Hashes record range.
      long tagCount​(long from, long to)
      Get tag count within the given time range.
      long[] tags​(long from, long to)
      Get all tags within the given time range.
      • Methods inherited from interface java.lang.AutoCloseable

        close
    • Method Detail

      • tags

        long[] tags​(long from,
                    long to)
        Get all tags within the given time range.
        Parameters:
        from - Lower bound (inclusive).
        to - Upper bound (exclusive).
        Returns:
        Tag set.
      • tagCount

        long tagCount​(long from,
                      long to)
        Get tag count within the given time range.
        Parameters:
        from - Lower bound (inclusive).
        to - Upper bound (exclusive).
        Returns:
        Tag count.
      • fetchRecord

        DataRecord<T> fetchRecord​(long tag,
                                  long instant)
        Get a tag record by tag and timestamp.
        Parameters:
        tag - Record tag.
        instant - Timestamp.
        Returns:
        Data record.
      • fetchRecords

        java.util.List<DataRecord<T>> fetchRecords​(long[] tags,
                                                   long from,
                                                   long to)
        Fetches all the records within the given time range.
        Parameters:
        tags - Tags to be fetched.
        from - Lower bound (inclusive).
        to - Upper bound (exclusive).
        Returns:
        Fetched records.
      • hash

        java.util.Map<java.lang.Long,​java.lang.String> hash​(long from,
                                                                  long to,
                                                                  boolean includeData,
                                                                  java.lang.String algorithm)
        Hashes record range.
        Parameters:
        from - Lower bound (inclusive).
        to - Upper bound (exclusive).
        includeData - Whether include data or not.
        algorithm - Digest algorithm (e.g. SHA-1 or MD5).
        Returns:
        Hashes.