Interface DataRecordsWriter<T>

Type Parameters:
T - storage record type
All Superinterfaces:
DataWriter<T>
All Known Subinterfaces:
Writer<T>

public sealed interface DataRecordsWriter<T> extends DataWriter<T> permits Writer<T>
Higher-level writer abstraction that exposes methods for recording write metrics and provides default harness-driven write workloads.

This interface builds on the lower-level DataWriter abstraction and adds methods that the SBK harness uses to measure and report write performance. Implementations should implement the low-level write operations (see write(DataType, Object, int, Time, Status)) and may override the default convenience methods provided here to implement batching, backpressure handling, or driver-specific optimizations.

The interface's default methods provide standard benchmark workloads such as fixed-count writes, time-based writes, and rate-controlled writes. These default implementations delegate to recordWrite(DataType, T, int, Time, Status, PerlChannel) or write(DataType, T, int, Time, Status) and call sync() where appropriate to ensure durability semantics expected by the harness. Use these helpers to avoid duplicating common harness logic in drivers.

Implementation notes:

  • Method Details

    • write

      CompletableFuture<?> write(DataType<T> dType, T data, int size, io.time.Time time, Status status) throws IOException
      Write the Data and attach the start time to data.
      Parameters:
      dType - Data Type interface
      data - data to writer
      size - size of the data
      time - time interface
      status - write status to return; Status
      Returns:
      CompletableFuture completable future. null if write completed synchronously .
      Throws:
      IOException - If an exception occurred.
    • write

      CompletableFuture<?> write(DataType<T> dType, T data, int size, io.time.Time time, Status status, int id, WriteRequestsLogger logger) throws IOException
      Write the Data and attach the start time to data.
      Parameters:
      dType - Data Type interface
      data - data to writer
      size - size of the data
      time - time interface
      status - write status to return; Status
      id - Writer id
      logger - Writer requests logger
      Returns:
      CompletableFuture completable future. null if write completed synchronously .
      Throws:
      IOException - If an exception occurred.
    • writeSetTime

      void writeSetTime(DataType<T> dType, T data, int size, io.time.Time time, Status status) throws IOException
      Write the Data and attach the start time to data.
      Parameters:
      dType - Data Type interface
      data - data to writer
      size - size of the data
      time - time interface
      status - write status to return; Status
      Throws:
      IOException - If an exception occurred.
    • writeSetTime

      void writeSetTime(DataType<T> dType, T data, int size, io.time.Time time, Status status, int id, WriteRequestsLogger logger) throws IOException
      Write the Data and attach the start time to data.
      Parameters:
      dType - Data Type interface
      data - data to writer
      size - size of the data
      time - time interface
      status - write status to return; Status
      id - Writer id
      logger - Write requests logger
      Throws:
      IOException - If an exception occurred.
    • sync

      void sync() throws IOException
      Flush / Sync the data.
      Throws:
      IOException - If an exception occurred.
    • recordWrite

      void recordWrite(DataType<T> dType, T data, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel) throws IOException
      Write the data and record the benchmark statistics.
      Parameters:
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      status - Write status to return; Status
      perlChannel - to call for benchmarking
      Throws:
      IOException - If an exception occurred.
    • recordWrite

      void recordWrite(DataType<T> dType, T data, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel, int id, WriteRequestsLogger logger) throws IOException
      Write the data and record the benchmark statistics.
      Parameters:
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      status - Write status to return; Status
      perlChannel - to call for benchmarking
      id - Writer id
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriter

      default void RecordsWriter(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Default implementation for writer benchmarking by writing given number of records. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing all the records.
      Specified by:
      RecordsWriter in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      Throws:
      IOException - If an exception occurred.
    • RecordsWriter

      default void RecordsWriter(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Default implementation for writer benchmarking by writing given number of records. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing all the records.
      Specified by:
      RecordsWriter in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterSync

      default void RecordsWriterSync(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, RateController rController) throws IOException
      Default implementation for writer benchmarking by writing given number of records. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterSync in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterSync

      default void RecordsWriterSync(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, RateController rController, WriteRequestsLogger logger) throws IOException
      Default implementation for writer benchmarking by writing given number of records. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterSync in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterBatch

      default void RecordsWriterBatch(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Writes a fixed number of records with periodic sync and no throughput controller.
      Parameters:
      writer - writer descriptor
      recordsCount - record count
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterBatch

      default void RecordsWriterBatch(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Writes a fixed number of records with request logging, periodic sync, and no throughput controller.
      Parameters:
      writer - writer descriptor
      recordsCount - record count
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      logger - request logger
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterTime

      default void RecordsWriterTime(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Default implementation for writer benchmarking by continuously writing data records for specific time duration. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing records for given time.
      Specified by:
      RecordsWriterTime in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTime

      default void RecordsWriterTime(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Default implementation for writer benchmarking by continuously writing data records for specific time duration. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing records for given time.
      Specified by:
      RecordsWriterTime in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeSync

      default void RecordsWriterTimeSync(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, RateController rController) throws IOException
      Default implementation for writer benchmarking by continuously writing data records for specific time duration. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterTimeSync in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeSync

      default void RecordsWriterTimeSync(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, RateController rController, WriteRequestsLogger logger) throws IOException
      Default implementation for writer benchmarking by continuously writing data records for specific time duration. Write is performed using recordWrite(DataType, Object, int, Time, Status, PerlChannel) sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterTimeSync in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeBatch

      default void RecordsWriterTimeBatch(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Writes for a duration with periodic sync and no throughput controller.
      Parameters:
      writer - writer descriptor
      secondsToRun - duration in seconds
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterTimeBatch

      default void RecordsWriterTimeBatch(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Writes for a duration with request logging, periodic sync, and no throughput controller.
      Parameters:
      writer - writer descriptor
      secondsToRun - duration in seconds
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      logger - request logger
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterRW

      default void RecordsWriterRW(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, RateController rController) throws IOException
      Default implementation for writing given number of records. No Writer Benchmarking is performed. Write is performed using writeSetTime(DataType, Object, int, Time, Status) . sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterRW in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterRW

      default void RecordsWriterRW(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, RateController rController, WriteRequestsLogger logger) throws IOException
      Default implementation for writing given number of records. No Writer Benchmarking is performed. Write is performed using writeSetTime(DataType, Object, int, Time, Status) . sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterRW in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeRW

      default void RecordsWriterTimeRW(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, RateController rController) throws IOException
      Default implementation for writing data records for specific time duration. No Writer Benchmarking is performed. Write is performed using writeSetTime(DataType, Object, int, Time, Status) . sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterTimeRW in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeRW

      default void RecordsWriterTimeRW(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, RateController rController, WriteRequestsLogger logger) throws IOException
      Default implementation for writing data records for specific time duration. No Writer Benchmarking is performed. Write is performed using writeSetTime(DataType, Object, int, Time, Status) . sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterTimeRW in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterRO

      default void RecordsWriterRO(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, RateController rController) throws IOException
      Default implementation for writing given number of records. No Writer Benchmarking is performed. Write is performed using write(DataType, Object, int, Time, Status). sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterRO in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterRO

      default void RecordsWriterRO(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, RateController rController, WriteRequestsLogger logger) throws IOException
      Default implementation for writing given number of records. No Writer Benchmarking is performed. Write is performed using write(DataType, Object, int, Time, Status). sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterRO in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      recordsCount - Records Count
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeRO

      default void RecordsWriterTimeRO(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, RateController rController) throws IOException
      Default implementation for writing data records for specific time duration. No Writer Benchmarking is performed. Write is performed using write(DataType, Object, int, Time, Status). sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterTimeRO in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterTimeRO

      default void RecordsWriterTimeRO(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, RateController rController, WriteRequestsLogger logger) throws IOException
      Default implementation for writing data records for specific time duration. No Writer Benchmarking is performed. Write is performed using write(DataType, Object, int, Time, Status). sync is invoked after writing given set of records.
      Specified by:
      RecordsWriterTimeRO in interface DataWriter<T>
      Parameters:
      writer - Writer Descriptor
      secondsToRun - Number of seconds to Run
      dType - Data Type interface
      data - data to write
      size - size of the data
      time - time interface
      rController - Rate Controller
      logger - log write requests
      Throws:
      IOException - If an exception occurred.
    • RecordsWriterRWNoRate

      default void RecordsWriterRWNoRate(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Writes unmeasured records for a concurrent reader without throughput control.
      Parameters:
      writer - writer descriptor
      recordsCount - record count
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterRWNoRate

      default void RecordsWriterRWNoRate(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Writes unmeasured records with request logging for a concurrent reader without throughput control.
      Parameters:
      writer - writer descriptor
      recordsCount - record count
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      logger - request logger
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterTimeRWNoRate

      default void RecordsWriterTimeRWNoRate(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Writes unmeasured records for a duration without throughput control.
      Parameters:
      writer - writer descriptor
      secondsToRun - duration in seconds
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterTimeRWNoRate

      default void RecordsWriterTimeRWNoRate(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Writes unmeasured records with request logging for a duration without throughput control.
      Parameters:
      writer - writer descriptor
      secondsToRun - duration in seconds
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      logger - request logger
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterRONoRate

      default void RecordsWriterRONoRate(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Writes records without measurement or throughput control.
      Parameters:
      writer - writer descriptor
      recordsCount - record count
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterRONoRate

      default void RecordsWriterRONoRate(Worker writer, long recordsCount, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Writes records with request logging and without measurement or throughput control.
      Parameters:
      writer - writer descriptor
      recordsCount - record count
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      logger - request logger
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterTimeRONoRate

      default void RecordsWriterTimeRONoRate(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time) throws IOException
      Writes records without measurement or throughput control for a duration.
      Parameters:
      writer - writer descriptor
      secondsToRun - duration in seconds
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      Throws:
      IOException - if writing or syncing fails
    • RecordsWriterTimeRONoRate

      default void RecordsWriterTimeRONoRate(Worker writer, long secondsToRun, DataType<T> dType, T data, int size, io.time.Time time, WriteRequestsLogger logger) throws IOException
      Writes records with request logging and without measurement or throughput control for a duration.
      Parameters:
      writer - writer descriptor
      secondsToRun - duration in seconds
      dType - data type
      data - payload
      size - payload size
      time - benchmark clock
      logger - request logger
      Throws:
      IOException - if writing or syncing fails