Package io.sbk.api
Interface Storage<T>
public interface Storage<T>
Interface for Benchmarking.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addArgs
(InputOptions params) Add the driver specific command line arguments.void
closeStorage
(ParameterOptions params) Close the Storage device / client.createReader
(int id, ParameterOptions params) Create a Single Reader / Consumer.createWriter
(int id, ParameterOptions params) Create a Single Data Writer / Producer.Default implementation to create a payload or data to write/read.void
openStorage
(ParameterOptions params) Open the storage device / client to perform the benchmarking.void
parseArgs
(ParameterOptions params) Parse the driver specific command line arguments.
-
Method Details
-
addArgs
Add the driver specific command line arguments.- Parameters:
params
- Parameters object to be extended.- Throws:
IllegalArgumentException
- If an exception occurred.
-
parseArgs
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
Open the storage device / client to perform the benchmarking.- Parameters:
params
- Parameters object enclosing all commandline arguments, seeParameterOptions
to get the basic benchmarking parameters.- Throws:
IOException
- If an exception occurred.
-
closeStorage
Close the Storage device / client.- Parameters:
params
- Parameters object enclosing all commandline arguments, seeParameterOptions
to get the basic benchmarking parameters.- Throws:
IOException
- If an exception occurred.
-
createWriter
Create a Single Data Writer / Producer.- Parameters:
id
- Writer idparams
- Parameters object enclosing all commandline arguments, seeParameterOptions
to get the basic benchmarking parameters.- Returns:
- Writer return the Writer , null in case of failure
- Throws:
IOException
- If an exception occurred.
-
createReader
Create a Single Reader / Consumer.- Parameters:
id
- Reader idparams
- Parameters object enclosing all commandline arguments, seeParameterOptions
to get the basic benchmarking parameters.- Returns:
- Reader return the Reader , null in case of failure
- Throws:
IOException
- If an exception occurred.
-
getDataType
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[]
-