Package io.sbk.api
Class AbstractCallbackReader<T>
java.lang.Object
io.sbk.api.AbstractCallbackReader<T>
- All Implemented Interfaces:
DataReader<T>
Abstract class for Callback Reader.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
Close the CallBack Reader.void
complete()
Default Implementation complete the read.void
initialize
(Worker reader, long secondsToRun, long recordsCount, DataType<T> dType, io.time.Time time, Callback<T> callback) Default Implementation to initialize the callback reader.void
recordBenchmark
(long startTime, long endTime, int dataSize, int events) Keeps record of Benchmark if record gets completed it call complete function.void
RecordsReader
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time) Implementation for benchmarking reader by reading given number of records.void
RecordsReader
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) Implementation for benchmarking reader by reading given number of records.void
RecordsReaderRateControl
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController) Benchmarking reader by reading given number of records with Rate controlled.void
RecordsReaderRateControl
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) Benchmarking reader by reading given number of records with Rate controlled.void
RecordsReaderRW
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time) Default implementation for benchmarking reader by reading given number of records.void
RecordsReaderRW
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) Default implementation for benchmarking reader by reading given number of records.void
RecordsReaderRWRateControl
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController) Benchmarking reader by reading given number of records with Rate controlled.void
RecordsReaderRWRateControl
(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) Benchmarking reader by reading given number of records with Rate controlled.void
RecordsTimeReader
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time) Default implementation for benchmarking reader by reading events/records for specific time duration.void
RecordsTimeReader
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) Default implementation for benchmarking reader by reading events/records for specific time duration.void
RecordsTimeReaderRateControl
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController) Benchmarking reader by reading events/records for specific time duration with Rate controlled.void
RecordsTimeReaderRateControl
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) Benchmarking reader by reading events/records for specific time duration with Rate controlled.void
RecordsTimeReaderRW
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time) Default implementation for benchmarking reader by reading events/records for specific time duration.void
RecordsTimeReaderRW
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) Default implementation for benchmarking reader by reading events/records for specific time duration.void
RecordsTimeReaderRWRateControl
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController) Benchmarking reader by reading events/records for specific time duration with Rate controlled.void
RecordsTimeReaderRWRateControl
(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) Benchmarking reader by reading events/records for specific time duration with Rate controlled.void
run
(Worker reader, long secondsToRun, long recordsCount, DataType<T> dType, io.time.Time time, Callback<T> callback) Default Implementation run the Benchmark.abstract void
set the Callback and start the CallBack Reader.abstract void
stop()
Stop the CallBack Reader.void
Default Implementation to wait for the readers to complete.
-
Constructor Details
-
AbstractCallbackReader
public AbstractCallbackReader()
-
-
Method Details
-
start
set the Callback and start the CallBack Reader.- Parameters:
callback
- Reader callback.- Throws:
IOException
- If an exception occurred.
-
stop
Stop the CallBack Reader.- Throws:
IOException
- If an exception occurred.
-
close
Close the CallBack Reader. stops the callback reader.- Specified by:
close
in interfaceDataReader<T>
- Throws:
IOException
- If an exception occurred.
-
recordBenchmark
public void recordBenchmark(long startTime, long endTime, int dataSize, int events) Keeps record of Benchmark if record gets completed it call complete function.- Parameters:
startTime
- longendTime
- longdataSize
- intevents
- int
-
initialize
public void initialize(Worker reader, long secondsToRun, long recordsCount, DataType<T> dType, io.time.Time time, Callback<T> callback) throws IOException Default Implementation to initialize the callback reader.- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to runrecordsCount
- Records countdType
- dataTypetime
- time interfacecallback
- Callback interface- Throws:
IOException
- If an exception occurred.
-
complete
public void complete()Default Implementation complete the read. -
waitToComplete
Default Implementation to wait for the readers to complete.- Throws:
IOException
- If an exception occurred.
-
run
public void run(Worker reader, long secondsToRun, long recordsCount, DataType<T> dType, io.time.Time time, Callback<T> callback) throws IOException Default Implementation run the Benchmark.- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to runrecordsCount
- Records countdType
- dataTypetime
- time interfacecallback
- Callback interface- Throws:
IOException
- If an exception occurred.
-
RecordsReader
public void RecordsReader(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time) throws EOFException, IOException Implementation for benchmarking reader by reading given number of records.- Specified by:
RecordsReader
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interface- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReader
public void RecordsReader(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) throws EOFException, IOException Implementation for benchmarking reader by reading given number of records.- Specified by:
RecordsReader
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interfacelogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReaderRW
public void RecordsReaderRW(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time) throws EOFException, IOException Default implementation for benchmarking reader by reading given number of records.- Specified by:
RecordsReaderRW
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interface- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReaderRW
public void RecordsReaderRW(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) throws EOFException, IOException Default implementation for benchmarking reader by reading given number of records.- Specified by:
RecordsReaderRW
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interfacelogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReader
public void RecordsTimeReader(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time) throws EOFException, IOException Default implementation for benchmarking reader by reading events/records for specific time duration.- Specified by:
RecordsTimeReader
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interface- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReader
public void RecordsTimeReader(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) throws EOFException, IOException Default implementation for benchmarking reader by reading events/records for specific time duration.- Specified by:
RecordsTimeReader
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interfacelogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReaderRW
public void RecordsTimeReaderRW(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time) throws EOFException, IOException Default implementation for benchmarking reader by reading events/records for specific time duration.- Specified by:
RecordsTimeReaderRW
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interface- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReaderRW
public void RecordsTimeReaderRW(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, ReadRequestsLogger logger) throws EOFException, IOException Default implementation for benchmarking reader by reading events/records for specific time duration.- Specified by:
RecordsTimeReaderRW
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interfacelogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReaderRateControl
public void RecordsReaderRateControl(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController) throws EOFException, IOException Benchmarking reader by reading given number of records with Rate controlled.- Specified by:
RecordsReaderRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interfacerController
- Rate Controller- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReaderRateControl
public void RecordsReaderRateControl(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) throws EOFException, IOException Benchmarking reader by reading given number of records with Rate controlled.- Specified by:
RecordsReaderRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interfacerController
- Rate Controllerlogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReaderRWRateControl
public void RecordsReaderRWRateControl(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController) throws EOFException, IOException Benchmarking reader by reading given number of records with Rate controlled. used while another writer is writing the data.- Specified by:
RecordsReaderRWRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interfacerController
- Rate Controller- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsReaderRWRateControl
public void RecordsReaderRWRateControl(Worker reader, long recordsCount, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) throws EOFException, IOException Benchmarking reader by reading given number of records with Rate controlled. used while another writer is writing the data.- Specified by:
RecordsReaderRWRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorrecordsCount
- Records countdType
- dataTypetime
- time interfacerController
- Rate Controllerlogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReaderRateControl
public void RecordsTimeReaderRateControl(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController) throws EOFException, IOException Benchmarking reader by reading events/records for specific time duration with Rate controlled.- Specified by:
RecordsTimeReaderRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interfacerController
- Rate Controller- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReaderRateControl
public void RecordsTimeReaderRateControl(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) throws EOFException, IOException Benchmarking reader by reading events/records for specific time duration with Rate controlled.- Specified by:
RecordsTimeReaderRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interfacerController
- Rate Controllerlogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReaderRWRateControl
public void RecordsTimeReaderRWRateControl(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController) throws EOFException, IOException Benchmarking reader by reading events/records for specific time duration with Rate controlled. used while another writer is writing the data.- Specified by:
RecordsTimeReaderRWRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interfacerController
- Rate Controller- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-
RecordsTimeReaderRWRateControl
public void RecordsTimeReaderRWRateControl(Worker reader, long secondsToRun, DataType<T> dType, io.time.Time time, RateController rController, ReadRequestsLogger logger) throws EOFException, IOException Benchmarking reader by reading events/records for specific time duration with Rate controlled. used while another writer is writing the data.- Specified by:
RecordsTimeReaderRWRateControl
in interfaceDataReader<T>
- Parameters:
reader
- Reader DescriptorsecondsToRun
- Number of seconds to rundType
- dataTypetime
- time interfacerController
- Rate Controllerlogger
- log read requests- Throws:
EOFException
- If the End of the file occurred.IOException
- If an exception occurred.
-