DELTAS_PREFIXconstno test imports itconst DELTAS_PREFIX: "deltas/"The prefix below which the deltas are kept.
What a medium holds of an exchange, and how it is named. A replica publishes each delta of its own rows once, as a file whose name says whose it is, which of the replica's rows it holds and what the delta is (its identity is the SHA-256 of its text, so a file never changes and two replicas that publish the same delta publish one file). A replica publishes the vector it holds as a file of its own, which it writes again as it grows. Nothing else is written to the medium.
import { deltaPath, parseDeltaPath } from "./names.ts";DELTAS_PREFIXconstno test imports itconst DELTAS_PREFIX: "deltas/"The prefix below which the deltas are kept.
VECTORS_PREFIXconstno test imports itconst VECTORS_PREFIX: "vectors/"The prefix below which the vectors are kept.
deltasPrefixconstno test imports itconst deltasPrefix: () => PrefixThe prefix of the deltas of everyone.
vectorsPrefixconstno test imports itconst vectorsPrefix: () => PrefixThe prefix of the vectors of everyone.
DeltaNametypeno test imports ittype DeltaName = { readonly replica: ReplicaId; readonly from: number; readonly to: number; readonly id: string };What the name of a delta file says: whose rows it holds, the numbers of the first and the last, and the identity of the delta.
deltaPathfunctionfunction deltaPath(name: DeltaName): Result<Path, string>The path of a delta file.
parseDeltaPathfunctionfunction parseDeltaPath(path: string): Result<DeltaName, string>What the path of a file says of the delta in it, or why it is not the path of a delta.
vectorPathfunctionno test imports itfunction vectorPath(replica: ReplicaId): PathThe path of the vector a replica publishes.
parseVectorPathfunctionno test imports itfunction parseVectorPath(path: string): Result<ReplicaId, string>The replica a vector file is of, or why the path is not one.