@fluidframework/runtime-definitions 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488
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 +102 -84
- package/dist/dataStoreContext.d.ts +124 -73
- 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 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/protocol.d.ts +1 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/runtime-definitions-alpha.d.ts +184 -124
- package/dist/runtime-definitions-beta.d.ts +37 -30
- package/dist/runtime-definitions-public.d.ts +37 -30
- package/dist/runtime-definitions-untrimmed.d.ts +190 -125
- package/dist/summary.d.ts +15 -7
- 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 +464 -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 +1019 -0
- package/lib/runtime-definitions-beta.d.ts +242 -0
- package/lib/runtime-definitions-public.d.ts +242 -0
- package/lib/runtime-definitions-untrimmed.d.ts +1100 -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 +75 -31
- package/src/dataStoreContext.ts +144 -90
- 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 -22
- package/src/protocol.ts +1 -1
- package/src/summary.ts +18 -7
- 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,21 +203,23 @@ 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
|
|
202
|
-
* @param
|
|
203
|
-
*
|
|
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}
|
|
204
209
|
*/
|
|
205
|
-
createDataStore(pkg: string | string[]
|
|
210
|
+
createDataStore(pkg: Readonly<string | string[]>, loadingGroupId?: string): Promise<IDataStore>;
|
|
206
211
|
|
|
207
212
|
/**
|
|
208
213
|
* Creates detached data store context. Only after context.attachRuntime() is called,
|
|
209
214
|
* data store initialization is considered complete.
|
|
210
215
|
* @param pkg - Package name of the data store factory
|
|
211
|
-
* @param
|
|
212
|
-
*
|
|
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}.
|
|
213
219
|
*/
|
|
214
220
|
createDetachedDataStore(
|
|
215
221
|
pkg: Readonly<string[]>,
|
|
216
|
-
|
|
222
|
+
loadingGroupId?: string,
|
|
217
223
|
): IFluidDataStoreContextDetached;
|
|
218
224
|
|
|
219
225
|
/**
|
|
@@ -234,6 +240,30 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
234
240
|
* Returns the current audience.
|
|
235
241
|
*/
|
|
236
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 }>;
|
|
237
267
|
}
|
|
238
268
|
|
|
239
269
|
/**
|
|
@@ -244,21 +274,6 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
244
274
|
* @alpha
|
|
245
275
|
*/
|
|
246
276
|
export interface IFluidDataStoreChannel extends IDisposable {
|
|
247
|
-
readonly id: string;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Indicates the attachment state of the channel to a host service.
|
|
251
|
-
*/
|
|
252
|
-
readonly attachState: AttachState;
|
|
253
|
-
|
|
254
|
-
readonly visibilityState: VisibilityState;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Runs through the graph and attaches the bound handles. Then binds this runtime to the container.
|
|
258
|
-
* @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.
|
|
259
|
-
*/
|
|
260
|
-
attachGraph(): void;
|
|
261
|
-
|
|
262
277
|
/**
|
|
263
278
|
* Makes the data store channel visible in the container. Also, runs through its graph and attaches all
|
|
264
279
|
* bound handles that represent its dependencies in the container's graph.
|
|
@@ -266,19 +281,29 @@ export interface IFluidDataStoreChannel extends IDisposable {
|
|
|
266
281
|
makeVisibleAndAttachGraph(): void;
|
|
267
282
|
|
|
268
283
|
/**
|
|
269
|
-
*
|
|
284
|
+
* Synchronously retrieves the summary used as part of the initial summary message
|
|
270
285
|
*/
|
|
271
286
|
getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
|
|
272
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
|
+
|
|
273
293
|
/**
|
|
274
294
|
* Processes the op.
|
|
275
295
|
*/
|
|
276
|
-
process(
|
|
296
|
+
process(
|
|
297
|
+
message: ISequencedDocumentMessage,
|
|
298
|
+
local: boolean,
|
|
299
|
+
localOpMetadata: unknown,
|
|
300
|
+
addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
|
|
301
|
+
): void;
|
|
277
302
|
|
|
278
303
|
/**
|
|
279
304
|
* Processes the signal.
|
|
280
305
|
*/
|
|
281
|
-
processSignal(message:
|
|
306
|
+
processSignal(message: IInboundSignalMessage, local: boolean): void;
|
|
282
307
|
|
|
283
308
|
/**
|
|
284
309
|
* Generates a summary for the channel.
|
|
@@ -339,6 +364,8 @@ export interface IFluidDataStoreChannel extends IDisposable {
|
|
|
339
364
|
readonly entryPoint: IFluidHandle<FluidObject>;
|
|
340
365
|
|
|
341
366
|
request(request: IRequest): Promise<IResponse>;
|
|
367
|
+
|
|
368
|
+
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
342
369
|
}
|
|
343
370
|
|
|
344
371
|
/**
|
|
@@ -354,46 +381,29 @@ export type CreateChildSummarizerNodeFn = (
|
|
|
354
381
|
) => ISummarizerNodeWithGC;
|
|
355
382
|
|
|
356
383
|
/**
|
|
384
|
+
* Represents the context for the data store like objects. It is used by the data store runtime to
|
|
385
|
+
* get information and call functionality to its parent.
|
|
386
|
+
*
|
|
387
|
+
* This layout is temporary, as {@link IFluidParentContext} and {@link IFluidDataStoreContext} will converge.
|
|
388
|
+
*
|
|
357
389
|
* @alpha
|
|
358
390
|
*/
|
|
359
|
-
export interface
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Represents the context for the data store. It is used by the data store runtime to
|
|
365
|
-
* get information and call functionality to the container.
|
|
366
|
-
* @alpha
|
|
367
|
-
*/
|
|
368
|
-
export interface IFluidDataStoreContext
|
|
369
|
-
extends IEventProvider<IFluidDataStoreContextEvents>,
|
|
370
|
-
Partial<IProvideFluidDataStoreRegistry>,
|
|
371
|
-
IProvideFluidHandleContext {
|
|
372
|
-
readonly id: string;
|
|
373
|
-
/**
|
|
374
|
-
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
375
|
-
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
376
|
-
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
377
|
-
* Value of this never changes even after the data store is attached.
|
|
378
|
-
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
379
|
-
* client and hence implement any scenario based on that.
|
|
380
|
-
*/
|
|
381
|
-
readonly isLocalDataStore: boolean;
|
|
382
|
-
/**
|
|
383
|
-
* The package path of the data store as per the package factory.
|
|
384
|
-
*/
|
|
385
|
-
readonly packagePath: readonly string[];
|
|
386
|
-
readonly options: ILoaderOptions;
|
|
391
|
+
export interface IFluidParentContext
|
|
392
|
+
extends IProvideFluidHandleContext,
|
|
393
|
+
Partial<IProvideFluidDataStoreRegistry> {
|
|
394
|
+
readonly options: Record<string | number, any>;
|
|
387
395
|
readonly clientId: string | undefined;
|
|
388
396
|
readonly connected: boolean;
|
|
389
397
|
readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
|
|
390
398
|
readonly storage: IDocumentStorageService;
|
|
391
|
-
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
392
399
|
readonly logger: ITelemetryBaseLogger;
|
|
393
400
|
readonly clientDetails: IClientDetails;
|
|
394
401
|
readonly idCompressor?: IIdCompressor;
|
|
395
|
-
|
|
396
|
-
|
|
402
|
+
/**
|
|
403
|
+
* Represents the loading group to which the data store belongs to. Please refer to this readme for more context.
|
|
404
|
+
* {@link https://github.com/microsoft/FluidFramework/blob/main/packages/runtime/container-runtime/README.md | README}
|
|
405
|
+
*/
|
|
406
|
+
readonly loadingGroupId?: string;
|
|
397
407
|
/**
|
|
398
408
|
* Indicates the attachment state of the data store to a host service.
|
|
399
409
|
*/
|
|
@@ -401,16 +411,14 @@ export interface IFluidDataStoreContext
|
|
|
401
411
|
|
|
402
412
|
readonly containerRuntime: IContainerRuntimeBase;
|
|
403
413
|
|
|
404
|
-
/**
|
|
405
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
406
|
-
*/
|
|
407
|
-
readonly createProps?: any;
|
|
408
|
-
|
|
409
414
|
/**
|
|
410
415
|
* Ambient services provided with the context
|
|
411
416
|
*/
|
|
412
417
|
readonly scope: FluidObject;
|
|
413
418
|
|
|
419
|
+
readonly gcThrowOnTombstoneUsage: boolean;
|
|
420
|
+
readonly gcTombstoneEnforcementAllowed: boolean;
|
|
421
|
+
|
|
414
422
|
/**
|
|
415
423
|
* Returns the current quorum.
|
|
416
424
|
*/
|
|
@@ -455,12 +463,6 @@ export interface IFluidDataStoreContext
|
|
|
455
463
|
*/
|
|
456
464
|
makeLocallyVisible(): void;
|
|
457
465
|
|
|
458
|
-
/**
|
|
459
|
-
* Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
460
|
-
* @param address - The address of the channel that is dirty.
|
|
461
|
-
*/
|
|
462
|
-
setChannelDirty(address: string): void;
|
|
463
|
-
|
|
464
466
|
/**
|
|
465
467
|
* Get an absolute url to the container based on the provided relativeUrl.
|
|
466
468
|
* Returns undefined if the container or data store isn't attached to storage.
|
|
@@ -482,8 +484,60 @@ export interface IFluidDataStoreContext
|
|
|
482
484
|
createParam: CreateChildSummarizerNodeParam,
|
|
483
485
|
): CreateChildSummarizerNodeFn;
|
|
484
486
|
|
|
487
|
+
deleteChildSummarizerNode(id: string): void;
|
|
488
|
+
|
|
485
489
|
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
486
490
|
|
|
491
|
+
/**
|
|
492
|
+
* @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
|
|
493
|
+
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
494
|
+
*
|
|
495
|
+
* Similar capability is exposed with from/to string paths instead of handles via @see addedGCOutboundRoute
|
|
496
|
+
*
|
|
497
|
+
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
498
|
+
* all references added in the system.
|
|
499
|
+
* @param srcHandle - The handle of the node that added the reference.
|
|
500
|
+
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
501
|
+
*/
|
|
502
|
+
addedGCOutboundReference?(
|
|
503
|
+
srcHandle: { absolutePath: string },
|
|
504
|
+
outboundHandle: { absolutePath: string },
|
|
505
|
+
): void;
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* Called by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
|
|
509
|
+
* @param address - The address of the channel that is dirty.
|
|
510
|
+
*/
|
|
511
|
+
setChannelDirty(address: string): void;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Represents the context for the data store. It is used by the data store runtime to
|
|
516
|
+
* get information and call functionality to the container.
|
|
517
|
+
* @alpha
|
|
518
|
+
*/
|
|
519
|
+
export interface IFluidDataStoreContext extends IFluidParentContext {
|
|
520
|
+
readonly id: string;
|
|
521
|
+
/**
|
|
522
|
+
* A data store created by a client, is a local data store for that client. Also, when a detached container loads
|
|
523
|
+
* from a snapshot, all the data stores are treated as local data stores because at that stage the container
|
|
524
|
+
* still doesn't exists in storage and so the data store couldn't have been created by any other client.
|
|
525
|
+
* Value of this never changes even after the data store is attached.
|
|
526
|
+
* As implementer of data store runtime, you can use this property to check that this data store belongs to this
|
|
527
|
+
* client and hence implement any scenario based on that.
|
|
528
|
+
*/
|
|
529
|
+
readonly isLocalDataStore: boolean;
|
|
530
|
+
/**
|
|
531
|
+
* The package path of the data store as per the package factory.
|
|
532
|
+
*/
|
|
533
|
+
readonly packagePath: readonly string[];
|
|
534
|
+
readonly baseSnapshot: ISnapshotTree | undefined;
|
|
535
|
+
|
|
536
|
+
/**
|
|
537
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
538
|
+
*/
|
|
539
|
+
readonly createProps?: any;
|
|
540
|
+
|
|
487
541
|
/**
|
|
488
542
|
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
489
543
|
*
|
|
@@ -493,15 +547,15 @@ export interface IFluidDataStoreContext
|
|
|
493
547
|
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
494
548
|
|
|
495
549
|
/**
|
|
496
|
-
*
|
|
497
|
-
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
550
|
+
* (Same as @see addedGCOutboundReference, but with string paths instead of handles)
|
|
498
551
|
*
|
|
499
552
|
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
500
553
|
* all references added in the system.
|
|
501
|
-
*
|
|
502
|
-
* @param
|
|
554
|
+
*
|
|
555
|
+
* @param fromPath - The absolute path of the node that added the reference.
|
|
556
|
+
* @param toPath - The absolute path of the outbound node that is referenced.
|
|
503
557
|
*/
|
|
504
|
-
|
|
558
|
+
addedGCOutboundRoute?(fromPath: string, toPath: string): void;
|
|
505
559
|
}
|
|
506
560
|
|
|
507
561
|
/**
|
|
@@ -514,5 +568,5 @@ export interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {
|
|
|
514
568
|
attachRuntime(
|
|
515
569
|
factory: IProvideFluidDataStoreFactory,
|
|
516
570
|
dataStoreRuntime: IFluidDataStoreChannel,
|
|
517
|
-
): Promise<
|
|
571
|
+
): Promise<IDataStore>;
|
|
518
572
|
}
|
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,54 @@
|
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
} from "./
|
|
27
|
-
export { IFluidDataStoreFactory
|
|
28
|
-
export {
|
|
23
|
+
} from "./dataStoreContext.js";
|
|
24
|
+
export { FlushMode, FlushModeExperimental, VisibilityState } from "./dataStoreContext.js";
|
|
25
|
+
export type { IProvideFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
26
|
+
export { IFluidDataStoreFactory } from "./dataStoreFactory.js";
|
|
27
|
+
export type {
|
|
29
28
|
FluidDataStoreRegistryEntry,
|
|
30
|
-
IFluidDataStoreRegistry,
|
|
31
29
|
IProvideFluidDataStoreRegistry,
|
|
32
30
|
NamedFluidDataStoreRegistryEntries,
|
|
33
31
|
NamedFluidDataStoreRegistryEntry,
|
|
34
|
-
} from "./dataStoreRegistry";
|
|
32
|
+
} from "./dataStoreRegistry.js";
|
|
33
|
+
export { IFluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
34
|
+
export type {
|
|
35
|
+
IGarbageCollectionData,
|
|
36
|
+
IGarbageCollectionDetailsBase,
|
|
37
|
+
} from "./garbageCollectionDefinitions.js";
|
|
35
38
|
export {
|
|
36
39
|
gcBlobPrefix,
|
|
40
|
+
gcDataBlobKey,
|
|
37
41
|
gcDeletedBlobKey,
|
|
38
42
|
gcTombstoneBlobKey,
|
|
39
43
|
gcTreeKey,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} from "./garbageCollection";
|
|
43
|
-
export {
|
|
44
|
+
} from "./garbageCollectionDefinitions.js";
|
|
45
|
+
export type {
|
|
44
46
|
IAttachMessage,
|
|
45
47
|
IEnvelope,
|
|
46
48
|
IInboundSignalMessage,
|
|
47
49
|
InboundAttachMessage,
|
|
48
50
|
ISignalEnvelope,
|
|
49
|
-
} from "./protocol";
|
|
50
|
-
export {
|
|
51
|
-
blobCountPropertyName,
|
|
52
|
-
channelsTreeName,
|
|
51
|
+
} from "./protocol.js";
|
|
52
|
+
export type {
|
|
53
53
|
CreateChildSummarizerNodeParam,
|
|
54
|
-
CreateSummarizerNodeSource,
|
|
55
54
|
IExperimentalIncrementalSummaryContext,
|
|
56
55
|
ISummarizeInternalResult,
|
|
57
56
|
ISummarizeResult,
|
|
@@ -63,5 +62,10 @@ export {
|
|
|
63
62
|
ISummaryTreeWithStats,
|
|
64
63
|
ITelemetryContext,
|
|
65
64
|
SummarizeInternalFn,
|
|
65
|
+
} from "./summary.js";
|
|
66
|
+
export {
|
|
67
|
+
blobCountPropertyName,
|
|
68
|
+
channelsTreeName,
|
|
69
|
+
CreateSummarizerNodeSource,
|
|
66
70
|
totalBlobSizePropertyName,
|
|
67
|
-
} from "./summary";
|
|
71
|
+
} 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
|
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.
|
|
@@ -225,7 +228,9 @@ export interface ISummarizerNode {
|
|
|
225
228
|
|
|
226
229
|
getChild(id: string): ISummarizerNode | undefined;
|
|
227
230
|
|
|
228
|
-
/**
|
|
231
|
+
/**
|
|
232
|
+
* True if a summary is currently in progress
|
|
233
|
+
*/
|
|
229
234
|
isSummaryInProgress?(): boolean;
|
|
230
235
|
}
|
|
231
236
|
|
|
@@ -326,7 +331,7 @@ export interface ITelemetryContext {
|
|
|
326
331
|
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
327
332
|
* @param value - value to attribute to this summary telemetry data
|
|
328
333
|
*/
|
|
329
|
-
set(prefix: string, property: string, value:
|
|
334
|
+
set(prefix: string, property: string, value: TelemetryBaseEventPropertyType): void;
|
|
330
335
|
|
|
331
336
|
/**
|
|
332
337
|
* Sets multiple values for telemetry data being tracked.
|
|
@@ -337,20 +342,26 @@ export interface ITelemetryContext {
|
|
|
337
342
|
setMultiple(
|
|
338
343
|
prefix: string,
|
|
339
344
|
property: string,
|
|
340
|
-
values: Record<string,
|
|
345
|
+
values: Record<string, TelemetryBaseEventPropertyType>,
|
|
341
346
|
): void;
|
|
342
347
|
|
|
343
348
|
/**
|
|
344
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
|
+
*
|
|
345
353
|
* @param prefix - unique prefix for this data (ex: "fluid:map:")
|
|
346
354
|
* @param property - property name of the telemetry data being tracked (ex: "DirectoryCount")
|
|
347
355
|
* @returns undefined if item not found
|
|
348
356
|
*/
|
|
349
|
-
get(prefix: string, property: string):
|
|
357
|
+
get(prefix: string, property: string): TelemetryBaseEventPropertyType;
|
|
350
358
|
|
|
351
359
|
/**
|
|
352
360
|
* Returns a serialized version of all the telemetry data.
|
|
353
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.
|
|
354
365
|
*/
|
|
355
366
|
serialize(): string;
|
|
356
367
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends":
|
|
3
|
-
"../../../common/build/build-common/tsconfig.base.json",
|
|
4
|
-
"../../../common/build/build-common/tsconfig.esm-only.json",
|
|
5
|
-
],
|
|
2
|
+
"extends": "../../../common/build/build-common/tsconfig.node16.json",
|
|
6
3
|
"include": ["src/**/*"],
|
|
7
4
|
"exclude": ["src/test/**/*"],
|
|
8
5
|
"compilerOptions": {
|
|
9
6
|
"rootDir": "./src",
|
|
10
|
-
"outDir": "./
|
|
7
|
+
"outDir": "./lib",
|
|
11
8
|
},
|
|
12
9
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,eAAO,MAAM,SAAS,OAAO,CAAC;AAC9B;;;;GAIG;AACH,eAAO,MAAM,YAAY,SAAS,CAAC;AACnC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AACjD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,mBAAmB,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACtC;;OAEG;IACH,OAAO,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAChC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.js","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;GAIG;AACU,QAAA,SAAS,GAAG,IAAI,CAAC;AAC9B;;;;GAIG;AACU,QAAA,YAAY,GAAG,MAAM,CAAC;AACnC;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,cAAc,CAAC;AACjD;;;;GAIG;AACU,QAAA,gBAAgB,GAAG,gBAAgB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The key for the GC tree in summary.\n *\n * @internal\n */\nexport const gcTreeKey = \"gc\";\n/**\n * They prefix for GC blobs in the GC tree in summary.\n *\n * @internal\n */\nexport const gcBlobPrefix = \"__gc\";\n/**\n * The key for tombstone blob in the GC tree in summary.\n *\n * @internal\n */\nexport const gcTombstoneBlobKey = \"__tombstones\";\n/**\n * The key for deleted nodes blob in the GC tree in summary.\n *\n * @internal\n */\nexport const gcDeletedBlobKey = \"__deletedNodes\";\n\n/**\n * Garbage collection data returned by nodes in a Container.\n * Used for running GC in the Container.\n * @public\n */\nexport interface IGarbageCollectionData {\n\t/**\n\t * The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.\n\t */\n\tgcNodes: { [id: string]: string[] };\n}\n\n/**\n * GC details provided to each node during creation.\n * @alpha\n */\nexport interface IGarbageCollectionDetailsBase {\n\t/**\n\t * A list of routes to Fluid objects that are used in this node.\n\t */\n\tusedRoutes?: string[];\n\t/**\n\t * The GC data of this node.\n\t */\n\tgcData?: IGarbageCollectionData;\n}\n"]}
|