Interface SegmentWriter
-
- All Known Implementing Classes:
DefaultSegmentWriter
public interface SegmentWriterConverts nodes, properties, values, etc. to records and persists them.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidflush()@NotNull RecordIdwriteBlob(@NotNull Blob blob)Write a blob (as list of block records)default @NotNull RecordIdwriteNode(@NotNull NodeState state)Write a node state.@NotNull RecordIdwriteNode(@NotNull NodeState state, @Nullable Buffer stableIdBytes)Write a node state.@NotNull RecordIdwriteStream(@NotNull InputStream stream)Writes a stream value record.
-
-
-
Method Detail
-
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 passedstableIdwill be assigned to the persisted node. Otherwise the stable id will be inferred fromstate.- Parameters:
state- node state to writestableIdBytes- the stableId that should be assigned to the node ornull.- 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:
writeNode(NodeState, Buffer)
-
-