Interface Callback<T>

Type Parameters:
T - Flexible parameter
All Known Implementing Classes:
SbkCallbackReader

public interface Callback<T>
Callback interface used by callback-driven drivers to receive data and optionally report per-record benchmarking metrics.

Drivers that provide a callback-style API may implement this interface to bridge into SBK's metric reporting. The record method is a convenience to report pre-computed timing and size information; it has a default no-op implementation so callback-only drivers can ignore it.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    consume(T data)
    Consume the data.
    default void
    record(long startTime, long endTime, int dataSize, int records)
    Accept the benchmarking data.
  • Method Details

    • consume

      void consume(T data)
      Consume the data.
      Parameters:
      data - data read from storage client/device.
    • record

      default void record(long startTime, long endTime, int dataSize, int records)
      Accept the benchmarking data. if your storage driver is not interested in passing the data read; then below method can be overridden.
      Parameters:
      startTime - Start time
      endTime - End Time.
      dataSize - size of the data in bytes.
      records - number of records/events/messages.