Interface SegmentWriter

All Known Implementing Classes:
DefaultSegmentWriter

public interface SegmentWriter
Converts nodes, properties, values, etc. to records and persists them.
  • Method Details

    • flush

      void flush() throws IOException
      Throws:
      IOException
    • writeBlob

      @NotNull @NotNull RecordId writeBlob(@NotNull @NotNull Blob blob) throws IOException
      Write a blob (as list of block records)
      Parameters:
      blob - blob to write
      Returns:
      the record id of the blob written
      Throws:
      IOException
    • writeStream

      @NotNull @NotNull RecordId writeStream(@NotNull @NotNull InputStream stream) throws IOException
      Writes a stream value record. The given stream is consumed and closed by this method.
      Parameters:
      stream - stream to be written
      Returns:
      the record id of the stream written
      Throws:
      IOException - if the input stream could not be read or the output could not be written
    • writeNode

      @NotNull @NotNull RecordId writeNode(@NotNull @NotNull NodeState state, @Nullable @Nullable Buffer stableIdBytes) throws IOException
      Write a node state. If non null, the passed stableId will be assigned to the persisted node. Otherwise the stable id will be inferred from state.
      Parameters:
      state - node state to write
      stableIdBytes - the stableId that should be assigned to the node or null.
      Returns:
      the record id of the segment node state written
      Throws:
      IOException
    • writeNode

      @NotNull default @NotNull RecordId writeNode(@NotNull @NotNull NodeState state) throws IOException
      Write a node state.

      Equivalent to writeNode(state, null)

      Throws:
      IOException
      See Also: