Package io.sbk.api

Interface AsyncReader<T>

All Superinterfaces:
DataReader<T>, DataRecordsReader<T>

public non-sealed interface AsyncReader<T> extends DataRecordsReader<T>
Interface for Asynchronous Readers.
  • Method Details

    • readAsync

      CompletableFuture<T> readAsync(int size) throws EOFException, IOException
      Read the dat asynchronously.
      Parameters:
      size - size of the data in bytes to read.
      Returns:
      Completable Future.
      Throws:
      EOFException - If the End of the file occurred.
      IOException - If an exception occurred.
    • close

      default void close() throws IOException
      Close the Reader.
      Specified by:
      close in interface DataReader<T>
      Throws:
      IOException - If an exception occurred.
    • recordRead

      default void recordRead(DataType<T> dType, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel) throws EOFException, IOException
      Default implementation for Reading data using readAsync(int) ()} and recording the benchmark statistics. The end time of the status parameter Status.endTime of this method determines the terminating condition for time based reader performance benchmarking. If you are intend to not use readAsync(int) ()} then you can override this method. If you are intend to read multiple records then you can override this method. otherwise, use the default implementation and don't override this method.
      Specified by:
      recordRead in interface DataRecordsReader<T>
      Parameters:
      dType - dataType
      size - size of the data in bytes
      time - time interface
      status - Timestamp
      perlChannel - to call for benchmarking
      Throws:
      EOFException - If the End of the file occurred.
      IOException - If an exception occurred.
    • recordRead

      default void recordRead(DataType<T> dType, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel, int id, ReadRequestsLogger logger) throws EOFException, IOException
      Default implementation for Reading data using readAsync(int) ()} and recording the benchmark statistics. The end time of the status parameter Status.endTime of this method determines the terminating condition for time based reader performance benchmarking. If you are intend to not use readAsync(int) ()} then you can override this method. If you are intend to read multiple records then you can override this method. otherwise, use the default implementation and don't override this method.
      Specified by:
      recordRead in interface DataRecordsReader<T>
      Parameters:
      dType - dataType
      size - size of the data in bytes
      time - time interface
      status - Timestamp
      perlChannel - to call for benchmarking
      id - reader id
      logger - Read Request logger
      Throws:
      EOFException - If the End of the file occurred.
      IOException - If an exception occurred.
    • recordReadTime

      default void recordReadTime(DataType<T> dType, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel) throws EOFException, IOException
      Default implementation for Reading data using Reader.read(), extracting start time from data and recording the benchmark statistics. The end time of the status parameter Status.endTime of this method determines the terminating condition for time based reader performance benchmarking. If you are intend to not use Reader.read() then you can override this method. If you are intend to read multiple records then you can override this method. otherwise, use the default implementation and don't override this method.
      Specified by:
      recordReadTime in interface DataRecordsReader<T>
      Parameters:
      dType - dataType
      size - size of the data in bytes
      time - time interface
      status - Timestamp
      perlChannel - to call for benchmarking
      Throws:
      EOFException - If the End of the file occurred.
      IOException - If an exception occurred.
    • recordReadTime

      default void recordReadTime(DataType<T> dType, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel, int id, ReadRequestsLogger logger) throws EOFException, IOException
      Default implementation for Reading data using Reader.read(), extracting start time from data and recording the benchmark statistics. The end time of the status parameter Status.endTime of this method determines the terminating condition for time based reader performance benchmarking. If you are intend to not use Reader.read() then you can override this method. If you are intend to read multiple records then you can override this method. otherwise, use the default implementation and don't override this method.
      Specified by:
      recordReadTime in interface DataRecordsReader<T>
      Parameters:
      dType - dataType
      size - size of the data in bytes
      time - time interface
      status - Timestamp
      perlChannel - to call for benchmarking
      id - reader id
      logger - Read Request logger
      Throws:
      EOFException - If the End of the file occurred.
      IOException - If an exception occurred.