@procedures/mongo 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/README.md +134 -705
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/document-storage.d.ts +196 -0
- package/dist/storage/document-storage.d.ts.map +1 -0
- package/dist/storage/document-storage.js +694 -0
- package/dist/storage/document-storage.js.map +1 -0
- package/dist/storage/index.d.ts +6 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +4 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/materializer.d.ts +354 -0
- package/dist/storage/materializer.d.ts.map +1 -0
- package/dist/storage/materializer.js +933 -0
- package/dist/storage/materializer.js.map +1 -0
- package/dist/storage/pipeline-scope.d.ts +73 -0
- package/dist/storage/pipeline-scope.d.ts.map +1 -0
- package/dist/storage/pipeline-scope.js +262 -0
- package/dist/storage/pipeline-scope.js.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +17 -2
- package/src/storage/document-storage.ts +787 -0
- package/src/storage/index.ts +16 -0
- package/src/storage/materializer.ts +1044 -0
- package/src/storage/pipeline-scope.ts +281 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-storage.js","sourceRoot":"","sources":["../../src/storage/document-storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,UAAU,EACV,YAAY,GASb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAiB,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,O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,WAAW,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;YAC7E,CAAC,CAAC,CAAC;YACH,MAAM,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC7F,CAAC,CAAC,CAAC;QACH,MAAM,IAAI,CAAC,eAAe,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED,8EAA8E;IAC9E,0BAA0B;IAC1B,8EAA8E;IAE9E;;;OAGG;IACH,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAEO,SAAS;QACf,IAAI,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,IAAI,CAAC,cAAc,YAAY,CAAC,CAAC;IAClH,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,EAAE;YACvB,KAAK,EAAE,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;SACvH,CAAC;IACJ,CAAC;CACF"}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -3,4 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export { MongoStorage } from "./mongo-storage.js";
|
|
5
5
|
export type { MongoStorageOptions } from "./mongo-storage.js";
|
|
6
|
+
export { MongoDocumentStorage, selectorPrefilter } from "./document-storage.js";
|
|
7
|
+
export type { MongoDocumentStorageOptions } from "./document-storage.js";
|
|
8
|
+
export { BLOCKED_PIPELINE_OPERATORS, ALLOWED_PIPELINE_STAGES, DEFAULT_PIPELINE_LIMITS, assertNoBlockedOperators, boundPipeline, cutResults, isTimeLimitError, scopePipeline, } from "./pipeline-scope.js";
|
|
9
|
+
export type { PipelineLimits, PipelineScope } from "./pipeline-scope.js";
|
|
10
|
+
export { ViewMaterializer, identityPartition, partitionTargetId, viewFilter, VIEW_GENERATION_FIELD, VIEW_HASH_FIELD } from "./materializer.js";
|
|
11
|
+
export type { MaterializedView, MaterializedViewStatus, ViewMaterializerOptions, ViewPartitionOf, ViewPipelineScope, ViewTargetId } from "./materializer.js";
|
|
6
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAChF,YAAY,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/I,YAAY,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,eAAe,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/storage/index.js
CHANGED
|
@@ -2,4 +2,8 @@
|
|
|
2
2
|
* MongoDB Storage Exports
|
|
3
3
|
*/
|
|
4
4
|
export { MongoStorage } from "./mongo-storage.js";
|
|
5
|
+
export { MongoDocumentStorage, selectorPrefilter } from "./document-storage.js";
|
|
6
|
+
export { BLOCKED_PIPELINE_OPERATORS, ALLOWED_PIPELINE_STAGES, DEFAULT_PIPELINE_LIMITS, assertNoBlockedOperators, boundPipeline, cutResults, isTimeLimitError, scopePipeline, } from "./pipeline-scope.js";
|
|
7
|
+
// Materialized views driven by change streams (Graph's split plan, P4)
|
|
8
|
+
export { ViewMaterializer, identityPartition, partitionTargetId, viewFilter, VIEW_GENERATION_FIELD, VIEW_HASH_FIELD } from "./materializer.js";
|
|
5
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEhF,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,uEAAuE;AACvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Materialized views driven by change streams (Graph's split plan, part P4). A view is a document
|
|
3
|
+
* of a views collection: an aggregation pipeline over source collections whose result goes into a
|
|
4
|
+
* target collection, for one partition (for example one tenant). The materializer runs each view
|
|
5
|
+
* when its sources change, and keeps the target equal to the result of the pipeline.
|
|
6
|
+
*
|
|
7
|
+
* - The views of a partition run in the order of their dependencies: a view whose target is the
|
|
8
|
+
* source of another view runs first, in the same pass. A view in a cycle does not run, and its
|
|
9
|
+
* status is `cycle`.
|
|
10
|
+
* - A pass runs after the last change of a burst (`debounce`), and only the views whose sources
|
|
11
|
+
* changed. A run streams the result in groups, and compares each row with the hash that its
|
|
12
|
+
* stored row keeps. A result that did not change writes nothing.
|
|
13
|
+
* - The rows of a view are a generation (the field `_viewGen`), and the status of the view names
|
|
14
|
+
* the current one. A reader filters with `viewFilter(view)`, and thus always reads one whole
|
|
15
|
+
* generation.
|
|
16
|
+
* - A run writes in one transaction: the rows that changed, in the current generation, and the
|
|
17
|
+
* removal of the rows that the result does not have. A view with more rows than
|
|
18
|
+
* `maxTransactionRows`, or whose transaction fails (for example over the limits of MongoDB),
|
|
19
|
+
* writes a whole new generation in groups instead. Then the status names it, and the previous
|
|
20
|
+
* generation stays for `generationGrace` (on the time of the server), so a reader of it can finish.
|
|
21
|
+
* - A pass in groups holds a lease on its view (`passLease`, on the time of the server), and renews
|
|
22
|
+
* it after each group. Another process leaves the view and the rows of that generation alone while
|
|
23
|
+
* the lease holds. The change to the new generation is a compare-and-set: it needs the lease, and
|
|
24
|
+
* the generation that the pass started from. A pass that loses either one gives way: its rows go
|
|
25
|
+
* in a later pass, and a new pass of the view follows.
|
|
26
|
+
* - The stored `_id` of a row carries the partition and the generation (`targetId`): partitions
|
|
27
|
+
* with the same keys share a target. The rows of an older materializer (no generation) go in the
|
|
28
|
+
* first pass.
|
|
29
|
+
* - Each pipeline goes through the guard of the scope (`scopePipeline` by default): it reads only
|
|
30
|
+
* the documents of its partition, in its sources, and only the current generation of a target
|
|
31
|
+
* of another view. The materializer writes the rows.
|
|
32
|
+
* - A pass keeps in memory the key of each row of the result (at most `maxRows`) and one group of
|
|
33
|
+
* 1000 rows. It keeps nothing between passes.
|
|
34
|
+
* - A change stream that ends (for example after `dropDatabase`) opens again after `rewatch`,
|
|
35
|
+
* and a pass catches up on the changes that the stream missed.
|
|
36
|
+
* - The status of each view (`ok`, `errored`, `cycle`) goes into the field `statusField` of its
|
|
37
|
+
* document. The materializer ignores an update of only that field.
|
|
38
|
+
*
|
|
39
|
+
* A change reaches only the views of its partition when its partition is known. A delete has no
|
|
40
|
+
* document: its partition comes from the pre-image (a collection with
|
|
41
|
+
* `changeStreamPreAndPostImages`), or from the id in a source of `storageSources`, through its
|
|
42
|
+
* mapping. Else it reaches the views of each partition of its source. With pre-images, an update
|
|
43
|
+
* that moves a document to another partition also reaches the views of its old partition.
|
|
44
|
+
*
|
|
45
|
+
* Change streams and transactions need a replica set (MongoDB 6 or later). The target of a view is
|
|
46
|
+
* a plain collection that only the materializer writes.
|
|
47
|
+
*
|
|
48
|
+
* The stop has the parts of a transport of a service: `stopIntake()`, `drain()`, `inFlight()` and
|
|
49
|
+
* `close()`. A host composes them with no adapter. The timers come from the injected clock.
|
|
50
|
+
*/
|
|
51
|
+
import { ObjectId, type Db, type Document } from "mongodb";
|
|
52
|
+
import { type Clock, type Duration } from "@procedures/client";
|
|
53
|
+
/** The definition of a view, as a document of the views collection. */
|
|
54
|
+
export interface MaterializedView {
|
|
55
|
+
_id: string;
|
|
56
|
+
/** The source collections. The pipeline runs on the first one, and reads the others with `$lookup` or `$unionWith`. */
|
|
57
|
+
collections: string[];
|
|
58
|
+
/** The aggregation pipeline, without `$merge`. */
|
|
59
|
+
pipeline: Document[];
|
|
60
|
+
/** The collection that gets the result. */
|
|
61
|
+
targetCollection: string;
|
|
62
|
+
/**
|
|
63
|
+
* The fields that the pipeline reads, for each source (paths with dots). An update of a source
|
|
64
|
+
* that changes none of them (a set, a removal, a truncated array, at the field, under it or above
|
|
65
|
+
* it), and does not change the partition field, does not start a pass. Without it, each update of
|
|
66
|
+
* the source starts a pass.
|
|
67
|
+
*/
|
|
68
|
+
sourceFields?: Record<string, string[]>;
|
|
69
|
+
[field: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
/** The status of a view, in the field `statusField` of its document. */
|
|
72
|
+
export interface MaterializedViewStatus {
|
|
73
|
+
state: "ok" | "errored" | "cycle";
|
|
74
|
+
lastError?: string;
|
|
75
|
+
/** The time of the status, in milliseconds since the epoch. */
|
|
76
|
+
at: number;
|
|
77
|
+
/** The current generation of the rows of the view. */
|
|
78
|
+
generation?: ObjectId;
|
|
79
|
+
/** The generation before the last change of generation, and the time of that change on the server (`$$NOW`). */
|
|
80
|
+
previous?: {
|
|
81
|
+
generation: ObjectId | null;
|
|
82
|
+
flippedAt: Date;
|
|
83
|
+
};
|
|
84
|
+
/** The lease of a pass in groups: its owner, the generation that it writes, and its end on the server. */
|
|
85
|
+
lease?: {
|
|
86
|
+
owner: string;
|
|
87
|
+
generation: ObjectId;
|
|
88
|
+
until: Date;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The function that guards the pipeline of a view for its partition. `match` is the filter of the
|
|
93
|
+
* documents that the pipeline can read: the partition, and the current generations of the targets.
|
|
94
|
+
*/
|
|
95
|
+
export type ViewPipelineScope = (pipeline: Document[], partition: string, view: MaterializedView, match: Document) => Document[];
|
|
96
|
+
/** The options of a `ViewMaterializer`. */
|
|
97
|
+
export interface ViewMaterializerOptions {
|
|
98
|
+
/** The database of the views, the sources and the targets. */
|
|
99
|
+
db: () => Db | Promise<Db>;
|
|
100
|
+
/** The collection of the view documents (default `_aggregations`). */
|
|
101
|
+
views?: string | undefined;
|
|
102
|
+
/** The field of a document that names its partition (default `_part`). The views and the source documents have it. */
|
|
103
|
+
partitionField?: string | undefined;
|
|
104
|
+
/** The field of a view document that gets its status (default `_materializerStatus`). */
|
|
105
|
+
statusField?: string | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* The guard of a pipeline. The default is `scopePipeline` with `match` as the filter and the
|
|
108
|
+
* sources as the collections. Another guard applies `match` to each collection too.
|
|
109
|
+
*/
|
|
110
|
+
scope?: ViewPipelineScope | undefined;
|
|
111
|
+
/** The time after the last change before a pass (default 100 ms). */
|
|
112
|
+
debounce?: Duration | undefined;
|
|
113
|
+
/** The time before a change stream that ended opens again (default 1 s). */
|
|
114
|
+
rewatch?: Duration | undefined;
|
|
115
|
+
/** The longest time of a pipeline (default 30 s). */
|
|
116
|
+
maxTime?: Duration | undefined;
|
|
117
|
+
/** The most rows of the result of a view (default 100000). A larger result is an error of the view. */
|
|
118
|
+
maxRows?: number | undefined;
|
|
119
|
+
/** The log (default `console`, with the prefix `[materializer]`). */
|
|
120
|
+
log?: ((level: "info" | "warn" | "error", message: string) => void) | undefined;
|
|
121
|
+
/** The clock of the timers (default the clock of the platform). A test gives a fake clock. The timers do not keep a process alive. */
|
|
122
|
+
clock?: Clock | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* The stored `_id` of a row of a view, from the `_id` of the row, the partition and the
|
|
125
|
+
* generation (default `partitionTargetId`: `{ partition, generation, id }`). Two partitions, or two
|
|
126
|
+
* generations, must not give the same stored `_id`. The write of a row checks the partition, and
|
|
127
|
+
* fails on the row of another partition. A pass in groups fails when the generation does not
|
|
128
|
+
* change the `_id`.
|
|
129
|
+
*/
|
|
130
|
+
targetId?: ViewTargetId | undefined;
|
|
131
|
+
/** A view with more rows than this writes a new generation in groups, not in one transaction (default 10000). */
|
|
132
|
+
maxTransactionRows?: number | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* The time that the previous generation stays after a change of generation (default 60 s). The
|
|
135
|
+
* time of the server (`$$NOW`) measures it, so the processes and the restarts agree.
|
|
136
|
+
*/
|
|
137
|
+
generationGrace?: Duration | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* The lease of a pass in groups on its view (default 60 s), on the time of the server. The pass
|
|
140
|
+
* renews it after each group, so a group must take less time.
|
|
141
|
+
*/
|
|
142
|
+
passLease?: Duration | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* The sources that are collections of a `MongoDocumentStorage`, each with the function that
|
|
145
|
+
* gives the partition of the views from the partition of the storage. The stored id of a document
|
|
146
|
+
* starts with its storage partition and U+001F. A delete without a pre-image then reaches only the
|
|
147
|
+
* views of its partition. Give `identityPartition` when the two partitions are the same. Without a
|
|
148
|
+
* function, or when it gives `undefined`, the delete reaches the views of each partition.
|
|
149
|
+
*/
|
|
150
|
+
storageSources?: Readonly<Record<string, ViewPartitionOf>> | undefined;
|
|
151
|
+
}
|
|
152
|
+
/** The function that gives the stored `_id` of a row of a view. */
|
|
153
|
+
export type ViewTargetId = (id: unknown, partition: string, generation: ObjectId) => unknown;
|
|
154
|
+
/** The stored `_id` of a row: `{ partition, generation, id }`. A reader reads the key of the row in `_id.id`. */
|
|
155
|
+
export declare const partitionTargetId: ViewTargetId;
|
|
156
|
+
/** The field of a row of a view that names its generation. */
|
|
157
|
+
export declare const VIEW_GENERATION_FIELD = "_viewGen";
|
|
158
|
+
/** The field of a row of a view that keeps the hash of its content. */
|
|
159
|
+
export declare const VIEW_HASH_FIELD = "_viewHash";
|
|
160
|
+
/**
|
|
161
|
+
* The filter of the rows of a view for a reader: its partition and its current generation. A
|
|
162
|
+
* reader of a target applies it, so it reads one whole generation. Before the first run, it
|
|
163
|
+
* matches no row.
|
|
164
|
+
*/
|
|
165
|
+
export declare function viewFilter(view: MaterializedView, options?: {
|
|
166
|
+
partitionField?: string | undefined;
|
|
167
|
+
statusField?: string | undefined;
|
|
168
|
+
}): Document;
|
|
169
|
+
/** The function that gives the partition of the views from the partition of a storage, or `undefined` when it does not know. */
|
|
170
|
+
export type ViewPartitionOf = (storagePartition: string) => string | undefined;
|
|
171
|
+
/** The partition of the views is the partition of the storage. */
|
|
172
|
+
export declare const identityPartition: ViewPartitionOf;
|
|
173
|
+
/**
|
|
174
|
+
* A `ViewMaterializer` keeps the target of each view equal to the result of its pipeline.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```typescript
|
|
178
|
+
* const views = new ViewMaterializer({ db: () => client.db("app"), partitionField: "tenant" });
|
|
179
|
+
* await views.start();
|
|
180
|
+
* // ... later
|
|
181
|
+
* await views.stop();
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
export declare class ViewMaterializer {
|
|
185
|
+
private readonly options;
|
|
186
|
+
private readonly viewsName;
|
|
187
|
+
private readonly partitionField;
|
|
188
|
+
private readonly statusField;
|
|
189
|
+
private readonly debounceMs;
|
|
190
|
+
private readonly rewatchMs;
|
|
191
|
+
private readonly maxTimeMS;
|
|
192
|
+
private readonly maxRows;
|
|
193
|
+
private db;
|
|
194
|
+
private viewsStream;
|
|
195
|
+
private readonly running;
|
|
196
|
+
/** The collections that changed since the last pass, for each partition. */
|
|
197
|
+
private readonly dirty;
|
|
198
|
+
private readonly timers;
|
|
199
|
+
/** The timers of the streams that open again, and of the ends of the grace times. */
|
|
200
|
+
private readonly retries;
|
|
201
|
+
private readonly clock;
|
|
202
|
+
private readonly targetId;
|
|
203
|
+
private readonly maxTransactionRows;
|
|
204
|
+
private readonly graceMs;
|
|
205
|
+
private readonly leaseMs;
|
|
206
|
+
private readonly storageSources;
|
|
207
|
+
/** False after `stopIntake()`: a change starts no pass. */
|
|
208
|
+
private intake;
|
|
209
|
+
/** The work of each partition, one at a time: the passes and the rebalances. */
|
|
210
|
+
private readonly chains;
|
|
211
|
+
private readonly pending;
|
|
212
|
+
private stopped;
|
|
213
|
+
constructor(options: ViewMaterializerOptions);
|
|
214
|
+
private log;
|
|
215
|
+
/**
|
|
216
|
+
* The guard of a pipeline of a view. A target of another view counts only in its current
|
|
217
|
+
* generation. A source document has no generation.
|
|
218
|
+
*/
|
|
219
|
+
private scoped;
|
|
220
|
+
/** The change streams that are open: the views stream and the source streams of the active views. */
|
|
221
|
+
openStreamCount(): number;
|
|
222
|
+
/** The passes, rebalances and status writes in flight. */
|
|
223
|
+
inFlight(): number;
|
|
224
|
+
/** The status of the views that the materializer knows, by key `<partition>::<view id>`. */
|
|
225
|
+
views(): Map<string, {
|
|
226
|
+
state: "active" | "cyclic";
|
|
227
|
+
sources: string[];
|
|
228
|
+
target: string;
|
|
229
|
+
}>;
|
|
230
|
+
/** This method starts the materializer: it reads each view, runs it, and watches the views and their sources. */
|
|
231
|
+
start(): Promise<void>;
|
|
232
|
+
/** This method stops the passes of new changes: a change starts no pass, and a waiting pass does not start. */
|
|
233
|
+
stopIntake(): void;
|
|
234
|
+
/**
|
|
235
|
+
* This method waits until no work is in flight, until the `deadline` (milliseconds on the clock
|
|
236
|
+
* of the materializer), or until the signal aborts.
|
|
237
|
+
*/
|
|
238
|
+
drain(deadline: number, signal?: AbortSignal): Promise<void>;
|
|
239
|
+
/** This method closes the streams and cancels each timer. The work in flight ends on its own. */
|
|
240
|
+
close(): Promise<void>;
|
|
241
|
+
/** This method stops the materializer: `stopIntake()`, `drain()` with no deadline, and `close()`. */
|
|
242
|
+
stop(): Promise<void>;
|
|
243
|
+
/** This method keeps a promise of work until it ends, so `stop()` can wait for it. */
|
|
244
|
+
private track;
|
|
245
|
+
/** This method runs work of a partition after the work of that partition before it. */
|
|
246
|
+
private serial;
|
|
247
|
+
private keyOf;
|
|
248
|
+
private partitionOf;
|
|
249
|
+
/** This method closes each view, and opens each view of the views collection again: a full catch-up. */
|
|
250
|
+
private resync;
|
|
251
|
+
private watchViews;
|
|
252
|
+
private onViewChange;
|
|
253
|
+
private spinUp;
|
|
254
|
+
private tearDown;
|
|
255
|
+
/**
|
|
256
|
+
* The filter of the change stream of a source for a partition. It only removes the events that
|
|
257
|
+
* cannot change a view of the partition: an event whose partition is unknown passes, and the
|
|
258
|
+
* pass of the partition reads its own documents only.
|
|
259
|
+
*
|
|
260
|
+
* - An insert, a replace or an update has the document after the change (`fullDocument`).
|
|
261
|
+
* - With a pre-image (a collection with `changeStreamPreAndPostImages`), each change also has the
|
|
262
|
+
* document before it: a delete, and an update that moves a document out of the partition.
|
|
263
|
+
* - Without a pre-image, a delete, a replace and an update of the partition field (a top-level
|
|
264
|
+
* field) can leave any partition: they pass. In a source of `storageSources`, the handler then
|
|
265
|
+
* reads the partition from the id (`isOtherPartition`).
|
|
266
|
+
* - The handler checks the fields of an update against `sourceFields` (`touchesFields`).
|
|
267
|
+
*/
|
|
268
|
+
private sourceMatch;
|
|
269
|
+
/**
|
|
270
|
+
* True for an update that changes no field of `fields` and not the partition field. The keys of
|
|
271
|
+
* an update are paths with dots (`tags.3` after a `$push`, `a.b` after a `$set` of `a.b`), so a key
|
|
272
|
+
* counts when it is a field, a field under it, or a field above it. The removed fields and the
|
|
273
|
+
* truncated arrays count too. The positions in an array do not count (`lines.0.price` is
|
|
274
|
+
* `lines.price`, and `lines.3` is `lines`): that only widens the match.
|
|
275
|
+
*/
|
|
276
|
+
private touchesNoField;
|
|
277
|
+
/**
|
|
278
|
+
* True for a change without a pre-image (a delete, a replace, an update), in a source of
|
|
279
|
+
* `storageSources`, whose id names a storage partition that maps to another partition of the
|
|
280
|
+
* views. A document that is in the partition after the change, an id without the separator, a
|
|
281
|
+
* mapping that gives `undefined` and a mapping that fails do not tell another partition: false.
|
|
282
|
+
*/
|
|
283
|
+
private isOtherPartition;
|
|
284
|
+
private isCurrent;
|
|
285
|
+
private watchSource;
|
|
286
|
+
/** This method runs a function after `rewatch`, unless the materializer stops. The timer does not keep the process alive. */
|
|
287
|
+
private later;
|
|
288
|
+
/** This method marks a collection as changed, and starts the pass of the partition after the burst. */
|
|
289
|
+
private schedule;
|
|
290
|
+
/** The views of a partition, in the order of their dependencies, and the views in a cycle. */
|
|
291
|
+
private order;
|
|
292
|
+
/** This method moves the views of a partition between active and cyclic, and runs each view that becomes active. */
|
|
293
|
+
private rebalance;
|
|
294
|
+
/** A pass of a partition: each active view whose sources changed, in the order of the dependencies. */
|
|
295
|
+
private pass;
|
|
296
|
+
/** This method runs a view, and writes its status. A failed view does not make its target dirty. */
|
|
297
|
+
private runAndWriteStatus;
|
|
298
|
+
/**
|
|
299
|
+
* One run of a view. It gives true when the rows of the view changed: then the views that read
|
|
300
|
+
* its target run after it, in the same pass.
|
|
301
|
+
*/
|
|
302
|
+
private run;
|
|
303
|
+
/**
|
|
304
|
+
* The status of a view in the database (the current generation, and the previous one), and the
|
|
305
|
+
* time of the server: the times of the generations are times of the server.
|
|
306
|
+
*/
|
|
307
|
+
private statusOf;
|
|
308
|
+
/** The current generations of the views of a partition: the rows of a target that a pipeline can read. */
|
|
309
|
+
private currentGenerations;
|
|
310
|
+
/**
|
|
311
|
+
* This method removes the rows of the old generations of a view: not the current one, not the
|
|
312
|
+
* previous one during its grace time, and not the generation of a live lease (a pass in groups,
|
|
313
|
+
* maybe of another process, writes it). The rows of a pass that stopped go when its lease ends.
|
|
314
|
+
*/
|
|
315
|
+
private dropOldGenerations;
|
|
316
|
+
/** The rows of the result, in groups of 1000. A failure of the pipeline, a row without `_id` and too many rows are a `ViewRunError`. */
|
|
317
|
+
private resultGroups;
|
|
318
|
+
private replaceOf;
|
|
319
|
+
/**
|
|
320
|
+
* A run in one transaction, in the current generation (a new one at the first run): the rows that
|
|
321
|
+
* changed, and the removal of the rows that the result does not have. At the first run, the
|
|
322
|
+
* removal also takes the rows of no generation (an older materializer).
|
|
323
|
+
*
|
|
324
|
+
* The rule of convergence: a pass in groups of another process can start after this transaction
|
|
325
|
+
* reads its generation, and flip after it commits. Then the flip overtakes this commit, and the
|
|
326
|
+
* new generation can miss a change that only this pass saw. The change also made the partition
|
|
327
|
+
* dirty in the other process, so its next pass computes the view again, and the view converges.
|
|
328
|
+
*/
|
|
329
|
+
private runInTransaction;
|
|
330
|
+
/**
|
|
331
|
+
* A run in groups, outside a transaction: a whole new generation, then the change of the status to
|
|
332
|
+
* it. The readers of `viewFilter` move to it at once. The rows of no generation go at once: no
|
|
333
|
+
* reader of a generation reads them.
|
|
334
|
+
*/
|
|
335
|
+
private runInGroups;
|
|
336
|
+
/** True while the view is the one that the materializer runs for this key. */
|
|
337
|
+
private isCurrentView;
|
|
338
|
+
/**
|
|
339
|
+
* This method names the current generation of a view in its status, as a compare-and-set: only
|
|
340
|
+
* from the generation `expected`, and with `owner`, only while that pass holds a live lease. Then
|
|
341
|
+
* it ends the lease, and names the previous generation with the time of the change on the server
|
|
342
|
+
* (`$$NOW`). It gives false when another process changed the view.
|
|
343
|
+
*/
|
|
344
|
+
private setGeneration;
|
|
345
|
+
/** This method takes the lease of a view for a pass in groups, when no live lease holds it. It gives false when one does. */
|
|
346
|
+
private takeLease;
|
|
347
|
+
/** This method renews the lease of a pass, while it is live and still its own. It gives false when the pass lost it. */
|
|
348
|
+
private renewLease;
|
|
349
|
+
/** This method ends the lease of a pass, when it is still its own. */
|
|
350
|
+
private releaseLease;
|
|
351
|
+
/** This method writes the state of a view. It keeps the generations of the status. */
|
|
352
|
+
private writeStatus;
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=materializer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materializer.d.ts","sourceRoot":"","sources":["../../src/storage/materializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAGH,OAAO,EAAQ,QAAQ,EAA0D,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AACzH,OAAO,EAAsC,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAInG,uEAAuE;AACvE,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,uHAAuH;IACvH,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kDAAkD;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