Interface Storage<T>


public interface Storage<T>
Storage driver interface used by the SBK harness.

Driver implementations provide the plumbing to create reader and writer instances, parse and handle driver-specific command-line arguments, and manage the storage client's lifecycle. The harness uses this abstraction to remain storage-agnostic and to execute uniform benchmark workloads.

Key responsibilities for implementations:

Implementation notes:

  • The default getDataType() returns a ByteArray for convenience; override it when your driver works with a different payload type.
  • All driver methods may throw IOException when I/O failures occur; the harness will surface these back to the user and stop the benchmark run.
  • Method Details

    • addArgs

      void addArgs(InputOptions params) throws IllegalArgumentException
      Add the driver specific command line arguments.
      Parameters:
      params - Parameters object to be extended.
      Throws:
      IllegalArgumentException - If an exception occurred.
    • parseArgs

      void parseArgs(ParameterOptions params) throws IllegalArgumentException
      Parse the driver specific command line arguments.
      Parameters:
      params - Parameters object to be parsed for driver specific parameters/arguments.
      Throws:
      IllegalArgumentException - If an exception occurred.
    • openStorage

      void openStorage(ParameterOptions params) throws IOException
      Open the storage device / client to perform the benchmarking.
      Parameters:
      params - Parameters object enclosing all commandline arguments, see ParameterOptions to get the basic benchmarking parameters.
      Throws:
      IOException - If an exception occurred.
    • closeStorage

      void closeStorage(ParameterOptions params) throws IOException
      Close the Storage device / client.
      Parameters:
      params - Parameters object enclosing all commandline arguments, see ParameterOptions to get the basic benchmarking parameters.
      Throws:
      IOException - If an exception occurred.
    • createWriter

      DataWriter<T> createWriter(int id, ParameterOptions params) throws IOException
      Create a Single Data Writer / Producer.
      Parameters:
      id - Writer id
      params - Parameters object enclosing all commandline arguments, see ParameterOptions to get the basic benchmarking parameters.
      Returns:
      Writer return the Writer , null in case of failure
      Throws:
      IOException - If an exception occurred.
    • createReader

      DataReader<T> createReader(int id, ParameterOptions params) throws IOException
      Create a Single Reader / Consumer.
      Parameters:
      id - Reader id
      params - Parameters object enclosing all commandline arguments, see ParameterOptions to get the basic benchmarking parameters.
      Returns:
      Reader return the Reader , null in case of failure
      Throws:
      IOException - If an exception occurred.
    • getDataType

      default DataType<T> getDataType() throws IllegalArgumentException
      Default implementation to create a payload or data to write/read. Default data type is byte[]. If your Benchmark data type is other than byte[] then you need to implement your own Data class. If the data type of your Benchmark, Reader and Writer classes is byte[] (Byte Array), then use this default implementation as it is.
      Returns:
      Data Data interface.
      Throws:
      IllegalArgumentException - if data type is other than byte[]