Java · Serialization

Serialization

import cloud.unum.usearch.*; 3.0.0-rc.1 · 4c3e5023

Checkpoints ride the SafeGraphs interchange format, and the path extension picks the layout: a .safegraphs path is one monolith, a .safegraphs.json path is a manifest cataloging many. A loaded index takes its geometry and metric from the checkpoint’s own headers, and only the placement and valuesPerKey from its constructor.

index.on(pool).save("index.safegraphs");
DenseIndex loaded = DenseIndex.loadRam("index.safegraphs");

DenseMetadata described = DenseIndex.metadataRead("index.safegraphs", pool);

Monolith monolith = index.saveBuffer(arena);
DenseIndex copied = DenseIndex.loadRamBuffer(monolith.segment());

Only the call can size a monolith, so saveBuffer lands it in an arena, as Arenas describes, and segment reads it in place.

DenseMetadata carries the four fields a checkpoint froze: dimensions, metric, quantization and connectivity. The placement is absent because a checkpoint records where it was written rather than where a reader must keep it, and valuesPerKey is absent because it bounds a live handle’s mutable state rather than the serialized form.

API

Types

MonolithThe monolith a saveBuffer of any modality wrote into an arena, as DenseVerbs#saveBuffer does.
Types.java:999 ↗
class Monolith

Valid until the arena's next call or its close.