Class GatheringChannelWriter

java.lang.Object
io.deephaven.enterprise.binlog.writer.GatheringChannelWriter
All Implemented Interfaces:
SinglePartitionWriter, Closeable, AutoCloseable
Direct Known Subclasses:
BinaryLogFileWriter

public abstract class GatheringChannelWriter extends Object implements SinglePartitionWriter
A SinglePartitionWriter for a GatheringByteChannel. Does not add any additional framing to the bytes before writing to the underlying channel.
  • Constructor Details

  • Method Details

    • writeDataToPartition

      public final void writeDataToPartition(int numRows, @NotNull @NotNull ByteBuffer buffer) throws IOException
      Description copied from interface: SinglePartitionWriter
      Write 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:
      writeDataToPartition in interface SinglePartitionWriter
      Parameters:
      numRows - the number of rows represented in buffer, must be positive
      buffer - the buffer to write
      Throws:
      IOException - if an IO error occurred
    • close

      public final void close() throws IOException
      Call close on the underlying GatheringByteChannel.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface SinglePartitionWriter
      Throws:
      IOException - If some other I/O error occurs