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 Summary
Modifier and TypeMethodDescriptionaddDomain(String domainName, DomainDefinition domain) Registers a node domain schema and its data sources.addFooterMetadata(String key, byte[] payload) Adds a raw binary metadata payload to the trailing footer.addFooterMetadata(String key, String value) Adds a custom key-value string metadata attribute to the trailing footer.addRelation(String relationName, RelationDefinition relation) Registers a relation schema and its edge data sources.static SnapshotBuildercreate()default byte[]Collects the snapshot binary directly into an in-memory byte array (useful for testing).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.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(long bytes) Configures maximum RAM limit in bytes for in-memory staging buffers before spilling to disk.default SnapshotBuilderwithVersion(short version) Configures target binary snapshot specification version (e.g. 9 for v0.9.0 or 10 for v0.10.0).default voidwriteTo(OutputStream out) Streams the snapshot binary to an OutputStream.voidwriteTo(WritableByteChannel channel) Sequentially streams the snapshot binary in a strict single-pass to the output channel.default voidWrites the snapshot binary direct to a file.
-
Method Details
-
create
-
withVersion
Configures target binary snapshot specification version (e.g. 9 for v0.9.0 or 10 for v0.10.0). -
withStagingDirectory
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
Configures maximum RAM limit in bytes for in-memory staging buffers before spilling to disk. -
withSignature
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
Registers a node domain schema and its data sources. -
addRelation
Registers a relation schema and its edge data sources. -
writeTo
Sequentially streams the snapshot binary in a strict single-pass to the output channel.- Throws:
IOException
-
writeTo
Streams the snapshot binary to an OutputStream.- Throws:
IOException
-
writeTo
Writes the snapshot binary direct to a file.- Throws:
IOException
-
toByteArray
Collects the snapshot binary directly into an in-memory byte array (useful for testing).- Throws:
IOException
-