Class CsvManifestSnapshotBuilder
java.lang.Object
org.impulsegraph.builder.csv.CsvManifestSnapshotBuilder
Pure-Java builder utility (zero external dependencies beyond JDK) that parses
an
e2e-csv-suite/manifest.json specification and its referenced
domains/*.csv and relations/*.csv files to produce a
compliant Impulse Binary Snapshot (.imps v0.9.0).
Provides two pure-Java build paths:
buildFullV09Snapshot(Path, Path): Writes the complete v0.9.0 binary layout including Section 2 Shared String Table, 16-byte Domain Catalog entries, 128-byte Relation Directory entries, interleaved 44-byte Attribute Descriptors (both relation attributes and domain attributes), 128-byte-padded nullable validity bitmaps (0x80typeCode flag), CSR/CSC segments, and Footer metadata/CRC-64/SHA-256 trailer.buildViaStreamingSnapshotWriter(Path, Path): Builds the snapshot through theSnapshotBuilder(StreamingSnapshotWriter) API for direct comparison and verification ofStreamingSnapshotWriterbehavior (which currently writesattr_count = 0andkey_type = 0x03).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final recordstatic final recordstatic final classMinimal zero-dependency recursive descent JSON parser for manifest.json.static final recordstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final bytestatic final intstatic final intstatic final shortstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildFullV09Snapshot(Path manifestPath, Path outputPath) Builds a full v0.9.0 compliant.impssnapshot (including all relation and domain attributes, 128-byte-padded nullable validity bitmaps, CSR/CSC topologies, and CRC/SHA-256 footer) and writes it tooutputPath.static byte[]buildFullV09SnapshotBytes(Path manifestPath) Builds a full v0.9.0 compliant.impssnapshot in memory and returns the raw bytes.static voidbuildViaStreamingSnapshotWriter(Path manifestPath, Path outputPath) static shortcomputeCrc16Ccitt(byte[] data, int offset, int length) static longcomputeCrc64Ecma(byte[] data, int offset, int length) parseDomainCsv(Path csvPath, CsvManifestSnapshotBuilder.DomainSpec spec) parseManifest(Path manifestPath) Parsesmanifest.jsonat the given path.parseRelationCsv(Path csvPath, CsvManifestSnapshotBuilder.RelationSpec spec, CsvManifestSnapshotBuilder.ParsedDomainData srcDom, CsvManifestSnapshotBuilder.ParsedDomainData tgtDom)
-
Field Details
-
SPEC_MAGIC
public static final int SPEC_MAGIC- See Also:
-
SPEC_VERSION
public static final short SPEC_VERSION- See Also:
-
HEADER_SIZE
public static final int HEADER_SIZE- See Also:
-
ALIGNMENT
public static final int ALIGNMENT- See Also:
-
TYPE_INT8
public static final byte TYPE_INT8- See Also:
-
TYPE_INT16
public static final byte TYPE_INT16- See Also:
-
TYPE_INT32
public static final byte TYPE_INT32- See Also:
-
TYPE_INT64
public static final byte TYPE_INT64- See Also:
-
TYPE_FLOAT32
public static final byte TYPE_FLOAT32- See Also:
-
TYPE_FLOAT64
public static final byte TYPE_FLOAT64- See Also:
-
TYPE_STRING
public static final byte TYPE_STRING- See Also:
-
FLAG_NULLABLE
public static final byte FLAG_NULLABLE- See Also:
-
-
Method Details
-
parseManifest
public static CsvManifestSnapshotBuilder.ManifestSpec parseManifest(Path manifestPath) throws IOException Parsesmanifest.jsonat the given path.- Throws:
IOException
-
buildViaStreamingSnapshotWriter
public static void buildViaStreamingSnapshotWriter(Path manifestPath, Path outputPath) throws IOException - Throws:
IOException
-
buildFullV09Snapshot
Builds a full v0.9.0 compliant.impssnapshot (including all relation and domain attributes, 128-byte-padded nullable validity bitmaps, CSR/CSC topologies, and CRC/SHA-256 footer) and writes it tooutputPath.- Throws:
IOException
-
buildFullV09SnapshotBytes
Builds a full v0.9.0 compliant.impssnapshot in memory and returns the raw bytes.- Throws:
IOException
-
parseDomainCsv
public static CsvManifestSnapshotBuilder.ParsedDomainData parseDomainCsv(Path csvPath, CsvManifestSnapshotBuilder.DomainSpec spec) throws IOException - Throws:
IOException
-
parseRelationCsv
public static CsvManifestSnapshotBuilder.ParsedRelationData parseRelationCsv(Path csvPath, CsvManifestSnapshotBuilder.RelationSpec spec, CsvManifestSnapshotBuilder.ParsedDomainData srcDom, CsvManifestSnapshotBuilder.ParsedDomainData tgtDom) throws IOException - Throws:
IOException
-
computeCrc16Ccitt
public static short computeCrc16Ccitt(byte[] data, int offset, int length) -
computeCrc64Ecma
public static long computeCrc64Ecma(byte[] data, int offset, int length)
-