@fluidframework/runtime-definitions 2.0.0-rc.1.0.3 → 2.0.0-rc.2.0.0
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/.eslintrc.cjs +1 -1
- package/CHANGELOG.md +75 -0
- package/api-extractor-cjs.json +8 -0
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/runtime-definitions.api.md +103 -112
- package/dist/dataStoreContext.d.ts +124 -62
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +3 -0
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreFactory.d.ts +1 -1
- package/dist/dataStoreFactory.d.ts.map +1 -1
- package/dist/dataStoreFactory.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/{garbageCollection.d.ts → garbageCollectionDefinitions.d.ts} +8 -2
- package/dist/garbageCollectionDefinitions.d.ts.map +1 -0
- package/dist/{garbageCollection.js → garbageCollectionDefinitions.js} +9 -3
- package/dist/garbageCollectionDefinitions.js.map +1 -0
- package/dist/index.d.ts +12 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -26
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/protocol.d.ts +2 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/runtime-definitions-alpha.d.ts +193 -166
- package/dist/runtime-definitions-beta.d.ts +37 -57
- package/dist/runtime-definitions-public.d.ts +37 -57
- package/dist/runtime-definitions-untrimmed.d.ts +200 -167
- package/dist/summary.d.ts +15 -20
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/attribution.d.ts +71 -0
- package/lib/attribution.d.ts.map +1 -0
- package/lib/attribution.js +6 -0
- package/lib/attribution.js.map +1 -0
- package/lib/dataStoreContext.d.ts +469 -0
- package/lib/dataStoreContext.d.ts.map +1 -0
- package/lib/dataStoreContext.js +67 -0
- package/lib/dataStoreContext.js.map +1 -0
- package/lib/dataStoreFactory.d.ts +33 -0
- package/lib/dataStoreFactory.d.ts.map +1 -0
- package/lib/dataStoreFactory.js +9 -0
- package/lib/dataStoreFactory.js.map +1 -0
- package/lib/dataStoreRegistry.d.ts +41 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -0
- package/lib/dataStoreRegistry.js +9 -0
- package/lib/dataStoreRegistry.js.map +1 -0
- package/lib/garbageCollectionDefinitions.d.ts +62 -0
- package/lib/garbageCollectionDefinitions.d.ts.map +1 -0
- package/lib/garbageCollectionDefinitions.js +35 -0
- package/lib/garbageCollectionDefinitions.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/protocol.d.ts +77 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +6 -0
- package/lib/protocol.js.map +1 -0
- package/lib/runtime-definitions-alpha.d.ts +1025 -0
- package/lib/runtime-definitions-beta.d.ts +244 -0
- package/lib/runtime-definitions-public.d.ts +244 -0
- package/lib/runtime-definitions-untrimmed.d.ts +1106 -0
- package/lib/summary.d.ts +322 -0
- package/lib/summary.d.ts.map +1 -0
- package/lib/summary.js +26 -0
- package/lib/summary.js.map +1 -0
- package/package.json +111 -34
- package/src/dataStoreContext.ts +148 -77
- package/src/dataStoreFactory.ts +1 -1
- package/src/dataStoreRegistry.ts +1 -1
- package/src/{garbageCollection.ts → garbageCollectionDefinitions.ts} +7 -1
- package/src/index.ts +26 -70
- package/src/protocol.ts +2 -1
- package/src/summary.ts +18 -20
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js.map +0 -1
package/src/dataStoreContext.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {
|
|
7
7
|
IEvent,
|
|
8
8
|
IEventProvider,
|
|
9
9
|
ITelemetryBaseLogger,
|
|
@@ -14,32 +14,30 @@ import {
|
|
|
14
14
|
IResponse,
|
|
15
15
|
FluidObject,
|
|
16
16
|
} from "@fluidframework/core-interfaces";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
AttachState,
|
|
21
|
-
ILoaderOptions,
|
|
22
|
-
} from "@fluidframework/container-definitions";
|
|
23
|
-
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
24
|
-
import {
|
|
17
|
+
import type { IAudience, IDeltaManager, AttachState } from "@fluidframework/container-definitions";
|
|
18
|
+
import type { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
19
|
+
import type {
|
|
25
20
|
IClientDetails,
|
|
26
21
|
IDocumentMessage,
|
|
27
22
|
IQuorumClients,
|
|
28
23
|
ISequencedDocumentMessage,
|
|
29
24
|
ISnapshotTree,
|
|
30
25
|
} from "@fluidframework/protocol-definitions";
|
|
31
|
-
import { IIdCompressor } from "@fluidframework/id-compressor";
|
|
32
|
-
import { IProvideFluidDataStoreFactory } from "./dataStoreFactory";
|
|
33
|
-
import { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
|
|
26
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
27
|
+
import type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
28
|
+
import type { IProvideFluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
29
|
+
import type {
|
|
30
|
+
IGarbageCollectionData,
|
|
31
|
+
IGarbageCollectionDetailsBase,
|
|
32
|
+
} from "./garbageCollectionDefinitions.js";
|
|
33
|
+
import type { IInboundSignalMessage } from "./protocol.js";
|
|
34
|
+
import type {
|
|
37
35
|
CreateChildSummarizerNodeParam,
|
|
38
36
|
ISummarizerNodeWithGC,
|
|
39
37
|
ISummaryTreeWithStats,
|
|
40
38
|
ITelemetryContext,
|
|
41
39
|
SummarizeInternalFn,
|
|
42
|
-
} from "./summary";
|
|
40
|
+
} from "./summary.js";
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* Runtime flush mode handling
|
|
@@ -48,6 +46,9 @@ import {
|
|
|
48
46
|
export enum FlushMode {
|
|
49
47
|
/**
|
|
50
48
|
* In Immediate flush mode the runtime will immediately send all operations to the driver layer.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated This option will be removed in the next major version and should not be used. Use {@link FlushMode.TurnBased} instead, which is the default.
|
|
51
|
+
* See https://github.com/microsoft/FluidFramework/tree/main/packages/runtime/container-runtime/src/opLifecycle#how-batching-works
|
|
51
52
|
*/
|
|
52
53
|
Immediate,
|
|
53
54
|
|
|
@@ -120,6 +121,7 @@ export interface IContainerRuntimeBaseEvents extends IEvent {
|
|
|
120
121
|
(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);
|
|
121
122
|
(event: "batchEnd", listener: (error: any, op: ISequencedDocumentMessage) => void);
|
|
122
123
|
(event: "signal", listener: (message: IInboundSignalMessage, local: boolean) => void);
|
|
124
|
+
(event: "dispose", listener: () => void);
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
|
@@ -167,6 +169,7 @@ export interface IDataStore {
|
|
|
167
169
|
export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeBaseEvents> {
|
|
168
170
|
readonly logger: ITelemetryBaseLogger;
|
|
169
171
|
readonly clientDetails: IClientDetails;
|
|
172
|
+
readonly disposed: boolean;
|
|
170
173
|
|
|
171
174
|
/**
|
|
172
175
|
* Invokes the given callback and guarantees that all operations generated within the callback will be ordered
|
|
@@ -180,14 +183,15 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
180
183
|
* Submits a container runtime level signal to be sent to other clients.
|
|
181
184
|
* @param type - Type of the signal.
|
|
182
185
|
* @param content - Content of the signal.
|
|
186
|
+
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
183
187
|
*/
|
|
184
|
-
submitSignal(type: string, content: any): void;
|
|
188
|
+
submitSignal(type: string, content: any, targetClientId?: string): void;
|
|
185
189
|
|
|
186
190
|
/**
|
|
187
191
|
* @deprecated 0.16 Issue #1537, #3631
|
|
188
192
|
*/
|
|
189
193
|
_createDataStoreWithProps(
|
|
190
|
-
pkg: string | string[]
|
|
194
|
+
pkg: Readonly<string | string[]>,
|
|
191
195
|
props?: any,
|
|
192
196
|
id?: string,
|
|
193
197
|
): Promise<IDataStore>;
|
|
@@ -199,14 +203,24 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
199
203
|
* already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this
|
|
200
204
|
* store being attached to storage.
|
|
201
205
|
* @param pkg - Package name of the data store factory
|
|
206
|
+
* @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.
|
|
207
|
+
* When not specified the datastore will belong to a `default` group. Read more about it in this
|
|
208
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}
|
|
202
209
|
*/
|
|
203
|
-
createDataStore(pkg: string | string[]): Promise<IDataStore>;
|
|
210
|
+
createDataStore(pkg: Readonly<string | string[]>, loadingGroupId?: string): Promise<IDataStore>;
|
|
204
211
|
|
|
205
212
|
/**
|
|
206
213
|
* Creates detached data store context. Only after context.attachRuntime() is called,
|
|
207
214
|
* data store initialization is considered complete.
|
|
215
|
+
* @param pkg - Package name of the data store factory
|
|
216
|
+
* @param loadingGroupId - This represents the group of the datastore within a container or its snapshot.
|
|
217
|
+
* When not specified the datastore will belong to a `default` group. Read more about it in this
|
|
218
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}.
|
|
208
219
|
*/
|
|
209
|
-
createDetachedDataStore(
|
|
220
|
+
createDetachedDataStore(
|
|
221
|
+
pkg: Readonly<string[]>,
|
|
222
|
+
loadingGroupId?: string,
|
|
223
|
+
): IFluidDataStoreContextDetached;
|
|
210
224
|
|
|
211
225
|
/**
|
|
212
226
|
* Get an absolute url for a provided container-relative request.
|
|
@@ -226,6 +240,30 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
226
240
|
* Returns the current audience.
|
|
227
241
|
*/
|
|
228
242
|
getAudience(): IAudience;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Generates a new ID that is guaranteed to be unique across all sessions for this container.
|
|
246
|
+
* It could be in compact form (non-negative integer, oppotunistic), but it could also be UUID string.
|
|
247
|
+
* UUIDs generated will have low entropy in groups and will compress well.
|
|
248
|
+
* It can be leveraged anywhere in container where container unique IDs are required, i.e. any place
|
|
249
|
+
* that uses uuid() and stores result in container is likely candidate to start leveraging this API.
|
|
250
|
+
* If you always want to convert to string, instead of doing String(generateDocumentUniqueId()), consider
|
|
251
|
+
* doing encodeCompactIdToString(generateDocumentUniqueId()).
|
|
252
|
+
*
|
|
253
|
+
* For more details, please see IIdCompressor.generateDocumentUniqueId()
|
|
254
|
+
*/
|
|
255
|
+
generateDocumentUniqueId(): number | string;
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Api to fetch the snapshot from the service for a loadingGroupIds.
|
|
259
|
+
* @param loadingGroupIds - LoadingGroupId for which the snapshot is asked for.
|
|
260
|
+
* @param pathParts - Parts of the path, which we want to extract from the snapshot tree.
|
|
261
|
+
* @returns - snapshotTree and the sequence number of the snapshot.
|
|
262
|
+
*/
|
|
263
|
+
getSnapshotForLoadingGroupId(
|
|
264
|
+
loadingGroupIds: string[],
|
|
265
|
+
pathParts: string[],
|
|
266
|
+
): Promise<{ snapshotTree: ISnapshotTree; sequenceNumber: number }>;
|
|
229
267
|
}
|
|
230
268
|
|
|
231
269
|
/**
|
|
@@ -236,21 +274,6 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
236
274
|
* @alpha
|
|
237
275
|
*/
|
|
238
276
|
export interface IFluidDataStoreChannel extends IDisposable {
|
|
239
|
-
readonly id: string;
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Indicates the attachment state of the channel to a host service.
|
|
243
|
-
*/
|
|
244
|
-
readonly attachState: AttachState;
|
|
245
|
-
|
|
246
|
-
readonly visibilityState: VisibilityState;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Runs through the graph and attaches the bound handles. Then binds this runtime to the container.
|
|
250
|
-
* @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.
|
|
251
|
-
*/
|
|
252
|
-
attachGraph(): void;
|
|
253
|
-
|
|
254
277
|
/**
|
|
255
278
|
* Makes the data store channel visible in the container. Also, runs through its graph and attaches all
|
|
256
279
|
* bound handles that represent its dependencies in the container's graph.
|
|
@@ -258,19 +281,29 @@ export interface IFluidDataStoreChannel extends IDisposable {
|
|
|
258
281
|
makeVisibleAndAttachGraph(): void;
|
|
259
282
|
|
|
260
283
|
/**
|
|
261
|
-
*
|
|
284
|
+
* Synchronously retrieves the summary used as part of the initial summary message
|
|
262
285
|
*/
|
|
263
286
|
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
264
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore
|
|
290
|
+
*/
|
|
291
|
+
getAttachGCData?(telemetryContext?: ITelemetryContext): IGarbageCollectionData;
|
|
292
|
+
|
|
265
293
|
/**
|
|
266
294
|
* Processes the op.
|
|
267
295
|
*/
|
|
268
|
-
process(
|
|
296
|
+
process(
|
|
297
|
+
message: ISequencedDocumentMessage,
|
|
298
|
+
local: boolean,
|
|
299
|
+
localOpMetadata: unknown,
|
|
300
|
+
addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
|
|
301
|
+
): void;
|
|
269
302
|
|
|
270
303
|
/**
|
|
271
304
|
* Processes the signal.
|
|
272
305
|
*/
|
|
273
|
-
processSignal(message:
|
|
306
|
+
processSignal(message: IInboundSignalMessage, local: boolean): void;
|
|
274
307
|
|
|
275
308
|
/**
|
|
276
309
|
* Generates a summary for the channel.
|
|
@@ -353,37 +386,29 @@ export interface IFluidDataStoreContextEvents extends IEvent {
|
|
|
353
386
|
}
|
|
354
387
|
|
|
355
388
|
/**
|
|
356
|
-
* Represents the context for the data store. It is used by the data store runtime to
|
|
357
|
-
* get information and call functionality to
|
|
389
|
+
* Represents the context for the data store like objects. It is used by the data store runtime to
|
|
390
|
+
* get information and call functionality to its parent.
|
|
391
|
+
*
|
|
392
|
+
* This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.
|
|
393
|
+
*
|
|
358
394
|
* @alpha
|
|
359
395
|
*/
|
|
360
|
-
export interface
|
|
361
|
-
extends
|
|
362
|
-
Partial<IProvideFluidDataStoreRegistry
|
|
363
|
-
|
|
364
|
-
readonly id: string;
|
|
365
|
-
/**
|
|
366
|
-
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
367
|
-
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
368
|
-
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
369
|
-
* Value of this never changes even after the data store is attached.
|
|
370
|
-
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
371
|
-
* client and hence implement any scenario based on that.
|
|
372
|
-
*/
|
|
373
|
-
readonly isLocalDataStore: boolean;
|
|
374
|
-
/**
|
|
375
|
-
* The package path of the data store as per the package factory.
|
|
376
|
-
*/
|
|
377
|
-
readonly packagePath: readonly string[];
|
|
378
|
-
readonly options: ILoaderOptions;
|
|
396
|
+
export interface IFluidParentContext
|
|
397
|
+
extends IProvideFluidHandleContext,
|
|
398
|
+
Partial<IProvideFluidDataStoreRegistry> {
|
|
399
|
+
readonly options: Record<string | number, any>;
|
|
379
400
|
readonly clientId: string | undefined;
|
|
380
401
|
readonly connected: boolean;
|
|
381
402
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
382
403
|
readonly storage: IDocumentStorageService;
|
|
383
|
-
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
384
404
|
readonly logger: ITelemetryBaseLogger;
|
|
385
405
|
readonly clientDetails: IClientDetails;
|
|
386
406
|
readonly idCompressor?: IIdCompressor;
|
|
407
|
+
/**
|
|
408
|
+
* Represents the loading group to which the data store belongs to. Please refer to this readme for more context.
|
|
409
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}
|
|
410
|
+
*/
|
|
411
|
+
readonly loadingGroupId?: string;
|
|
387
412
|
/**
|
|
388
413
|
* Indicates the attachment state of the data store to a host service.
|
|
389
414
|
*/
|
|
@@ -391,16 +416,14 @@ export interface IFluidDataStoreContext
|
|
|
391
416
|
|
|
392
417
|
readonly containerRuntime: IContainerRuntimeBase;
|
|
393
418
|
|
|
394
|
-
/**
|
|
395
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
396
|
-
*/
|
|
397
|
-
readonly createProps?: any;
|
|
398
|
-
|
|
399
419
|
/**
|
|
400
420
|
* Ambient services provided with the context
|
|
401
421
|
*/
|
|
402
422
|
readonly scope: FluidObject;
|
|
403
423
|
|
|
424
|
+
readonly gcThrowOnTombstoneUsage: boolean;
|
|
425
|
+
readonly gcTombstoneEnforcementAllowed: boolean;
|
|
426
|
+
|
|
404
427
|
/**
|
|
405
428
|
* Returns the current quorum.
|
|
406
429
|
*/
|
|
@@ -445,12 +468,6 @@ export interface IFluidDataStoreContext
|
|
|
445
468
|
*/
|
|
446
469
|
makeLocallyVisible(): void;
|
|
447
470
|
|
|
448
|
-
/**
|
|
449
|
-
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
450
|
-
* @param address - The address of the channel that is dirty.
|
|
451
|
-
*/
|
|
452
|
-
setChannelDirty(address: string): void;
|
|
453
|
-
|
|
454
471
|
/**
|
|
455
472
|
* Get an absolute url to the container based on the provided relativeUrl.
|
|
456
473
|
* Returns undefined if the container or data store isn't attached to storage.
|
|
@@ -472,8 +489,62 @@ export interface IFluidDataStoreContext
|
|
|
472
489
|
createParam: CreateChildSummarizerNodeParam,
|
|
473
490
|
): CreateChildSummarizerNodeFn;
|
|
474
491
|
|
|
492
|
+
deleteChildSummarizerNode?(id: string): void;
|
|
493
|
+
|
|
475
494
|
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
476
495
|
|
|
496
|
+
/**
|
|
497
|
+
* @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
|
|
498
|
+
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
499
|
+
*
|
|
500
|
+
* Similar capability is exposed with from/to string paths instead of handles via @see addedGCOutboundRoute
|
|
501
|
+
*
|
|
502
|
+
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
503
|
+
* all references added in the system.
|
|
504
|
+
* @param srcHandle - The handle of the node that added the reference.
|
|
505
|
+
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
506
|
+
*/
|
|
507
|
+
addedGCOutboundReference?(
|
|
508
|
+
srcHandle: { absolutePath: string },
|
|
509
|
+
outboundHandle: { absolutePath: string },
|
|
510
|
+
): void;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
/**
|
|
514
|
+
* Represents the context for the data store. It is used by the data store runtime to
|
|
515
|
+
* get information and call functionality to the container.
|
|
516
|
+
* @alpha
|
|
517
|
+
*/
|
|
518
|
+
export interface IFluidDataStoreContext
|
|
519
|
+
extends IEventProvider<IFluidDataStoreContextEvents>,
|
|
520
|
+
IFluidParentContext {
|
|
521
|
+
readonly id: string;
|
|
522
|
+
/**
|
|
523
|
+
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
524
|
+
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
525
|
+
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
526
|
+
* Value of this never changes even after the data store is attached.
|
|
527
|
+
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
528
|
+
* client and hence implement any scenario based on that.
|
|
529
|
+
*/
|
|
530
|
+
readonly isLocalDataStore: boolean;
|
|
531
|
+
/**
|
|
532
|
+
* The package path of the data store as per the package factory.
|
|
533
|
+
*/
|
|
534
|
+
readonly packagePath: readonly string[];
|
|
535
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
539
|
+
*/
|
|
540
|
+
readonly createProps?: any;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
544
|
+
* @param address - The address of the channel that is dirty.
|
|
545
|
+
*/
|
|
546
|
+
setChannelDirty(address: string): void;
|
|
547
|
+
|
|
477
548
|
/**
|
|
478
549
|
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
479
550
|
*
|
|
@@ -483,15 +554,15 @@ export interface IFluidDataStoreContext
|
|
|
483
554
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
484
555
|
|
|
485
556
|
/**
|
|
486
|
-
*
|
|
487
|
-
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
557
|
+
* (Same as @see addedGCOutboundReference, but with string paths instead of handles)
|
|
488
558
|
*
|
|
489
559
|
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
490
560
|
* all references added in the system.
|
|
491
|
-
*
|
|
492
|
-
* @param
|
|
561
|
+
*
|
|
562
|
+
* @param fromPath - The absolute path of the node that added the reference.
|
|
563
|
+
* @param toPath - The absolute path of the outbound node that is referenced.
|
|
493
564
|
*/
|
|
494
|
-
|
|
565
|
+
addedGCOutboundRoute?(fromPath: string, toPath: string): void;
|
|
495
566
|
}
|
|
496
567
|
|
|
497
568
|
/**
|
|
@@ -504,5 +575,5 @@ export interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {
|
|
|
504
575
|
attachRuntime(
|
|
505
576
|
factory: IProvideFluidDataStoreFactory,
|
|
506
577
|
dataStoreRuntime: IFluidDataStoreChannel,
|
|
507
|
-
): Promise<
|
|
578
|
+
): Promise<IDataStore>;
|
|
508
579
|
}
|
package/src/dataStoreFactory.ts
CHANGED
package/src/dataStoreRegistry.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
export const gcTreeKey = "gc";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* The prefix for GC blobs in the GC tree in summary.
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -27,6 +27,12 @@ export const gcTombstoneBlobKey = "__tombstones";
|
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
29
|
export const gcDeletedBlobKey = "__deletedNodes";
|
|
30
|
+
/**
|
|
31
|
+
* The key for the GC Data blob in attach summaries.
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export const gcDataBlobKey = ".gcdata";
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
38
|
* Garbage collection data returned by nodes in a Container.
|
package/src/index.ts
CHANGED
|
@@ -3,55 +3,55 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export {
|
|
6
|
+
export type {
|
|
7
7
|
AttributionInfo,
|
|
8
8
|
AttributionKey,
|
|
9
9
|
DetachedAttributionKey,
|
|
10
10
|
LocalAttributionKey,
|
|
11
11
|
OpAttributionKey,
|
|
12
|
-
} from "./attribution";
|
|
13
|
-
export {
|
|
12
|
+
} from "./attribution.js";
|
|
13
|
+
export type {
|
|
14
14
|
AliasResult,
|
|
15
15
|
CreateChildSummarizerNodeFn,
|
|
16
|
-
FlushMode,
|
|
17
|
-
FlushModeExperimental,
|
|
18
16
|
IContainerRuntimeBase,
|
|
19
17
|
IContainerRuntimeBaseEvents,
|
|
20
18
|
IDataStore,
|
|
21
19
|
IFluidDataStoreChannel,
|
|
22
20
|
IFluidDataStoreContext,
|
|
21
|
+
IFluidParentContext,
|
|
23
22
|
IFluidDataStoreContextDetached,
|
|
24
23
|
IFluidDataStoreContextEvents,
|
|
25
|
-
|
|
26
|
-
} from "./dataStoreContext";
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
24
|
+
} from "./dataStoreContext.js";
|
|
25
|
+
export { FlushMode, FlushModeExperimental, VisibilityState } from "./dataStoreContext.js";
|
|
26
|
+
export type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
27
|
+
export { IFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
28
|
+
export type {
|
|
29
29
|
FluidDataStoreRegistryEntry,
|
|
30
|
-
IFluidDataStoreRegistry,
|
|
31
30
|
IProvideFluidDataStoreRegistry,
|
|
32
31
|
NamedFluidDataStoreRegistryEntries,
|
|
33
32
|
NamedFluidDataStoreRegistryEntry,
|
|
34
|
-
} from "./dataStoreRegistry";
|
|
33
|
+
} from "./dataStoreRegistry.js";
|
|
34
|
+
export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
35
|
+
export type {
|
|
36
|
+
IGarbageCollectionData,
|
|
37
|
+
IGarbageCollectionDetailsBase,
|
|
38
|
+
} from "./garbageCollectionDefinitions.js";
|
|
35
39
|
export {
|
|
36
40
|
gcBlobPrefix,
|
|
41
|
+
gcDataBlobKey,
|
|
37
42
|
gcDeletedBlobKey,
|
|
38
43
|
gcTombstoneBlobKey,
|
|
39
44
|
gcTreeKey,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} from "./garbageCollection";
|
|
43
|
-
export {
|
|
45
|
+
} from "./garbageCollectionDefinitions.js";
|
|
46
|
+
export type {
|
|
44
47
|
IAttachMessage,
|
|
45
48
|
IEnvelope,
|
|
46
49
|
IInboundSignalMessage,
|
|
47
50
|
InboundAttachMessage,
|
|
48
51
|
ISignalEnvelope,
|
|
49
|
-
} from "./protocol";
|
|
50
|
-
export {
|
|
51
|
-
blobCountPropertyName,
|
|
52
|
-
channelsTreeName,
|
|
52
|
+
} from "./protocol.js";
|
|
53
|
+
export type {
|
|
53
54
|
CreateChildSummarizerNodeParam,
|
|
54
|
-
CreateSummarizerNodeSource,
|
|
55
55
|
IExperimentalIncrementalSummaryContext,
|
|
56
56
|
ISummarizeInternalResult,
|
|
57
57
|
ISummarizeResult,
|
|
@@ -63,54 +63,10 @@ export {
|
|
|
63
63
|
ISummaryTreeWithStats,
|
|
64
64
|
ITelemetryContext,
|
|
65
65
|
SummarizeInternalFn,
|
|
66
|
-
|
|
67
|
-
} from "./summary";
|
|
68
|
-
|
|
69
|
-
// Re-exports for backwards compatibility.
|
|
70
|
-
// Will be removed in the future.
|
|
66
|
+
} from "./summary.js";
|
|
71
67
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
78
|
-
*/
|
|
79
|
-
IIdCompressor,
|
|
80
|
-
/**
|
|
81
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
82
|
-
*/
|
|
83
|
-
IIdCompressorCore,
|
|
84
|
-
/**
|
|
85
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
86
|
-
*/
|
|
87
|
-
IdCreationRange,
|
|
88
|
-
/**
|
|
89
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
90
|
-
*/
|
|
91
|
-
OpSpaceCompressedId,
|
|
92
|
-
/**
|
|
93
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
94
|
-
*/
|
|
95
|
-
SerializedIdCompressor,
|
|
96
|
-
/**
|
|
97
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
98
|
-
*/
|
|
99
|
-
SerializedIdCompressorWithNoSession,
|
|
100
|
-
/**
|
|
101
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
102
|
-
*/
|
|
103
|
-
SerializedIdCompressorWithOngoingSession,
|
|
104
|
-
/**
|
|
105
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
106
|
-
*/
|
|
107
|
-
SessionId,
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
110
|
-
*/
|
|
111
|
-
SessionSpaceCompressedId,
|
|
112
|
-
/**
|
|
113
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
114
|
-
*/
|
|
115
|
-
StableId,
|
|
116
|
-
} from "@fluidframework/id-compressor";
|
|
68
|
+
blobCountPropertyName,
|
|
69
|
+
channelsTreeName,
|
|
70
|
+
CreateSummarizerNodeSource,
|
|
71
|
+
totalBlobSizePropertyName,
|
|
72
|
+
} from "./summary.js";
|
package/src/protocol.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ISignalMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
6
|
+
import type { ISignalMessage, ITree } from "@fluidframework/protocol-definitions";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* An envelope wraps the contents with the intended target
|
|
@@ -23,6 +23,7 @@ export interface IEnvelope {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
26
|
+
* @deprecated - This interface is now moved to `@fluidframework/container-definitions` package. Please import from that package.
|
|
26
27
|
*/
|
|
27
28
|
export interface ISignalEnvelope {
|
|
28
29
|
/**
|
package/src/summary.ts
CHANGED
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import type { TelemetryBaseEventPropertyType } from "@fluidframework/core-interfaces";
|
|
7
|
+
import type {
|
|
8
8
|
SummaryTree,
|
|
9
9
|
ISummaryTree,
|
|
10
10
|
ISequencedDocumentMessage,
|
|
11
11
|
ISnapshotTree,
|
|
12
12
|
ITree,
|
|
13
13
|
} from "@fluidframework/protocol-definitions";
|
|
14
|
-
import {
|
|
14
|
+
import type {
|
|
15
|
+
IGarbageCollectionData,
|
|
16
|
+
IGarbageCollectionDetailsBase,
|
|
17
|
+
} from "./garbageCollectionDefinitions.js";
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* Contains the aggregation data from a Tree/Subtree.
|
|
@@ -125,16 +128,6 @@ export interface ISummarizerNodeConfig {
|
|
|
125
128
|
* Defaults to true.
|
|
126
129
|
*/
|
|
127
130
|
readonly canReuseHandle?: boolean;
|
|
128
|
-
/**
|
|
129
|
-
* True to always stop execution on error during summarize, or false to
|
|
130
|
-
* attempt creating a summary that is a pointer ot the last acked summary
|
|
131
|
-
* plus outstanding ops in case of internal summarize failure.
|
|
132
|
-
* Defaults to false.
|
|
133
|
-
*
|
|
134
|
-
* BUG BUG: Default to true while we investigate problem
|
|
135
|
-
* with differential summaries
|
|
136
|
-
*/
|
|
137
|
-
readonly throwOnFailure?: true;
|
|
138
131
|
}
|
|
139
132
|
|
|
140
133
|
/**
|
|
@@ -187,9 +180,6 @@ export interface ISummarizerNode {
|
|
|
187
180
|
invalidate(sequenceNumber: number): void;
|
|
188
181
|
/**
|
|
189
182
|
* Calls the internal summarize function and handles internal state tracking.
|
|
190
|
-
* If unchanged and fullTree is false, it will reuse previous summary subtree.
|
|
191
|
-
* If an error is encountered and throwOnFailure is false, it will try to make
|
|
192
|
-
* a summary with a pointer to the previous summary + a blob of outstanding ops.
|
|
193
183
|
* @param fullTree - true to skip optimizations and always generate the full tree
|
|
194
184
|
* @param trackState - indicates whether the summarizer node should track the state of the summary or not
|
|
195
185
|
* @param telemetryContext - summary data passed through the layers for telemetry purposes
|
|
@@ -238,7 +228,9 @@ export interface ISummarizerNode {
|
|
|
238
228
|
|
|
239
229
|
getChild(id: string): ISummarizerNode | undefined;
|
|
240
230
|
|
|
241
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* True if a summary is currently in progress
|
|
233
|
+
*/
|
|
242
234
|
isSummaryInProgress?(): boolean;
|
|
243
235
|
}
|
|
244
236
|
|
|
@@ -339,7 +331,7 @@ export interface ITelemetryContext {
|
|
|
339
331
|
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
340
332
|
* @param value - value to attribute to this summary telemetry data
|
|
341
333
|
*/
|
|
342
|
-
set(prefix: string, property: string, value:
|
|
334
|
+
set(prefix: string, property: string, value: TelemetryBaseEventPropertyType): void;
|
|
343
335
|
|
|
344
336
|
/**
|
|
345
337
|
* Sets multiple values for telemetry data being tracked.
|
|
@@ -350,20 +342,26 @@ export interface ITelemetryContext {
|
|
|
350
342
|
setMultiple(
|
|
351
343
|
prefix: string,
|
|
352
344
|
property: string,
|
|
353
|
-
values: Record<string,
|
|
345
|
+
values: Record<string, TelemetryBaseEventPropertyType>,
|
|
354
346
|
): void;
|
|
355
347
|
|
|
356
348
|
/**
|
|
357
349
|
* Get the telemetry data being tracked
|
|
350
|
+
*
|
|
351
|
+
* @deprecated This interface should only be used for instrumenting, not for attempting to read already-set telemetry data.
|
|
352
|
+
*
|
|
358
353
|
* @param prefix - unique prefix for this data (ex: "fluid:map:")
|
|
359
354
|
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
360
355
|
* @returns undefined if item not found
|
|
361
356
|
*/
|
|
362
|
-
get(prefix: string, property: string):
|
|
357
|
+
get(prefix: string, property: string): TelemetryBaseEventPropertyType;
|
|
363
358
|
|
|
364
359
|
/**
|
|
365
360
|
* Returns a serialized version of all the telemetry data.
|
|
366
361
|
* Should be used when logging in telemetry events.
|
|
362
|
+
*
|
|
363
|
+
* @deprecated This interface should only be used for instrumenting. A concrete implementation will likely have a serialize function
|
|
364
|
+
* but this functionality should not be used by other code being given an ITelemetryContext.
|
|
367
365
|
*/
|
|
368
366
|
serialize(): string;
|
|
369
367
|
}
|