Type Alias PackStore
type PackStore = {
counters: PackCounters;
applyDelta(delta: BundleDelta): Promise<void>;
applyPredicted(predicted: Predicted): Promise<void>;
compact(): Promise<boolean>;
confirmPredicted(to: number, digest: string): Promise<void>;
dropPredicted(): Promise<void>;
estimateBeforeInstall(bytes: number): Promise<FitOutcome>;
getRoutes(): Promise<SerializedRoute[]>;
getRow(table: string, key: string): Promise<Plain | undefined>;
getTemplates(): Promise<Record<string, CompiledTemplate>>;
head(): Promise<PackHead | undefined>;
installPack(
source: AsyncIterable<Bytes>,
options?: InstallOptions,
): Promise<InstallOutcome>;
installRing(ring: Ring): Promise<RingOutcome>;
putRoutes(
routes: SerializedRoute[],
templates?: Record<string, CompiledTemplate>,
): Promise<void>;
recordCounts(): Promise<RecordCounts>;
scanTable(table: string): Promise<BundleRows>;
}
counters: PackCounters;
applyDelta(delta: BundleDelta): Promise<void>;
applyPredicted(predicted: Predicted): Promise<void>;
compact(): Promise<boolean>;
confirmPredicted(to: number, digest: string): Promise<void>;
dropPredicted(): Promise<void>;
estimateBeforeInstall(bytes: number): Promise<FitOutcome>;
getRoutes(): Promise<SerializedRoute[]>;
getRow(table: string, key: string): Promise<Plain | undefined>;
getTemplates(): Promise<Record<string, CompiledTemplate>>;
head(): Promise<PackHead | undefined>;
installPack(
source: AsyncIterable<Bytes>,
options?: InstallOptions,
): Promise<InstallOutcome>;
installRing(ring: Ring): Promise<RingOutcome>;
putRoutes(
routes: SerializedRoute[],
templates?: Record<string, CompiledTemplate>,
): Promise<void>;
recordCounts(): Promise<RecordCounts>;
scanTable(table: string): Promise<BundleRows>;
}
Methods
apply Delta
-
Parameters
- delta: BundleDelta
Returns Promise<void>
apply Predicted
-
Parameters
- predicted: Predicted
Returns Promise<void>
compact
-
Returns Promise<boolean>
confirm Predicted
-
moves to
towith the predicted rows as the change; throws and keeps them whendigestis not theirsParameters
- to: number
- digest: string
Returns Promise<void>
drop Predicted
-
removes every predicted row and keeps the version
Returns Promise<void>
estimate Before Install
-
Parameters
- bytes: number
Returns Promise<FitOutcome>
get Routes
-
Returns Promise<SerializedRoute[]>
get Row
-
Parameters
- table: string
- key: string
Returns Promise<Plain | undefined>
get Templates
-
Returns Promise<Record<string, CompiledTemplate>>
head
-
Returns Promise<PackHead | undefined>
install Pack
-
Parameters
- source: AsyncIterable<Bytes>
Optionaloptions: InstallOptions
Returns Promise<InstallOutcome>
install Ring
-
holds a ring as a partial or a complete head; its routes and templates are replaced
Parameters
- ring: Ring
Returns Promise<RingOutcome>
put Routes
-
templatesholds the compiled template of each route that has one, keyed by patternParameters
- routes: SerializedRoute[]
Optionaltemplates: Record<string, CompiledTemplate>
Returns Promise<void>
record Counts
-
Returns Promise<RecordCounts>
scan Table
-
Parameters
- table: string
Returns Promise<BundleRows>
lays predicted rows over the pack without moving its version; a no-op when no pack is held