IndexerExport

fmgp.did.method.prism.vdr.IndexerExport
object IndexerExport

IndexerExport

Dumps every event from a PrismStateRead into one file per ref. The on-disk format matches what Indexer.indexerJobFS produces in <workdir>/events/<ref>: one JSON-encoded fmgp.did.method.prism.proto.MySignedPrismEvent per line, sorted by (b, o).

Supports incremental export via a .cursor file in the export folder.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def exportEventsToFiles(exportDir: Path, fromScratch: Boolean): ZIO[PrismStateRead, Throwable, Long]

Export events into per-ref files in exportDir.

Export events into per-ref files in exportDir.

Behavior:

  • If fromScratch=true OR <exportDir>/.cursor is missing: rebuild every file with TRUNCATE_EXISTING.
  • Otherwise: read the cursor and only fetch events with (b, o) > cursor (via PrismStateRead.getEventsAfter), appending each new event to its <rootRef-hex> file (sorted by (b, o)).

The latest (b, o) seen is written back to <exportDir>/.cursor after a successful run.

Attributes

Returns

the number of events written (full rebuild = total event count; incremental = newly appended event count).