Package io.sbk.api
Interface Writer<T>
- All Superinterfaces:
DataRecordsWriter<T>
,DataWriter<T>
Interface for Writers.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close the Writer.default void
recordWrite
(DataType<T> dType, T data, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel) Default implementation for writing data usingwrite(DataType, Object, int, Time, Status)
and recording the benchmark statistics.default void
recordWrite
(DataType<T> dType, T data, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel, int id, WriteRequestsLogger logger) Default implementation for writing data usingwrite(DataType, Object, int, Time, Status)
and recording the benchmark statistics.default void
sync()
Flush / Sync the data.default CompletableFuture<?>
Default implementation for writing data usingwriteAsync(Object)
)} with start time.default CompletableFuture<?>
write
(DataType<T> dType, T data, int size, io.time.Time time, Status status, int id, WriteRequestsLogger logger) Default implementation for writing data usingwriteAsync(Object)
)} with start time.writeAsync
(T data) Asynchronously Writes the data .default void
writeSetTime
(DataType<T> dType, T data, int size, io.time.Time time, Status status) Default implementation for writing data usingwriteAsync(Object)
with start time If you are intend to NOT use the CompletableFuture returned bywriteAsync(Object)
)} then you can override this method.default void
writeSetTime
(DataType<T> dType, T data, int size, io.time.Time time, Status status, int id, WriteRequestsLogger logger) Default implementation for writing data usingwriteAsync(Object)
with start time If you are intend to NOT use the CompletableFuture returned bywriteAsync(Object)
)} then you can override this method.Methods inherited from interface io.sbk.api.DataRecordsWriter
RecordsWriter, RecordsWriter, RecordsWriterRO, RecordsWriterRO, RecordsWriterRW, RecordsWriterRW, RecordsWriterSync, RecordsWriterSync, RecordsWriterTime, RecordsWriterTime, RecordsWriterTimeRO, RecordsWriterTimeRO, RecordsWriterTimeRW, RecordsWriterTimeRW, RecordsWriterTimeSync, RecordsWriterTimeSync
-
Method Details
-
writeAsync
Asynchronously Writes the data .- Parameters:
data
- data to write- Returns:
- CompletableFuture completable future. null if write completed synchronously .
- Throws:
IOException
- If an exception occurred.
-
close
Close the Writer.- Specified by:
close
in interfaceDataWriter<T>
- Throws:
IOException
- If an exception occurred.
-
sync
Flush / Sync the data.- Specified by:
sync
in interfaceDataRecordsWriter<T>
- Throws:
IOException
- If an exception occurred.
-
write
default CompletableFuture<?> write(DataType<T> dType, T data, int size, io.time.Time time, Status status) throws IOException Default implementation for writing data usingwriteAsync(Object)
)} with start time. If you are intend to NOT use the CompletableFuture returned bywriteAsync(Object)
)} then you can override this method. otherwise, use the default implementation and don't override this method. If you are intend to use your own payload, then also you can use override this method. you can write multiple records with this method.- Specified by:
write
in interfaceDataRecordsWriter<T>
- Parameters:
dType
- Data Type interfacedata
- data to writersize
- size of the datatime
- time interfacestatus
- write status to return- Returns:
- CompletableFuture completable future. null if write completed synchronously .
- Throws:
IOException
- If an exception occurred.
-
write
default CompletableFuture<?> write(DataType<T> dType, T data, int size, io.time.Time time, Status status, int id, WriteRequestsLogger logger) throws IOException Default implementation for writing data usingwriteAsync(Object)
)} with start time. If you are intend to NOT use the CompletableFuture returned bywriteAsync(Object)
)} then you can override this method. otherwise, use the default implementation and don't override this method. If you are intend to use your own payload, then also you can use override this method. you can write multiple records with this method.- Specified by:
write
in interfaceDataRecordsWriter<T>
- Parameters:
dType
- Data Type interfacedata
- data to writersize
- size of the datatime
- time interfacestatus
- write status to returnid
- Writer idlogger
- log writer requests- Returns:
- CompletableFuture completable future. null if write completed synchronously .
- Throws:
IOException
- If an exception occurred.
-
writeSetTime
default void writeSetTime(DataType<T> dType, T data, int size, io.time.Time time, Status status) throws IOException Default implementation for writing data usingwriteAsync(Object)
with start time If you are intend to NOT use the CompletableFuture returned bywriteAsync(Object)
)} then you can override this method. otherwise, use the default implementation and don't override this method. If you are intend to use your own payload, then also you can use override this method. you can write multiple records with this method.- Specified by:
writeSetTime
in interfaceDataRecordsWriter<T>
- Parameters:
dType
- Data Type interfacedata
- data to writersize
- size of the datatime
- time interfacestatus
- write status to return- Throws:
IOException
- If an exception occurred.
-
writeSetTime
default void writeSetTime(DataType<T> dType, T data, int size, io.time.Time time, Status status, int id, WriteRequestsLogger logger) throws IOException Default implementation for writing data usingwriteAsync(Object)
with start time If you are intend to NOT use the CompletableFuture returned bywriteAsync(Object)
)} then you can override this method. otherwise, use the default implementation and don't override this method. If you are intend to use your own payload, then also you can use override this method. you can write multiple records with this method.- Specified by:
writeSetTime
in interfaceDataRecordsWriter<T>
- Parameters:
dType
- Data Type interfacedata
- data to writersize
- size of the datatime
- time interfacestatus
- write status to returnid
- Writer idlogger
- log writer requests- Throws:
IOException
- If an exception occurred.
-
recordWrite
default void recordWrite(DataType<T> dType, T data, int size, io.time.Time time, Status status, io.perl.api.PerlChannel perlChannel) throws IOException Default implementation for writing data usingwrite(DataType, Object, int, Time, Status)
and recording the benchmark statistics. If you are intend to NOT use the CompletableFuture returned bywrite(DataType, Object, int, Time, Status)
then you can override this method. otherwise, use the default implementation and don't override this method. If you are intend to use your own payload, then also you can use override this method. you can write multiple records with this method.- Specified by:
recordWrite
in interfaceDataRecordsWriter<T>
- Parameters:
dType
- Data Type interfacedata
- data to writesize
- size of the datatime
- time interfacestatus
- Write status to returnperlChannel
- to call for benchmarking- Throws:
IOException
- If an exception occurred.
-
recordWrite
default 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 Default implementation for writing data usingwrite(DataType, Object, int, Time, Status)
and recording the benchmark statistics. If you are intend to NOT use the CompletableFuture returned bywrite(DataType, Object, int, Time, Status)
then you can override this method. otherwise, use the default implementation and don't override this method. If you are intend to use your own payload, then also you can use override this method. you can write multiple records with this method.- Specified by:
recordWrite
in interfaceDataRecordsWriter<T>
- Parameters:
dType
- Data Type interfacedata
- data to writesize
- size of the datatime
- time interfacestatus
- Write status to returnperlChannel
- to call for benchmarkingid
- Writer idlogger
- log writer requests- Throws:
IOException
- If an exception occurred.
-