Class GatheringChannelWriter
java.lang.Object
io.deephaven.enterprise.binlog.writer.GatheringChannelWriter
- All Implemented Interfaces:
SinglePartitionWriter,Closeable,AutoCloseable
- Direct Known Subclasses:
BinaryLogFileWriter
A
SinglePartitionWriter for a GatheringByteChannel. Does not add any additional framing to the bytes
before writing to the underlying channel.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Callcloseon the underlyingGatheringByteChannel.final voidwriteDataToPartition(int numRows, @NotNull ByteBuffer buffer) Write all the row data to the partition.
-
Constructor Details
-
GatheringChannelWriter
-
-
Method Details
-
writeDataToPartition
public final void writeDataToPartition(int numRows, @NotNull @NotNull ByteBuffer buffer) throws IOException Description copied from interface:SinglePartitionWriterWrite all the row data to the partition.A write operation will return only after writing all the bytes, with the
buffer's position moved to its limit.On error, the
buffer's position will have been updated to account for the data that was successfully written; though, it is not safe to reuse this interface in an attempt to re-write the data (given the stateful nature of this interface).This is not meant to be called by third parties; the signature and documentation for this method is subject to change at any time.
This method is not guaranteed to be thread-safe. The assumption is that the caller only calls this method from exactly one thread, or uses concurrency control primitives that create a happens-before barrier between calls.
- Specified by:
writeDataToPartitionin interfaceSinglePartitionWriter- Parameters:
numRows- the number of rows represented inbuffer, must be positivebuffer- the buffer to write- Throws:
IOException- if an IO error occurred
-
close
Callcloseon the underlyingGatheringByteChannel.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSinglePartitionWriter- Throws:
IOException- If some other I/O error occurs
-