Class SbkReader
java.lang.Object
io.sbk.api.Worker
io.sbk.api.impl.SbkReader
- All Implemented Interfaces:
io.perl.api.RunBenchmark
Reader Benchmarking Implementation.
This class adapts a DataReader into the SBK harness
by implementing the RunBenchmark contract. It wires the
reader instance with per-worker context (id, params, perlChannel) and
exposes a set of pre-built benchmark variants (time-based, count-based,
with/without rate control and optional per-request logging).
Key behavior:
- The
run(long,long)method executes asynchronously on the supplied executor and returns aCompletableFuture. - Depending on
ParameterOptions, the class selects specialized benchmark paths (e.g.RecordsReaderRateControl). - It uses
SbkRateControllerto pace reads when a records-per-second limit is provided.
Implementors and maintainers: keep this class focused on orchestration —
the actual I/O semantics live in the driver-provided DataReader
implementation, which may override default 'recordRead' helpers for batching
or more efficient reads.
-
Field Summary
Fields inherited from class Worker
id, params, perlChannel -
Constructor Summary
ConstructorsConstructorDescriptionSbkReader(int readerId, ParameterOptions params, io.perl.api.PerlChannel perlChannel, DataType<Object> dType, io.time.Time time, DataReader<Object> reader, CountReaders rCount, ReadRequestsLogger readRequestsLogger, ExecutorService executor) -
Method Summary
-
Constructor Details
-
SbkReader
public SbkReader(int readerId, ParameterOptions params, io.perl.api.PerlChannel perlChannel, DataType<Object> dType, io.time.Time time, DataReader<Object> reader, CountReaders rCount, ReadRequestsLogger readRequestsLogger, ExecutorService executor)
-
-
Method Details
-
run
public CompletableFuture<Void> run(long secondsToRun, long recordsCount) throws IOException, EOFException, IllegalStateException - Specified by:
runin interfaceio.perl.api.RunBenchmark- Throws:
IOExceptionEOFExceptionIllegalStateException
-