Interface SnapshotBuilder

All Known Implementing Classes:
StreamingSnapshotWriter

public interface SnapshotBuilder
Fluent builder entry point for streaming Impulse Binary Snapshots (.imps v0.9.0) with strict single-pass S3 semantics and bounded O(chunk) heap footprint.
  • Method Details

    • create

      static SnapshotBuilder create()
    • withVersion

      default SnapshotBuilder withVersion(short version)
      Configures target binary snapshot specification version (e.g. 9 for v0.9.0 or 10 for v0.10.0).
    • withStagingDirectory

      SnapshotBuilder withStagingDirectory(Path tempDir)
      Configures a local directory for staging temporary files (such as external sort runs when computing CSC from a source-sorted stream, or spilling large string pools).
    • withStagingMemoryLimit

      SnapshotBuilder withStagingMemoryLimit(long bytes)
      Configures maximum RAM limit in bytes for in-memory staging buffers before spilling to disk.
    • withSignature

      SnapshotBuilder withSignature(PrivateKey privateKey, List<Certificate> certChain)
      Cryptographically signs the mandatory SHA-256 payload checksum using the provided private key, embedding the signature and public certificate chain into the file footer.
    • addDomain

      SnapshotBuilder addDomain(String domainName, DomainDefinition domain)
      Registers a node domain schema and its data sources.
    • addRelation

      SnapshotBuilder addRelation(String relationName, RelationDefinition relation)
      Registers a relation schema and its edge data sources.
    • addFooterMetadata

      SnapshotBuilder addFooterMetadata(String key, String value)
      Adds a custom key-value string metadata attribute to the trailing footer.
    • addFooterMetadata

      SnapshotBuilder addFooterMetadata(String key, byte[] payload)
      Adds a raw binary metadata payload to the trailing footer.
    • writeTo

      void writeTo(WritableByteChannel channel) throws IOException
      Sequentially streams the snapshot binary in a strict single-pass to the output channel.
      Throws:
      IOException
    • writeTo

      default void writeTo(OutputStream out) throws IOException
      Streams the snapshot binary to an OutputStream.
      Throws:
      IOException
    • writeTo

      default void writeTo(Path path) throws IOException
      Writes the snapshot binary direct to a file.
      Throws:
      IOException
    • toByteArray

      default byte[] toByteArray() throws IOException
      Collects the snapshot binary directly into an in-memory byte array (useful for testing).
      Throws:
      IOException