@fluidframework/runtime-definitions 2.0.0-internal.2.2.1 → 2.0.0-internal.2.3.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.js +1 -1
- package/dist/dataStoreContext.d.ts +15 -5
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +6 -2
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/garbageCollection.d.ts +12 -6
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +7 -3
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/summary.d.ts +63 -14
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/package.json +15 -10
- package/src/dataStoreContext.ts +14 -5
- package/src/garbageCollection.ts +15 -7
- package/src/index.ts +9 -1
- package/src/summary.ts +64 -13
package/.eslintrc.js
CHANGED
|
@@ -31,7 +31,9 @@ export declare enum FlushMode {
|
|
|
31
31
|
* locally within the container only or visible globally to all clients.
|
|
32
32
|
*/
|
|
33
33
|
export declare const VisibilityState: {
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Indicates that the object is not visible. This is the state when an object is first created.
|
|
36
|
+
*/
|
|
35
37
|
NotVisible: string;
|
|
36
38
|
/**
|
|
37
39
|
* Indicates that the object is visible locally within the container. This is the state when an object is attached
|
|
@@ -154,7 +156,9 @@ export interface IContainerRuntimeBase extends IEventProvider<IContainerRuntimeB
|
|
|
154
156
|
*/
|
|
155
157
|
getAudience(): IAudience;
|
|
156
158
|
}
|
|
157
|
-
/**
|
|
159
|
+
/**
|
|
160
|
+
* @deprecated Used only in deprecated API bindToContext
|
|
161
|
+
*/
|
|
158
162
|
export declare enum BindState {
|
|
159
163
|
NotBound = "NotBound",
|
|
160
164
|
Binding = "Binding",
|
|
@@ -248,7 +252,11 @@ export interface IFluidDataStoreChannel extends IFluidRouter, IDisposable {
|
|
|
248
252
|
*/
|
|
249
253
|
readonly entryPoint?: IFluidHandle<FluidObject>;
|
|
250
254
|
}
|
|
251
|
-
export declare type CreateChildSummarizerNodeFn = (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
255
|
+
export declare type CreateChildSummarizerNodeFn = (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
256
|
+
/**
|
|
257
|
+
* @deprecated - The functionality to get base GC details has been moved to summarizer node.
|
|
258
|
+
*/
|
|
259
|
+
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>) => ISummarizerNodeWithGC;
|
|
252
260
|
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
253
261
|
(event: "attaching" | "attached", listener: () => void): any;
|
|
254
262
|
}
|
|
@@ -316,7 +324,7 @@ export interface IFluidDataStoreContext extends IEventProvider<IFluidDataStoreCo
|
|
|
316
324
|
*/
|
|
317
325
|
submitSignal(type: string, content: any): void;
|
|
318
326
|
/**
|
|
319
|
-
* @deprecated
|
|
327
|
+
* @deprecated To be removed in favor of makeVisible.
|
|
320
328
|
* Register the runtime to the container
|
|
321
329
|
*/
|
|
322
330
|
bindToContext(): void;
|
|
@@ -337,7 +345,9 @@ export interface IFluidDataStoreContext extends IEventProvider<IFluidDataStoreCo
|
|
|
337
345
|
*/
|
|
338
346
|
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
339
347
|
getCreateChildSummarizerNodeFn(
|
|
340
|
-
/**
|
|
348
|
+
/**
|
|
349
|
+
* Initial id or path part of this node
|
|
350
|
+
*/
|
|
341
351
|
id: string,
|
|
342
352
|
/**
|
|
343
353
|
* Information needed to create the node.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EACH,YAAY,EACZ,0BAA0B,EAC1B,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,aAAa,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAChC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EACH,8BAA8B,EAC9B,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACtB,MAAM,WAAW,CAAC;AAEnB;;GAEG;AACH,oBAAY,SAAS;IACjB;;OAEG;IACH,SAAS,IAAA;IAET;;;OAGG;IACH,SAAS,IAAA;CACZ;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;IACxB
|
|
1
|
+
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAC/G,OAAO,EACH,YAAY,EACZ,0BAA0B,EAC1B,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,WAAW,EAC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;IAEjE,8BAA8B;IAC1B;;OAEG;IACH,EAAE,EAAE,MAAM;IACV;;;;;OAKG;IACH,WAAW,EAAE,8BAA8B,GAC5C,2BAA2B,CAAC;IAE/B,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC,CAAC;IAE1E;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,6BAA6B,CAAC,CAAC;IAE3D;;;;;OAKG;IACH,wBAAwB,CAAC,CAAC,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,GAAG,IAAI,CAAC;CAC1F;AAED,MAAM,WAAW,8BAA+B,SAAQ,sBAAsB;IAC1E;;OAEG;IACH,aAAa,CACT,OAAO,EAAE,6BAA6B,EACtC,gBAAgB,EAAE,sBAAsB,GACzC,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB"}
|
package/dist/dataStoreContext.js
CHANGED
|
@@ -25,7 +25,9 @@ var FlushMode;
|
|
|
25
25
|
* locally within the container only or visible globally to all clients.
|
|
26
26
|
*/
|
|
27
27
|
exports.VisibilityState = {
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Indicates that the object is not visible. This is the state when an object is first created.
|
|
30
|
+
*/
|
|
29
31
|
NotVisible: "NotVisible",
|
|
30
32
|
/**
|
|
31
33
|
* Indicates that the object is visible locally within the container. This is the state when an object is attached
|
|
@@ -44,7 +46,9 @@ exports.VisibilityState = {
|
|
|
44
46
|
*/
|
|
45
47
|
GloballyVisible: "GloballyVisible",
|
|
46
48
|
};
|
|
47
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Used only in deprecated API bindToContext
|
|
51
|
+
*/
|
|
48
52
|
var BindState;
|
|
49
53
|
(function (BindState) {
|
|
50
54
|
BindState["NotBound"] = "NotBound";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwCH;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACjB;;OAEG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACb,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC3B,mGAAmG;IACnG,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CACrC,CAAC;AAgIF,8DAA8D;AAC9D,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable, IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport {\n IFluidRouter,\n IProvideFluidHandleContext,\n IFluidHandle,\n IRequest,\n IResponse,\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IAudience,\n IDeltaManager,\n AttachState,\n ILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nimport { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\nimport { IInboundSignalMessage } from \"./protocol\";\nimport {\n CreateChildSummarizerNodeParam,\n ISummarizerNodeWithGC,\n ISummaryTreeWithStats,\n ITelemetryContext,\n SummarizeInternalFn,\n} from \"./summary\";\n\n/**\n * Runtime flush mode handling\n */\nexport enum FlushMode {\n /**\n * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n */\n Immediate,\n\n /**\n * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n */\n TurnBased,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n */\nexport const VisibilityState = {\n /** Indicates that the object is not visible. This is the state when an object is first created. */\n NotVisible: \"NotVisible\",\n\n /**\n * Indicates that the object is visible locally within the container. This is the state when an object is attached\n * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n * visible to locally visible.\n */\n LocallyVisible: \"LocallyVisible\",\n\n /**\n * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n *\n * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n * not visible to globally visible.\n *\n * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n * visible.\n */\n GloballyVisible: \"GloballyVisible\",\n};\nexport type VisibilityState = typeof VisibilityState[keyof typeof VisibilityState];\n\nexport interface IContainerRuntimeBaseEvents extends IEvent{\n (event: \"batchBegin\", listener: (op: ISequencedDocumentMessage) => void);\n /**\n * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. it's type and content\n * represent internal container runtime type / content.\n */\n (event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n (event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void);\n (event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire a handle to it,\n * use the `IContainerRuntime.getRootDataStore` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n */\nexport interface IDataStore extends IFluidRouter {\n /**\n * Attempt to assign an alias to the datastore.\n * If the operation succeeds, the datastore can be referenced\n * by the supplied alias and will not be garbage collected.\n *\n * @param alias - Given alias for this datastore.\n */\n trySetAlias(alias: string): Promise<AliasResult>;\n\n /**\n * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n * with it. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented in a\n * particular scenario) fall back to the current approach of requesting the root object through the request pattern.\n *\n * @remarks The plan is that eventually the data store will stop providing IFluidRouter functionality, this property\n * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n * the data store's entryPoint.\n */\n readonly entryPoint?: IFluidHandle<FluidObject>;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n */\nexport interface IContainerRuntimeBase extends\n IEventProvider<IContainerRuntimeBaseEvents>,\n IProvideFluidHandleContext {\n\n readonly logger: ITelemetryBaseLogger;\n readonly clientDetails: IClientDetails;\n\n /**\n * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n * sequentially. Total size of all messages must be less than maxOpSize.\n */\n orderSequentially(callback: () => void): void;\n\n /**\n * Executes a request against the container runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Submits a container runtime level signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * @deprecated 0.16 Issue #1537, #3631\n * @internal\n */\n _createDataStoreWithProps(\n pkg: string | string[],\n props?: any,\n id?: string,\n ): Promise<IDataStore>;\n\n /**\n * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n * store being attached to storage.\n * @param pkg - Package name of the data store factory\n */\n createDataStore(pkg: string | string[]): Promise<IDataStore>;\n\n /**\n * Creates detached data store context. Only after context.attachRuntime() is called,\n * data store initialization is considered complete.\n */\n createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * Returns undefined if the container or data store isn't attached to storage.\n * @param relativeUrl - A relative request within the container\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n}\n\n/** @deprecated - Used only in deprecated API bindToContext */\nexport enum BindState {\n NotBound = \"NotBound\",\n Binding = \"Binding\",\n Bound = \"Bound\",\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n */\nexport interface IFluidDataStoreChannel extends\n IFluidRouter,\n IDisposable {\n\n readonly id: string;\n\n /**\n * Indicates the attachment state of the channel to a host service.\n */\n readonly attachState: AttachState;\n\n readonly visibilityState?: VisibilityState;\n\n /**\n * Runs through the graph and attaches the bound handles. Then binds this runtime to the container.\n * @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.\n */\n attachGraph(): void;\n\n /**\n * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n * bound handles that represent its dependencies in the container's graph.\n */\n makeVisibleAndAttachGraph(): void;\n\n /**\n * Retrieves the summary used as part of the initial summary message\n */\n getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n /**\n * Processes the op.\n */\n process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n /**\n * Processes the signal.\n */\n processSignal(message: any, local: boolean): void;\n\n /**\n * Generates a summary for the channel.\n * Introduced with summarizerNode - will be required in a future release.\n * @param fullTree - true to bypass optimizations and force a full summary tree.\n * @param trackState - This tells whether we should track state from this summary.\n * @param telemetryContext - summary data passed through the layers for telemetry purposes\n */\n summarize(\n fullTree?: boolean,\n trackState?: boolean,\n telemetryContext?: ITelemetryContext,\n ): Promise<ISummaryTreeWithStats>;\n\n /**\n * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n /**\n * After GC has run, called to notify this channel of routes that are used in it.\n * @param usedRoutes - The routes that are used in this channel.\n */\n updateUsedRoutes(usedRoutes: string[]): void;\n\n /**\n * Notifies this object about changes in the connection state.\n * @param value - New connection state.\n * @param clientId - ID of the client. It's old ID when in disconnected state and\n * it's new client ID when we are connecting or connected.\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n * @param type - The type of the original message.\n * @param content - The content of the original message.\n * @param localOpMetadata - The local metadata associated with the original message.\n */\n reSubmit(type: string, content: any, localOpMetadata: unknown);\n\n applyStashedOp(content: any): Promise<unknown>;\n\n /**\n * Revert a local message.\n * @param type - The type of the original message.\n * @param content - The content of the original message.\n * @param localOpMetadata - The local metadata associated with the original message.\n */\n rollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n /**\n * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n * with the component. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented\n * in a particular scenario) fall back to the current approach of requesting the root object through the request\n * pattern.\n *\n * @remarks The plan is that eventually the component will stop providing IFluidRouter functionality, this property\n * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n * the component's entryPoint.\n */\n readonly entryPoint?: IFluidHandle<FluidObject>;\n}\n\nexport type CreateChildSummarizerNodeFn = (\n summarizeInternal: SummarizeInternalFn,\n getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n getBaseGCDetailsFn: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\nexport interface IFluidDataStoreContextEvents extends IEvent {\n (event: \"attaching\" | \"attached\", listener: () => void);\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n */\nexport interface IFluidDataStoreContext extends\n IEventProvider<IFluidDataStoreContextEvents>,\n Partial<IProvideFluidDataStoreRegistry>,\n IProvideFluidHandleContext {\n readonly id: string;\n /**\n * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n * Value of this never changes even after the data store is attached.\n * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n * client and hence implement any scenario based on that.\n */\n readonly isLocalDataStore: boolean;\n /**\n * The package path of the data store as per the package factory.\n */\n readonly packagePath: readonly string[];\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly connected: boolean;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly storage: IDocumentStorageService;\n readonly baseSnapshot: ISnapshotTree | undefined;\n readonly logger: ITelemetryBaseLogger;\n readonly clientDetails: IClientDetails;\n /**\n * Indicates the attachment state of the data store to a host service.\n */\n readonly attachState: AttachState;\n\n readonly containerRuntime: IContainerRuntimeBase;\n\n /**\n * @deprecated 0.16 Issue #1635, #3631\n */\n readonly createProps?: any;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n\n /**\n * Submits the message to be sent to other clients.\n * @param type - Type of the message.\n * @param content - Content of the message.\n * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n * the server. This will be sent back when this message is received back from the server. This is also sent if\n * we are asked to resubmit the message.\n */\n submitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n /**\n * Submits the signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * @deprecated - To be removed in favor of makeVisible.\n * Register the runtime to the container\n */\n bindToContext(): void;\n\n /**\n * Called to make the data store locally visible in the container. This happens automatically for root data stores\n * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n */\n makeLocallyVisible(): void;\n\n /**\n * Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n * @param address - The address of the channel that is dirty.\n */\n setChannelDirty(address: string): void;\n\n /**\n * Get an absolute url to the container based on the provided relativeUrl.\n * Returns undefined if the container or data store isn't attached to storage.\n * @param relativeUrl - A relative request within the container\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n getCreateChildSummarizerNodeFn(\n /** Initial id or path part of this node */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n ): CreateChildSummarizerNodeFn;\n\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n * and its children with the GC details from the previous summary.\n */\n getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n /**\n * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n * all references added in the system.\n * @param srcHandle - The handle of the node that added the reference.\n * @param outboundHandle - The handle of the outbound node that is referenced.\n */\n addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n /**\n * Binds a runtime to the context.\n */\n attachRuntime(\n factory: IProvideFluidDataStoreFactory,\n dataStoreRuntime: IFluidDataStoreChannel,\n ): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dataStoreContext.js","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwCH;;GAEG;AACH,IAAY,SAWX;AAXD,WAAY,SAAS;IACjB;;OAEG;IACH,mDAAS,CAAA;IAET;;;OAGG;IACH,mDAAS,CAAA;AACb,CAAC,EAXW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAWpB;AAED;;;GAGG;AACU,QAAA,eAAe,GAAG;IAC3B;;OAEG;IACH,UAAU,EAAE,YAAY;IAExB;;;;OAIG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;;;;;;;OAQG;IACH,eAAe,EAAE,iBAAiB;CACrC,CAAC;AAgIF;;GAEG;AACH,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,kCAAqB,CAAA;IACrB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACnB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, IDisposable, IEvent, IEventProvider } from \"@fluidframework/common-definitions\";\nimport {\n IFluidRouter,\n IProvideFluidHandleContext,\n IFluidHandle,\n IRequest,\n IResponse,\n FluidObject,\n} from \"@fluidframework/core-interfaces\";\nimport {\n IAudience,\n IDeltaManager,\n AttachState,\n ILoaderOptions,\n} from \"@fluidframework/container-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport {\n IClientDetails,\n IDocumentMessage,\n IQuorumClients,\n ISequencedDocumentMessage,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport { IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nimport { IProvideFluidDataStoreRegistry } from \"./dataStoreRegistry\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\nimport { IInboundSignalMessage } from \"./protocol\";\nimport {\n CreateChildSummarizerNodeParam,\n ISummarizerNodeWithGC,\n ISummaryTreeWithStats,\n ITelemetryContext,\n SummarizeInternalFn,\n} from \"./summary\";\n\n/**\n * Runtime flush mode handling\n */\nexport enum FlushMode {\n /**\n * In Immediate flush mode the runtime will immediately send all operations to the driver layer.\n */\n Immediate,\n\n /**\n * When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single\n * batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.\n */\n TurnBased,\n}\n\n/**\n * This tells the visibility state of a Fluid object. It basically tracks whether the object is not visible, visible\n * locally within the container only or visible globally to all clients.\n */\nexport const VisibilityState = {\n /**\n * Indicates that the object is not visible. This is the state when an object is first created.\n */\n NotVisible: \"NotVisible\",\n\n /**\n * Indicates that the object is visible locally within the container. This is the state when an object is attached\n * to the container's graph but the container itself isn't globally visible. The object's state goes from not\n * visible to locally visible.\n */\n LocallyVisible: \"LocallyVisible\",\n\n /**\n * Indicates that the object is visible globally to all clients. This is the state of an object in 2 scenarios:\n *\n * 1. It is attached to the container's graph when the container is globally visible. The object's state goes from\n * not visible to globally visible.\n *\n * 2. When a container becomes globally visible, all locally visible objects go from locally visible to globally\n * visible.\n */\n GloballyVisible: \"GloballyVisible\",\n};\nexport type VisibilityState = typeof VisibilityState[keyof typeof VisibilityState];\n\nexport interface IContainerRuntimeBaseEvents extends IEvent{\n (event: \"batchBegin\", listener: (op: ISequencedDocumentMessage) => void);\n /**\n * @param runtimeMessage - tells if op is runtime op. If it is, it was unpacked, i.e. it's type and content\n * represent internal container runtime type / content.\n */\n (event: \"op\", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void);\n (event: \"batchEnd\", listener: (error: any, op: ISequencedDocumentMessage) => void);\n (event: \"signal\", listener: (message: IInboundSignalMessage, local: boolean) => void);\n}\n\n/**\n * Encapsulates the return codes of the aliasing API.\n *\n * 'Success' - the datastore has been successfully aliased. It can now be used.\n * 'Conflict' - there is already a datastore bound to the provided alias. To acquire a handle to it,\n * use the `IContainerRuntime.getRootDataStore` function. The current datastore should be discarded\n * and will be garbage collected. The current datastore cannot be aliased to a different value.\n * 'AlreadyAliased' - the datastore has already been previously bound to another alias name.\n */\nexport type AliasResult = \"Success\" | \"Conflict\" | \"AlreadyAliased\";\n\n/**\n * Exposes some functionality/features of a data store:\n * - Handle to the data store's entryPoint\n * - Fluid router for the data store\n * - Can be assigned an alias\n */\nexport interface IDataStore extends IFluidRouter {\n /**\n * Attempt to assign an alias to the datastore.\n * If the operation succeeds, the datastore can be referenced\n * by the supplied alias and will not be garbage collected.\n *\n * @param alias - Given alias for this datastore.\n */\n trySetAlias(alias: string): Promise<AliasResult>;\n\n /**\n * Exposes a handle to the root object / entryPoint of the data store. Use this as the primary way of interacting\n * with it. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented in a\n * particular scenario) fall back to the current approach of requesting the root object through the request pattern.\n *\n * @remarks The plan is that eventually the data store will stop providing IFluidRouter functionality, this property\n * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n * the data store's entryPoint.\n */\n readonly entryPoint?: IFluidHandle<FluidObject>;\n}\n\n/**\n * A reduced set of functionality of IContainerRuntime that a data store context/data store runtime will need\n * TODO: this should be merged into IFluidDataStoreContext\n */\nexport interface IContainerRuntimeBase extends\n IEventProvider<IContainerRuntimeBaseEvents>,\n IProvideFluidHandleContext {\n\n readonly logger: ITelemetryBaseLogger;\n readonly clientDetails: IClientDetails;\n\n /**\n * Invokes the given callback and guarantees that all operations generated within the callback will be ordered\n * sequentially. Total size of all messages must be less than maxOpSize.\n */\n orderSequentially(callback: () => void): void;\n\n /**\n * Executes a request against the container runtime\n */\n request(request: IRequest): Promise<IResponse>;\n\n /**\n * Submits a container runtime level signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * @deprecated 0.16 Issue #1537, #3631\n * @internal\n */\n _createDataStoreWithProps(\n pkg: string | string[],\n props?: any,\n id?: string,\n ): Promise<IDataStore>;\n\n /**\n * Creates a data store and returns an object that exposes a handle to the data store's entryPoint, and also serves\n * as the data store's router. The data store is not bound to a container, and in such state is not persisted to\n * storage (file). Storing the entryPoint handle (or any other handle inside the data store, e.g. for DDS) into an\n * already attached DDS (or non-attached DDS that will eventually get attached to storage) will result in this\n * store being attached to storage.\n * @param pkg - Package name of the data store factory\n */\n createDataStore(pkg: string | string[]): Promise<IDataStore>;\n\n /**\n * Creates detached data store context. Only after context.attachRuntime() is called,\n * data store initialization is considered complete.\n */\n createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;\n\n /**\n * Get an absolute url for a provided container-relative request.\n * Returns undefined if the container or data store isn't attached to storage.\n * @param relativeUrl - A relative request within the container\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n}\n\n/**\n * @deprecated Used only in deprecated API bindToContext\n */\nexport enum BindState {\n NotBound = \"NotBound\",\n Binding = \"Binding\",\n Bound = \"Bound\",\n}\n\n/**\n * Minimal interface a data store runtime needs to provide for IFluidDataStoreContext to bind to control.\n *\n * Functionality include attach, snapshot, op/signal processing, request routes, expose an entryPoint,\n * and connection state notifications\n */\nexport interface IFluidDataStoreChannel extends\n IFluidRouter,\n IDisposable {\n\n readonly id: string;\n\n /**\n * Indicates the attachment state of the channel to a host service.\n */\n readonly attachState: AttachState;\n\n readonly visibilityState?: VisibilityState;\n\n /**\n * Runs through the graph and attaches the bound handles. Then binds this runtime to the container.\n * @deprecated This will be removed in favor of {@link IFluidDataStoreChannel.makeVisibleAndAttachGraph}.\n */\n attachGraph(): void;\n\n /**\n * Makes the data store channel visible in the container. Also, runs through its graph and attaches all\n * bound handles that represent its dependencies in the container's graph.\n */\n makeVisibleAndAttachGraph(): void;\n\n /**\n * Retrieves the summary used as part of the initial summary message\n */\n getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;\n\n /**\n * Processes the op.\n */\n process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;\n\n /**\n * Processes the signal.\n */\n processSignal(message: any, local: boolean): void;\n\n /**\n * Generates a summary for the channel.\n * Introduced with summarizerNode - will be required in a future release.\n * @param fullTree - true to bypass optimizations and force a full summary tree.\n * @param trackState - This tells whether we should track state from this summary.\n * @param telemetryContext - summary data passed through the layers for telemetry purposes\n */\n summarize(\n fullTree?: boolean,\n trackState?: boolean,\n telemetryContext?: ITelemetryContext,\n ): Promise<ISummaryTreeWithStats>;\n\n /**\n * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n * including any of its children. Each node has a list of outbound routes to other GC nodes in the document.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n /**\n * After GC has run, called to notify this channel of routes that are used in it.\n * @param usedRoutes - The routes that are used in this channel.\n */\n updateUsedRoutes(usedRoutes: string[]): void;\n\n /**\n * Notifies this object about changes in the connection state.\n * @param value - New connection state.\n * @param clientId - ID of the client. It's old ID when in disconnected state and\n * it's new client ID when we are connecting or connected.\n */\n setConnectionState(connected: boolean, clientId?: string);\n\n /**\n * Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.\n * @param type - The type of the original message.\n * @param content - The content of the original message.\n * @param localOpMetadata - The local metadata associated with the original message.\n */\n reSubmit(type: string, content: any, localOpMetadata: unknown);\n\n applyStashedOp(content: any): Promise<unknown>;\n\n /**\n * Revert a local message.\n * @param type - The type of the original message.\n * @param content - The content of the original message.\n * @param localOpMetadata - The local metadata associated with the original message.\n */\n rollback?(type: string, content: any, localOpMetadata: unknown): void;\n\n /**\n * Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting\n * with the component. If this property is undefined (meaning that exposing the entryPoint hasn't been implemented\n * in a particular scenario) fall back to the current approach of requesting the root object through the request\n * pattern.\n *\n * @remarks The plan is that eventually the component will stop providing IFluidRouter functionality, this property\n * will become non-optional and return an IFluidHandle (no undefined) and will become the only way to access\n * the component's entryPoint.\n */\n readonly entryPoint?: IFluidHandle<FluidObject>;\n}\n\nexport type CreateChildSummarizerNodeFn = (\n summarizeInternal: SummarizeInternalFn,\n getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n /**\n * @deprecated - The functionality to get base GC details has been moved to summarizer node.\n */\n getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n) => ISummarizerNodeWithGC;\n\nexport interface IFluidDataStoreContextEvents extends IEvent {\n (event: \"attaching\" | \"attached\", listener: () => void);\n}\n\n/**\n * Represents the context for the data store. It is used by the data store runtime to\n * get information and call functionality to the container.\n */\nexport interface IFluidDataStoreContext extends\n IEventProvider<IFluidDataStoreContextEvents>,\n Partial<IProvideFluidDataStoreRegistry>,\n IProvideFluidHandleContext {\n readonly id: string;\n /**\n * A data store created by a client, is a local data store for that client. Also, when a detached container loads\n * from a snapshot, all the data stores are treated as local data stores because at that stage the container\n * still doesn't exists in storage and so the data store couldn't have been created by any other client.\n * Value of this never changes even after the data store is attached.\n * As implementer of data store runtime, you can use this property to check that this data store belongs to this\n * client and hence implement any scenario based on that.\n */\n readonly isLocalDataStore: boolean;\n /**\n * The package path of the data store as per the package factory.\n */\n readonly packagePath: readonly string[];\n readonly options: ILoaderOptions;\n readonly clientId: string | undefined;\n readonly connected: boolean;\n readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n readonly storage: IDocumentStorageService;\n readonly baseSnapshot: ISnapshotTree | undefined;\n readonly logger: ITelemetryBaseLogger;\n readonly clientDetails: IClientDetails;\n /**\n * Indicates the attachment state of the data store to a host service.\n */\n readonly attachState: AttachState;\n\n readonly containerRuntime: IContainerRuntimeBase;\n\n /**\n * @deprecated 0.16 Issue #1635, #3631\n */\n readonly createProps?: any;\n\n /**\n * Ambient services provided with the context\n */\n readonly scope: FluidObject;\n\n /**\n * Returns the current quorum.\n */\n getQuorum(): IQuorumClients;\n\n /**\n * Returns the current audience.\n */\n getAudience(): IAudience;\n\n /**\n * Submits the message to be sent to other clients.\n * @param type - Type of the message.\n * @param content - Content of the message.\n * @param localOpMetadata - The local metadata associated with the message. This is kept locally and not sent to\n * the server. This will be sent back when this message is received back from the server. This is also sent if\n * we are asked to resubmit the message.\n */\n submitMessage(type: string, content: any, localOpMetadata: unknown): void;\n\n /**\n * Submits the signal to be sent to other clients.\n * @param type - Type of the signal.\n * @param content - Content of the signal.\n */\n submitSignal(type: string, content: any): void;\n\n /**\n * @deprecated To be removed in favor of makeVisible.\n * Register the runtime to the container\n */\n bindToContext(): void;\n\n /**\n * Called to make the data store locally visible in the container. This happens automatically for root data stores\n * when they are marked as root. For non-root data stores, this happens when their handle is added to a visible DDS.\n */\n makeLocallyVisible(): void;\n\n /**\n * Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.\n * @param address - The address of the channel that is dirty.\n */\n setChannelDirty(address: string): void;\n\n /**\n * Get an absolute url to the container based on the provided relativeUrl.\n * Returns undefined if the container or data store isn't attached to storage.\n * @param relativeUrl - A relative request within the container\n */\n getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;\n\n getCreateChildSummarizerNodeFn(\n /**\n * Initial id or path part of this node\n */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n ): CreateChildSummarizerNodeFn;\n\n uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;\n\n /**\n * Returns the GC details in the initial summary of this data store. This is used to initialize the data store\n * and its children with the GC details from the previous summary.\n */\n getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\n /**\n * Called when a new outbound reference is added to another node. This is used by garbage collection to identify\n * all references added in the system.\n * @param srcHandle - The handle of the node that added the reference.\n * @param outboundHandle - The handle of the outbound node that is referenced.\n */\n addedGCOutboundReference?(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;\n}\n\nexport interface IFluidDataStoreContextDetached extends IFluidDataStoreContext {\n /**\n * Binds a runtime to the context.\n */\n attachRuntime(\n factory: IProvideFluidDataStoreFactory,\n dataStoreRuntime: IFluidDataStoreChannel,\n ): Promise<void>;\n}\n"]}
|
|
@@ -2,13 +2,17 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const gcTreeKey = "gc";
|
|
6
|
+
export declare const gcBlobPrefix = "__gc";
|
|
7
|
+
export declare const gcTombstoneBlobKey = "__tombstones";
|
|
6
8
|
/**
|
|
7
9
|
* Garbage collection data returned by nodes in a Container.
|
|
8
10
|
* Used for running GC in the Container.
|
|
9
11
|
*/
|
|
10
12
|
export interface IGarbageCollectionData {
|
|
11
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.
|
|
15
|
+
*/
|
|
12
16
|
gcNodes: {
|
|
13
17
|
[id: string]: string[];
|
|
14
18
|
};
|
|
@@ -17,11 +21,13 @@ export interface IGarbageCollectionData {
|
|
|
17
21
|
* GC details provided to each node during creation.
|
|
18
22
|
*/
|
|
19
23
|
export interface IGarbageCollectionDetailsBase {
|
|
20
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* A list of routes to Fluid objects that are used in this node.
|
|
26
|
+
*/
|
|
21
27
|
usedRoutes?: string[];
|
|
22
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* The GC data of this node.
|
|
30
|
+
*/
|
|
23
31
|
gcData?: IGarbageCollectionData;
|
|
24
|
-
/** If this node is unreferenced, the time when it was marked as such. */
|
|
25
|
-
unrefTimestamp?: number;
|
|
26
32
|
}
|
|
27
33
|
//# sourceMappingURL=garbageCollection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,SAAS,OAAO,CAAC;AAE9B;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC
|
|
1
|
+
{"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,SAAS,OAAO,CAAC;AAE9B,eAAO,MAAM,YAAY,SAAS,CAAC;AAEnC,eAAO,MAAM,kBAAkB,iBAAiB,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,OAAO,EAAE;QAAE,CAAE,EAAE,EAAE,MAAM,GAAI,MAAM,EAAE,CAAC;KAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC1C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,sBAAsB,CAAC;CACnC"}
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
8
|
-
// The key
|
|
9
|
-
exports.
|
|
7
|
+
exports.gcTombstoneBlobKey = exports.gcBlobPrefix = exports.gcTreeKey = void 0;
|
|
8
|
+
// The key for the GC tree in summary.
|
|
9
|
+
exports.gcTreeKey = "gc";
|
|
10
|
+
// They prefix for GC blobs in the GC tree in summary.
|
|
11
|
+
exports.gcBlobPrefix = "__gc";
|
|
12
|
+
// The key for tombstone blob in the GC tree in summary.
|
|
13
|
+
exports.gcTombstoneBlobKey = "__tombstones";
|
|
10
14
|
//# sourceMappingURL=garbageCollection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"garbageCollection.js","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"garbageCollection.js","sourceRoot":"","sources":["../src/garbageCollection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,sCAAsC;AACzB,QAAA,SAAS,GAAG,IAAI,CAAC;AAC9B,sDAAsD;AACzC,QAAA,YAAY,GAAG,MAAM,CAAC;AACnC,wDAAwD;AAC3C,QAAA,kBAAkB,GAAG,cAAc,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The key for the GC tree in summary.\nexport const gcTreeKey = \"gc\";\n// They prefix for GC blobs in the GC tree in summary.\nexport const gcBlobPrefix = \"__gc\";\n// The key for tombstone blob in the GC tree in summary.\nexport const gcTombstoneBlobKey = \"__tombstones\";\n\n/**\n * Garbage collection data returned by nodes in a Container.\n * Used for running GC in the Container.\n */\nexport interface IGarbageCollectionData {\n /**\n * 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 */\n gcNodes: { [ id: string ]: string[]; };\n}\n\n/**\n * GC details provided to each node during creation.\n */\nexport interface IGarbageCollectionDetailsBase {\n /**\n * A list of routes to Fluid objects that are used in this node.\n */\n usedRoutes?: string[];\n /**\n * The GC data of this node.\n */\n gcData?: IGarbageCollectionData;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
export { AliasResult, BindState, CreateChildSummarizerNodeFn, FlushMode, IContainerRuntimeBase, IContainerRuntimeBaseEvents, IDataStore, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreContextEvents, VisibilityState, } from "./dataStoreContext";
|
|
6
6
|
export { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from "./dataStoreFactory";
|
|
7
7
|
export { FluidDataStoreRegistryEntry, IFluidDataStoreRegistry, IProvideFluidDataStoreRegistry, NamedFluidDataStoreRegistryEntries, NamedFluidDataStoreRegistryEntry, } from "./dataStoreRegistry";
|
|
8
|
-
export {
|
|
8
|
+
export { gcTreeKey, gcBlobPrefix, gcTombstoneBlobKey, IGarbageCollectionData, IGarbageCollectionDetailsBase, } from "./garbageCollection";
|
|
9
9
|
export { IAttachMessage, IEnvelope, IInboundSignalMessage, InboundAttachMessage, ISignalEnvelope } from "./protocol";
|
|
10
|
-
export { blobCountPropertyName, channelsTreeName, CreateChildSummarizerNodeParam, CreateSummarizerNodeSource, IGarbageCollectionNodeData, IGarbageCollectionState, ISummarizeInternalResult, ISummarizeResult, ISummarizerNode, ISummarizerNodeConfig, ISummarizerNodeConfigWithGC, ISummarizerNodeWithGC, ISummaryStats, ISummaryTreeWithStats, ITelemetryContext, SummarizeInternalFn, totalBlobSizePropertyName, } from "./summary";
|
|
10
|
+
export { blobCountPropertyName, channelsTreeName, CreateChildSummarizerNodeParam, CreateSummarizerNodeSource, IGarbageCollectionNodeData, IGarbageCollectionSnapshotData, IGarbageCollectionState, IGarbageCollectionSummaryDetailsLegacy, ISummarizeInternalResult, ISummarizeResult, ISummarizerNode, ISummarizerNodeConfig, ISummarizerNodeConfigWithGC, ISummarizerNodeWithGC, ISummaryStats, ISummaryTreeWithStats, ITelemetryContext, SummarizeInternalFn, totalBlobSizePropertyName, } from "./summary";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names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B,EACxB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,GACzB,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.totalBlobSizePropertyName = exports.CreateSummarizerNodeSource = exports.channelsTreeName = exports.blobCountPropertyName = exports.
|
|
7
|
+
exports.totalBlobSizePropertyName = exports.CreateSummarizerNodeSource = exports.channelsTreeName = exports.blobCountPropertyName = exports.gcTombstoneBlobKey = exports.gcBlobPrefix = exports.gcTreeKey = exports.IFluidDataStoreRegistry = exports.IFluidDataStoreFactory = exports.VisibilityState = exports.FlushMode = exports.BindState = void 0;
|
|
8
8
|
var dataStoreContext_1 = require("./dataStoreContext");
|
|
9
9
|
Object.defineProperty(exports, "BindState", { enumerable: true, get: function () { return dataStoreContext_1.BindState; } });
|
|
10
10
|
Object.defineProperty(exports, "FlushMode", { enumerable: true, get: function () { return dataStoreContext_1.FlushMode; } });
|
|
@@ -14,7 +14,9 @@ Object.defineProperty(exports, "IFluidDataStoreFactory", { enumerable: true, get
|
|
|
14
14
|
var dataStoreRegistry_1 = require("./dataStoreRegistry");
|
|
15
15
|
Object.defineProperty(exports, "IFluidDataStoreRegistry", { enumerable: true, get: function () { return dataStoreRegistry_1.IFluidDataStoreRegistry; } });
|
|
16
16
|
var garbageCollection_1 = require("./garbageCollection");
|
|
17
|
-
Object.defineProperty(exports, "
|
|
17
|
+
Object.defineProperty(exports, "gcTreeKey", { enumerable: true, get: function () { return garbageCollection_1.gcTreeKey; } });
|
|
18
|
+
Object.defineProperty(exports, "gcBlobPrefix", { enumerable: true, get: function () { return garbageCollection_1.gcBlobPrefix; } });
|
|
19
|
+
Object.defineProperty(exports, "gcTombstoneBlobKey", { enumerable: true, get: function () { return garbageCollection_1.gcTombstoneBlobKey; } });
|
|
18
20
|
var summary_1 = require("./summary");
|
|
19
21
|
Object.defineProperty(exports, "blobCountPropertyName", { enumerable: true, get: function () { return summary_1.blobCountPropertyName; } });
|
|
20
22
|
Object.defineProperty(exports, "channelsTreeName", { enumerable: true, get: function () { return summary_1.channelsTreeName; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAa4B;AAX3B,6GAAA,SAAS,OAAA;AAET,6GAAA,SAAS,OAAA;AAQT,mHAAA,eAAe,OAAA;AAEhB,uDAA2F;AAAlF,0HAAA,sBAAsB,OAAA;AAC/B,yDAM6B;AAJ5B,4HAAA,uBAAuB,OAAA;AAKxB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAa4B;AAX3B,6GAAA,SAAS,OAAA;AAET,6GAAA,SAAS,OAAA;AAQT,mHAAA,eAAe,OAAA;AAEhB,uDAA2F;AAAlF,0HAAA,sBAAsB,OAAA;AAC/B,yDAM6B;AAJ5B,4HAAA,uBAAuB,OAAA;AAKxB,yDAM6B;AALzB,8GAAA,SAAS,OAAA;AACT,iHAAA,YAAY,OAAA;AACZ,uHAAA,kBAAkB,OAAA;AAKtB,qCAoBmB;AAnBlB,gHAAA,qBAAqB,OAAA;AACrB,2GAAA,gBAAgB,OAAA;AAEhB,qHAAA,0BAA0B,OAAA;AAe1B,oHAAA,yBAAyB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tAliasResult,\n\tBindState,\n\tCreateChildSummarizerNodeFn,\n\tFlushMode,\n\tIContainerRuntimeBase,\n\tIContainerRuntimeBaseEvents,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n\tIFluidDataStoreContext,\n\tIFluidDataStoreContextDetached,\n\tIFluidDataStoreContextEvents,\n\tVisibilityState,\n} from \"./dataStoreContext\";\nexport { IFluidDataStoreFactory, IProvideFluidDataStoreFactory } from \"./dataStoreFactory\";\nexport {\n\tFluidDataStoreRegistryEntry,\n\tIFluidDataStoreRegistry,\n\tIProvideFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n\tNamedFluidDataStoreRegistryEntry,\n} from \"./dataStoreRegistry\";\nexport {\n gcTreeKey,\n gcBlobPrefix,\n gcTombstoneBlobKey,\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\nexport { IAttachMessage, IEnvelope, IInboundSignalMessage, InboundAttachMessage, ISignalEnvelope } from \"./protocol\";\nexport {\n\tblobCountPropertyName,\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tIGarbageCollectionNodeData,\n IGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n IGarbageCollectionSummaryDetailsLegacy,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tISummaryStats,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n\tSummarizeInternalFn,\n\ttotalBlobSizePropertyName,\n} from \"./summary\";\n"]}
|
package/dist/summary.d.ts
CHANGED
|
@@ -23,7 +23,9 @@ export interface ISummaryStats {
|
|
|
23
23
|
* will be taking part of the summarization process.
|
|
24
24
|
*/
|
|
25
25
|
export interface ISummaryTreeWithStats {
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Represents an aggregation of node counts and blob sizes associated to the current summary information
|
|
28
|
+
*/
|
|
27
29
|
stats: ISummaryStats;
|
|
28
30
|
/**
|
|
29
31
|
* A recursive data structure that will be converted to a snapshot tree and uploaded
|
|
@@ -54,14 +56,22 @@ export interface ISummarizeResult {
|
|
|
54
56
|
*/
|
|
55
57
|
export interface ISummarizeInternalResult extends ISummarizeResult {
|
|
56
58
|
id: string;
|
|
57
|
-
/**
|
|
59
|
+
/**
|
|
60
|
+
* Additional path parts between this node's ID and its children's IDs.
|
|
61
|
+
*/
|
|
58
62
|
pathPartsForChildren?: string[];
|
|
59
63
|
}
|
|
60
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* The garbage collection data of each node in the reference graph.
|
|
66
|
+
*/
|
|
61
67
|
export interface IGarbageCollectionNodeData {
|
|
62
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* The set of routes to other nodes in the graph.
|
|
70
|
+
*/
|
|
63
71
|
outboundRoutes: string[];
|
|
64
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* If the node is unreferenced, the timestamp of when it was marked unreferenced.
|
|
74
|
+
*/
|
|
65
75
|
unreferencedTimestampMs?: number;
|
|
66
76
|
}
|
|
67
77
|
/**
|
|
@@ -73,6 +83,25 @@ export interface IGarbageCollectionState {
|
|
|
73
83
|
[id: string]: IGarbageCollectionNodeData;
|
|
74
84
|
};
|
|
75
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* @deprecated - IGarbageCollectionState is written in the root of the summary now.
|
|
88
|
+
* Legacy GC details from when the GC details were written at the data store's summary tree.
|
|
89
|
+
*/
|
|
90
|
+
export interface IGarbageCollectionSummaryDetailsLegacy {
|
|
91
|
+
/** A list of routes to Fluid objects that are used in this node. */
|
|
92
|
+
usedRoutes?: string[];
|
|
93
|
+
/** The GC data of this node. */
|
|
94
|
+
gcData?: IGarbageCollectionData;
|
|
95
|
+
/** If this node is unreferenced, the time when it was marked as such. */
|
|
96
|
+
unrefTimestamp?: number;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.
|
|
100
|
+
*/
|
|
101
|
+
export interface IGarbageCollectionSnapshotData {
|
|
102
|
+
gcState: IGarbageCollectionState;
|
|
103
|
+
tombstones: string[] | undefined;
|
|
104
|
+
}
|
|
76
105
|
export declare type SummarizeInternalFn = (fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext) => Promise<ISummarizeInternalResult>;
|
|
77
106
|
export interface ISummarizerNodeConfig {
|
|
78
107
|
/**
|
|
@@ -113,7 +142,9 @@ export declare type CreateChildSummarizerNodeParam = {
|
|
|
113
142
|
type: CreateSummarizerNodeSource.Local;
|
|
114
143
|
};
|
|
115
144
|
export interface ISummarizerNode {
|
|
116
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Latest successfully acked summary reference sequence number
|
|
147
|
+
*/
|
|
117
148
|
readonly referenceSequenceNumber: number;
|
|
118
149
|
/**
|
|
119
150
|
* Marks the node as having a change with the given sequence number.
|
|
@@ -145,9 +176,13 @@ export interface ISummarizerNode {
|
|
|
145
176
|
*/
|
|
146
177
|
recordChange(op: ISequencedDocumentMessage): void;
|
|
147
178
|
createChild(
|
|
148
|
-
/**
|
|
179
|
+
/**
|
|
180
|
+
* Summarize function
|
|
181
|
+
*/
|
|
149
182
|
summarizeInternalFn: SummarizeInternalFn,
|
|
150
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Initial id or path part of this node
|
|
185
|
+
*/
|
|
151
186
|
id: string,
|
|
152
187
|
/**
|
|
153
188
|
* Information needed to create the node.
|
|
@@ -156,7 +191,9 @@ export interface ISummarizerNode {
|
|
|
156
191
|
* If it is local, it will throw unsupported errors on calls to summarize.
|
|
157
192
|
*/
|
|
158
193
|
createParam: CreateChildSummarizerNodeParam,
|
|
159
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Optional configuration affecting summarize behavior
|
|
196
|
+
*/
|
|
160
197
|
config?: ISummarizerNodeConfig): ISummarizerNode;
|
|
161
198
|
getChild(id: string): ISummarizerNode | undefined;
|
|
162
199
|
}
|
|
@@ -184,9 +221,13 @@ export interface ISummarizerNode {
|
|
|
184
221
|
*/
|
|
185
222
|
export interface ISummarizerNodeWithGC extends ISummarizerNode {
|
|
186
223
|
createChild(
|
|
187
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* Summarize function
|
|
226
|
+
*/
|
|
188
227
|
summarizeInternalFn: SummarizeInternalFn,
|
|
189
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* Initial id or path part of this node
|
|
230
|
+
*/
|
|
190
231
|
id: string,
|
|
191
232
|
/**
|
|
192
233
|
* Information needed to create the node.
|
|
@@ -195,8 +236,14 @@ export interface ISummarizerNodeWithGC extends ISummarizerNode {
|
|
|
195
236
|
* If it is local, it will throw unsupported errors on calls to summarize.
|
|
196
237
|
*/
|
|
197
238
|
createParam: CreateChildSummarizerNodeParam,
|
|
198
|
-
/**
|
|
199
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Optional configuration affecting summarize behavior
|
|
241
|
+
*/
|
|
242
|
+
config?: ISummarizerNodeConfigWithGC, getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
243
|
+
/**
|
|
244
|
+
* @deprecated - The functionality to update child's base GC details is incorporated in the summarizer node.
|
|
245
|
+
*/
|
|
246
|
+
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>): ISummarizerNodeWithGC;
|
|
200
247
|
/**
|
|
201
248
|
* Delete the child with the given id..
|
|
202
249
|
*/
|
|
@@ -208,7 +255,9 @@ export interface ISummarizerNodeWithGC extends ISummarizerNode {
|
|
|
208
255
|
* @param fullGC - true to bypass optimizations and force full generation of GC data.
|
|
209
256
|
*/
|
|
210
257
|
getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
|
|
211
|
-
/**
|
|
258
|
+
/**
|
|
259
|
+
* Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
|
|
260
|
+
*/
|
|
212
261
|
isReferenced(): boolean;
|
|
213
262
|
/**
|
|
214
263
|
* After GC has run, called to notify this node of routes that are used in it. These are used for the following:
|
package/dist/summary.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACH,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,KAAK,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAChC,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IAClC
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EACH,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,KAAK,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAChC,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,YAAY,CAAC;CACzB;AAED;;GA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H,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,yFAAW,CAAA;IACX,uFAAU,CAAA;IACV,6EAAK,CAAA;AACT,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAuIY,QAAA,gBAAgB,GAAG,WAAW,CAAC;AA8B/B,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEpC,QAAA,yBAAyB,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TelemetryEventPropertyType } from \"@fluidframework/common-definitions\";\nimport {\n SummaryTree,\n ISummaryTree,\n ISequencedDocumentMessage,\n ISnapshotTree,\n ITree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\n\n/**\n * Contains the aggregation data from a Tree/Subtree.\n */\nexport interface ISummaryStats {\n treeNodeCount: number;\n blobNodeCount: number;\n handleNodeCount: number;\n totalBlobSize: number;\n unreferencedBlobSize: number;\n}\n\n/**\n * Represents the summary tree for a node along with the statistics for that tree.\n * For example, for a given data store, it contains the data for data store along with a subtree for\n * each of its DDS.\n * Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject\n * will be taking part of the summarization process.\n */\nexport interface ISummaryTreeWithStats {\n /** Represents an aggregation of node counts and blob sizes associated to the current summary information */\n stats: ISummaryStats;\n /**\n * A recursive data structure that will be converted to a snapshot tree and uploaded\n * to the backend.\n */\n summary: ISummaryTree;\n}\n\n/**\n * Represents a summary at a current sequence number.\n */\nexport interface ISummarizeResult {\n stats: ISummaryStats;\n summary: SummaryTree;\n}\n\n/**\n * Contains the same data as ISummaryResult but in order to avoid naming collisions,\n * the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.\n *\n * @example\n * ```\n * id:\"\"\n * pathPartsForChildren: [\"path1\"]\n * stats: ...\n * summary:\n * ...\n * \"path1\":\n * ```\n */\nexport interface ISummarizeInternalResult extends ISummarizeResult {\n id: string;\n /** Additional path parts between this node's ID and its children's IDs. */\n pathPartsForChildren?: string[];\n}\n\n/** The garbage collection data of each node in the reference graph. */\nexport interface IGarbageCollectionNodeData {\n /** The set of routes to other nodes in the graph. */\n outboundRoutes: string[];\n /** If the node is unreferenced, the timestamp of when it was marked unreferenced. */\n unreferencedTimestampMs?: number;\n}\n\n/**\n * The garbage collection state of the reference graph. It contains a list of all the nodes in the graph and their\n * GC data.\n */\nexport interface IGarbageCollectionState {\n gcNodes: { [ id: string ]: IGarbageCollectionNodeData; };\n}\n\nexport type SummarizeInternalFn = (\n fullTree: boolean,\n trackState: boolean,\n telemetryContext?: ITelemetryContext,\n) => Promise<ISummarizeInternalResult>;\n\nexport interface ISummarizerNodeConfig {\n /**\n * True to reuse previous handle when unchanged since last acked summary.\n * Defaults to true.\n */\n readonly canReuseHandle?: boolean;\n /**\n * True to always stop execution on error during summarize, or false to\n * attempt creating a summary that is a pointer ot the last acked summary\n * plus outstanding ops in case of internal summarize failure.\n * Defaults to false.\n *\n * BUG BUG: Default to true while we investigate problem\n * with differential summaries\n */\n readonly throwOnFailure?: true;\n}\n\nexport interface ISummarizerNodeConfigWithGC extends ISummarizerNodeConfig {\n /**\n * True if GC is disabled. If so, don't track GC related state for a summary.\n * This is propagated to all child nodes.\n */\n readonly gcDisabled?: boolean;\n}\n\nexport enum CreateSummarizerNodeSource {\n FromSummary,\n FromAttach,\n Local,\n}\nexport type CreateChildSummarizerNodeParam = {\n type: CreateSummarizerNodeSource.FromSummary;\n} | {\n type: CreateSummarizerNodeSource.FromAttach;\n sequenceNumber: number;\n snapshot: ITree;\n} | {\n type: CreateSummarizerNodeSource.Local;\n};\n\nexport interface ISummarizerNode {\n /** Latest successfully acked summary reference sequence number */\n readonly referenceSequenceNumber: number;\n /**\n * Marks the node as having a change with the given sequence number.\n * @param sequenceNumber - sequence number of change\n */\n invalidate(sequenceNumber: number): void;\n /**\n * Calls the internal summarize function and handles internal state tracking.\n * If unchanged and fullTree is false, it will reuse previous summary subtree.\n * If an error is encountered and throwOnFailure is false, it will try to make\n * a summary with a pointer to the previous summary + a blob of outstanding ops.\n * @param fullTree - true to skip optimizations and always generate the full tree\n * @param trackState - indicates whether the summarizer node should track the state of the summary or not\n * @param telemetryContext - summary data passed through the layers for telemetry purposes\n */\n summarize(\n fullTree: boolean,\n trackState?: boolean,\n telemetryContext?: ITelemetryContext,\n ): Promise<ISummarizeResult>;\n /**\n * Checks if there are any additional path parts for children that need to\n * be loaded from the base summary. Additional path parts represent parts\n * of the path between this SummarizerNode and any child SummarizerNodes\n * that it might have. For example: if datastore \"a\" contains dds \"b\", but the\n * path is \"/a/.channels/b\", then the additional path part is \".channels\".\n * @param snapshot - the base summary to parse\n */\n updateBaseSummaryState(snapshot: ISnapshotTree): void;\n /**\n * Records an op representing a change to this node/subtree.\n * @param op - op of change to record\n */\n recordChange(op: ISequencedDocumentMessage): void;\n\n createChild(\n /** Summarize function */\n summarizeInternalFn: SummarizeInternalFn,\n /** Initial id or path part of this node */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n /** Optional configuration affecting summarize behavior */\n config?: ISummarizerNodeConfig,\n ): ISummarizerNode;\n\n getChild(id: string): ISummarizerNode | undefined;\n}\n\n/**\n * Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:\n *\n * `usedRoutes`: The routes in this node that are currently in use.\n *\n * `getGCData`: A new API that can be used to get the garbage collection data for this node.\n *\n * `summarize`: Added a trackState flag which indicates whether the summarizer node should track the state of the\n * summary or not.\n *\n * `createChild`: Added the following params:\n *\n * - `getGCDataFn`: This gets the GC data from the caller. This must be provided in order for getGCData to work.\n *\n * - `getInitialGCDetailsFn`: This gets the initial GC details from the caller.\n *\n * `deleteChild`: Deletes a child node.\n *\n * `isReferenced`: This tells whether this node is referenced in the document or not.\n *\n * `updateUsedRoutes`: Used to notify this node of routes that are currently in use in it.\n */\nexport interface ISummarizerNodeWithGC extends ISummarizerNode {\n createChild(\n /** Summarize function */\n summarizeInternalFn: SummarizeInternalFn,\n /** Initial id or path part of this node */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n /** Optional configuration affecting summarize behavior */\n config?: ISummarizerNodeConfigWithGC,\n getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n ): ISummarizerNodeWithGC;\n\n /**\n * Delete the child with the given id..\n */\n deleteChild(id: string): void;\n\n getChild(id: string): ISummarizerNodeWithGC | undefined;\n\n /**\n * Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent\n * this node. Each node has a set of outbound routes to other GC nodes in the document.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n /** Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd */\n isReferenced(): boolean;\n\n /**\n * After GC has run, called to notify this node of routes that are used in it. These are used for the following:\n * 1. To identify if this node is being referenced in the document or not.\n * 2. To identify if this node or any of its children's used routes changed since last summary.\n *\n * @param usedRoutes - The routes that are used in this node.\n */\n updateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport const channelsTreeName = \".channels\";\n\n/**\n * Contains telemetry data relevant to summarization workflows.\n * This object is expected to be modified directly by various summarize methods.\n */\nexport interface ITelemetryContext {\n /**\n * Sets value for telemetry data being tracked.\n * @param prefix - unique prefix to tag this data with (ex: \"fluid:map:\")\n * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n * @param value - value to attribute to this summary telemetry data\n */\n set(prefix: string, property: string, value: TelemetryEventPropertyType): void;\n\n /**\n * Get the telemetry data being tracked\n * @param prefix - unique prefix for this data (ex: \"fluid:map:\")\n * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n * @returns undefined if item not found\n */\n get(prefix: string, property: string): TelemetryEventPropertyType;\n\n /**\n * Returns a serialized version of all the telemetry data.\n * Should be used when logging in telemetry events.\n */\n serialize(): string;\n}\n\nexport const blobCountPropertyName = \"BlobCount\";\n\nexport const totalBlobSizePropertyName = \"TotalBlobSize\";\n"]}
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAuJH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,yFAAW,CAAA;IACX,uFAAU,CAAA;IACV,6EAAK,CAAA;AACT,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AA0JY,QAAA,gBAAgB,GAAG,WAAW,CAAC;AA8B/B,QAAA,qBAAqB,GAAG,WAAW,CAAC;AAEpC,QAAA,yBAAyB,GAAG,eAAe,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TelemetryEventPropertyType } from \"@fluidframework/common-definitions\";\nimport {\n SummaryTree,\n ISummaryTree,\n ISequencedDocumentMessage,\n ISnapshotTree,\n ITree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n} from \"./garbageCollection\";\n\n/**\n * Contains the aggregation data from a Tree/Subtree.\n */\nexport interface ISummaryStats {\n treeNodeCount: number;\n blobNodeCount: number;\n handleNodeCount: number;\n totalBlobSize: number;\n unreferencedBlobSize: number;\n}\n\n/**\n * Represents the summary tree for a node along with the statistics for that tree.\n * For example, for a given data store, it contains the data for data store along with a subtree for\n * each of its DDS.\n * Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject\n * will be taking part of the summarization process.\n */\nexport interface ISummaryTreeWithStats {\n /**\n * Represents an aggregation of node counts and blob sizes associated to the current summary information\n */\n stats: ISummaryStats;\n /**\n * A recursive data structure that will be converted to a snapshot tree and uploaded\n * to the backend.\n */\n summary: ISummaryTree;\n}\n\n/**\n * Represents a summary at a current sequence number.\n */\nexport interface ISummarizeResult {\n stats: ISummaryStats;\n summary: SummaryTree;\n}\n\n/**\n * Contains the same data as ISummaryResult but in order to avoid naming collisions,\n * the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.\n *\n * @example\n * ```\n * id:\"\"\n * pathPartsForChildren: [\"path1\"]\n * stats: ...\n * summary:\n * ...\n * \"path1\":\n * ```\n */\nexport interface ISummarizeInternalResult extends ISummarizeResult {\n id: string;\n /**\n * Additional path parts between this node's ID and its children's IDs.\n */\n pathPartsForChildren?: string[];\n}\n\n/**\n * The garbage collection data of each node in the reference graph.\n */\nexport interface IGarbageCollectionNodeData {\n /**\n * The set of routes to other nodes in the graph.\n */\n outboundRoutes: string[];\n /**\n * If the node is unreferenced, the timestamp of when it was marked unreferenced.\n */\n unreferencedTimestampMs?: number;\n}\n\n/**\n * The garbage collection state of the reference graph. It contains a list of all the nodes in the graph and their\n * GC data.\n */\nexport interface IGarbageCollectionState {\n gcNodes: { [ id: string ]: IGarbageCollectionNodeData; };\n}\n\n/**\n * @deprecated - IGarbageCollectionState is written in the root of the summary now.\n * Legacy GC details from when the GC details were written at the data store's summary tree.\n */\nexport interface IGarbageCollectionSummaryDetailsLegacy {\n /** A list of routes to Fluid objects that are used in this node. */\n usedRoutes?: string[];\n /** The GC data of this node. */\n gcData?: IGarbageCollectionData;\n /** If this node is unreferenced, the time when it was marked as such. */\n unrefTimestamp?: number;\n}\n\n/**\n * The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.\n */\nexport interface IGarbageCollectionSnapshotData {\n gcState: IGarbageCollectionState;\n tombstones: string[] | undefined;\n}\n\n\nexport type SummarizeInternalFn = (\n fullTree: boolean,\n trackState: boolean,\n telemetryContext?: ITelemetryContext,\n) => Promise<ISummarizeInternalResult>;\n\nexport interface ISummarizerNodeConfig {\n /**\n * True to reuse previous handle when unchanged since last acked summary.\n * Defaults to true.\n */\n readonly canReuseHandle?: boolean;\n /**\n * True to always stop execution on error during summarize, or false to\n * attempt creating a summary that is a pointer ot the last acked summary\n * plus outstanding ops in case of internal summarize failure.\n * Defaults to false.\n *\n * BUG BUG: Default to true while we investigate problem\n * with differential summaries\n */\n readonly throwOnFailure?: true;\n}\n\nexport interface ISummarizerNodeConfigWithGC extends ISummarizerNodeConfig {\n /**\n * True if GC is disabled. If so, don't track GC related state for a summary.\n * This is propagated to all child nodes.\n */\n readonly gcDisabled?: boolean;\n}\n\nexport enum CreateSummarizerNodeSource {\n FromSummary,\n FromAttach,\n Local,\n}\nexport type CreateChildSummarizerNodeParam = {\n type: CreateSummarizerNodeSource.FromSummary;\n} | {\n type: CreateSummarizerNodeSource.FromAttach;\n sequenceNumber: number;\n snapshot: ITree;\n} | {\n type: CreateSummarizerNodeSource.Local;\n};\n\nexport interface ISummarizerNode {\n /**\n * Latest successfully acked summary reference sequence number\n */\n readonly referenceSequenceNumber: number;\n /**\n * Marks the node as having a change with the given sequence number.\n * @param sequenceNumber - sequence number of change\n */\n invalidate(sequenceNumber: number): void;\n /**\n * Calls the internal summarize function and handles internal state tracking.\n * If unchanged and fullTree is false, it will reuse previous summary subtree.\n * If an error is encountered and throwOnFailure is false, it will try to make\n * a summary with a pointer to the previous summary + a blob of outstanding ops.\n * @param fullTree - true to skip optimizations and always generate the full tree\n * @param trackState - indicates whether the summarizer node should track the state of the summary or not\n * @param telemetryContext - summary data passed through the layers for telemetry purposes\n */\n summarize(\n fullTree: boolean,\n trackState?: boolean,\n telemetryContext?: ITelemetryContext,\n ): Promise<ISummarizeResult>;\n /**\n * Checks if there are any additional path parts for children that need to\n * be loaded from the base summary. Additional path parts represent parts\n * of the path between this SummarizerNode and any child SummarizerNodes\n * that it might have. For example: if datastore \"a\" contains dds \"b\", but the\n * path is \"/a/.channels/b\", then the additional path part is \".channels\".\n * @param snapshot - the base summary to parse\n */\n updateBaseSummaryState(snapshot: ISnapshotTree): void;\n /**\n * Records an op representing a change to this node/subtree.\n * @param op - op of change to record\n */\n recordChange(op: ISequencedDocumentMessage): void;\n\n createChild(\n /**\n * Summarize function\n */\n summarizeInternalFn: SummarizeInternalFn,\n /**\n * Initial id or path part of this node\n */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n /**\n * Optional configuration affecting summarize behavior\n */\n config?: ISummarizerNodeConfig,\n ): ISummarizerNode;\n\n getChild(id: string): ISummarizerNode | undefined;\n}\n\n/**\n * Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:\n *\n * `usedRoutes`: The routes in this node that are currently in use.\n *\n * `getGCData`: A new API that can be used to get the garbage collection data for this node.\n *\n * `summarize`: Added a trackState flag which indicates whether the summarizer node should track the state of the\n * summary or not.\n *\n * `createChild`: Added the following params:\n *\n * - `getGCDataFn`: This gets the GC data from the caller. This must be provided in order for getGCData to work.\n *\n * - `getInitialGCDetailsFn`: This gets the initial GC details from the caller.\n *\n * `deleteChild`: Deletes a child node.\n *\n * `isReferenced`: This tells whether this node is referenced in the document or not.\n *\n * `updateUsedRoutes`: Used to notify this node of routes that are currently in use in it.\n */\nexport interface ISummarizerNodeWithGC extends ISummarizerNode {\n createChild(\n /**\n * Summarize function\n */\n summarizeInternalFn: SummarizeInternalFn,\n /**\n * Initial id or path part of this node\n */\n id: string,\n /**\n * Information needed to create the node.\n * If it is from a base summary, it will assert that a summary has been seen.\n * Attach information if it is created from an attach op.\n * If it is local, it will throw unsupported errors on calls to summarize.\n */\n createParam: CreateChildSummarizerNodeParam,\n /**\n * Optional configuration affecting summarize behavior\n */\n config?: ISummarizerNodeConfigWithGC,\n getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n /**\n * @deprecated - The functionality to update child's base GC details is incorporated in the summarizer node.\n */\n getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n ): ISummarizerNodeWithGC;\n\n /**\n * Delete the child with the given id..\n */\n deleteChild(id: string): void;\n\n getChild(id: string): ISummarizerNodeWithGC | undefined;\n\n /**\n * Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent\n * this node. Each node has a set of outbound routes to other GC nodes in the document.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n /**\n * Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd\n */\n isReferenced(): boolean;\n\n /**\n * After GC has run, called to notify this node of routes that are used in it. These are used for the following:\n * 1. To identify if this node is being referenced in the document or not.\n * 2. To identify if this node or any of its children's used routes changed since last summary.\n *\n * @param usedRoutes - The routes that are used in this node.\n */\n updateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport const channelsTreeName = \".channels\";\n\n/**\n * Contains telemetry data relevant to summarization workflows.\n * This object is expected to be modified directly by various summarize methods.\n */\nexport interface ITelemetryContext {\n /**\n * Sets value for telemetry data being tracked.\n * @param prefix - unique prefix to tag this data with (ex: \"fluid:map:\")\n * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n * @param value - value to attribute to this summary telemetry data\n */\n set(prefix: string, property: string, value: TelemetryEventPropertyType): void;\n\n /**\n * Get the telemetry data being tracked\n * @param prefix - unique prefix for this data (ex: \"fluid:map:\")\n * @param property - property name of the telemetry data being tracked (ex: \"DirectoryCount\")\n * @returns undefined if item not found\n */\n get(prefix: string, property: string): TelemetryEventPropertyType;\n\n /**\n * Returns a serialized version of all the telemetry data.\n * Should be used when logging in telemetry events.\n */\n serialize(): string;\n}\n\nexport const blobCountPropertyName = \"BlobCount\";\n\nexport const totalBlobSizePropertyName = \"TotalBlobSize\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/runtime-definitions",
|
|
3
|
-
"version": "2.0.0-internal.2.
|
|
3
|
+
"version": "2.0.0-internal.2.3.0",
|
|
4
4
|
"description": "Fluid Runtime definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -36,17 +36,16 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
38
38
|
"@fluidframework/common-utils": "^1.0.0",
|
|
39
|
-
"@fluidframework/container-definitions": ">=2.0.0-internal.2.
|
|
40
|
-
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.
|
|
41
|
-
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.
|
|
42
|
-
"@fluidframework/protocol-definitions": "^1.1.0"
|
|
43
|
-
"@types/node": "^14.18.0"
|
|
39
|
+
"@fluidframework/container-definitions": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
40
|
+
"@fluidframework/core-interfaces": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
41
|
+
"@fluidframework/driver-definitions": ">=2.0.0-internal.2.3.0 <2.0.0-internal.3.0.0",
|
|
42
|
+
"@fluidframework/protocol-definitions": "^1.1.0"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@fluid-tools/build-cli": "^0.7.0",
|
|
47
46
|
"@fluidframework/build-common": "^1.1.0",
|
|
48
47
|
"@fluidframework/build-tools": "^0.7.0",
|
|
49
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
48
|
+
"@fluidframework/eslint-config-fluid": "^2.0.0",
|
|
50
49
|
"@fluidframework/runtime-definitions-previous": "npm:@fluidframework/runtime-definitions@2.0.0-internal.2.2.0",
|
|
51
50
|
"@microsoft/api-extractor": "^7.22.2",
|
|
52
51
|
"@rushstack/eslint-config": "^2.5.1",
|
|
@@ -58,8 +57,14 @@
|
|
|
58
57
|
"typescript": "~4.5.5"
|
|
59
58
|
},
|
|
60
59
|
"typeValidation": {
|
|
61
|
-
"version": "2.0.0-internal.2.
|
|
62
|
-
"baselineRange": "2.0.0-internal.2.2.0",
|
|
63
|
-
"
|
|
60
|
+
"version": "2.0.0-internal.2.3.0",
|
|
61
|
+
"baselineRange": ">=2.0.0-internal.2.2.0 <2.0.0-internal.2.3.0",
|
|
62
|
+
"baselineVersion": "2.0.0-internal.2.2.0",
|
|
63
|
+
"broken": {
|
|
64
|
+
"RemovedVariableDeclaration_gcBlobKey": {
|
|
65
|
+
"forwardCompat": false,
|
|
66
|
+
"backCompat": false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
}
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -62,7 +62,9 @@ export enum FlushMode {
|
|
|
62
62
|
* locally within the container only or visible globally to all clients.
|
|
63
63
|
*/
|
|
64
64
|
export const VisibilityState = {
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Indicates that the object is not visible. This is the state when an object is first created.
|
|
67
|
+
*/
|
|
66
68
|
NotVisible: "NotVisible",
|
|
67
69
|
|
|
68
70
|
/**
|
|
@@ -210,7 +212,9 @@ export interface IContainerRuntimeBase extends
|
|
|
210
212
|
getAudience(): IAudience;
|
|
211
213
|
}
|
|
212
214
|
|
|
213
|
-
/**
|
|
215
|
+
/**
|
|
216
|
+
* @deprecated Used only in deprecated API bindToContext
|
|
217
|
+
*/
|
|
214
218
|
export enum BindState {
|
|
215
219
|
NotBound = "NotBound",
|
|
216
220
|
Binding = "Binding",
|
|
@@ -331,7 +335,10 @@ export interface IFluidDataStoreChannel extends
|
|
|
331
335
|
export type CreateChildSummarizerNodeFn = (
|
|
332
336
|
summarizeInternal: SummarizeInternalFn,
|
|
333
337
|
getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
334
|
-
|
|
338
|
+
/**
|
|
339
|
+
* @deprecated - The functionality to get base GC details has been moved to summarizer node.
|
|
340
|
+
*/
|
|
341
|
+
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
335
342
|
) => ISummarizerNodeWithGC;
|
|
336
343
|
|
|
337
344
|
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
@@ -413,7 +420,7 @@ export interface IFluidDataStoreContext extends
|
|
|
413
420
|
submitSignal(type: string, content: any): void;
|
|
414
421
|
|
|
415
422
|
/**
|
|
416
|
-
* @deprecated
|
|
423
|
+
* @deprecated To be removed in favor of makeVisible.
|
|
417
424
|
* Register the runtime to the container
|
|
418
425
|
*/
|
|
419
426
|
bindToContext(): void;
|
|
@@ -438,7 +445,9 @@ export interface IFluidDataStoreContext extends
|
|
|
438
445
|
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
439
446
|
|
|
440
447
|
getCreateChildSummarizerNodeFn(
|
|
441
|
-
/**
|
|
448
|
+
/**
|
|
449
|
+
* Initial id or path part of this node
|
|
450
|
+
*/
|
|
442
451
|
id: string,
|
|
443
452
|
/**
|
|
444
453
|
* Information needed to create the node.
|
package/src/garbageCollection.ts
CHANGED
|
@@ -3,15 +3,21 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// The key
|
|
7
|
-
export const
|
|
6
|
+
// The key for the GC tree in summary.
|
|
7
|
+
export const gcTreeKey = "gc";
|
|
8
|
+
// They prefix for GC blobs in the GC tree in summary.
|
|
9
|
+
export const gcBlobPrefix = "__gc";
|
|
10
|
+
// The key for tombstone blob in the GC tree in summary.
|
|
11
|
+
export const gcTombstoneBlobKey = "__tombstones";
|
|
8
12
|
|
|
9
13
|
/**
|
|
10
14
|
* Garbage collection data returned by nodes in a Container.
|
|
11
15
|
* Used for running GC in the Container.
|
|
12
16
|
*/
|
|
13
17
|
export interface IGarbageCollectionData {
|
|
14
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* The GC nodes of a Fluid object in the Container. Each node has an id and a set of routes to other GC nodes.
|
|
20
|
+
*/
|
|
15
21
|
gcNodes: { [ id: string ]: string[]; };
|
|
16
22
|
}
|
|
17
23
|
|
|
@@ -19,10 +25,12 @@ export interface IGarbageCollectionData {
|
|
|
19
25
|
* GC details provided to each node during creation.
|
|
20
26
|
*/
|
|
21
27
|
export interface IGarbageCollectionDetailsBase {
|
|
22
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* A list of routes to Fluid objects that are used in this node.
|
|
30
|
+
*/
|
|
23
31
|
usedRoutes?: string[];
|
|
24
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* The GC data of this node.
|
|
34
|
+
*/
|
|
25
35
|
gcData?: IGarbageCollectionData;
|
|
26
|
-
/** If this node is unreferenced, the time when it was marked as such. */
|
|
27
|
-
unrefTimestamp?: number;
|
|
28
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -25,7 +25,13 @@ export {
|
|
|
25
25
|
NamedFluidDataStoreRegistryEntries,
|
|
26
26
|
NamedFluidDataStoreRegistryEntry,
|
|
27
27
|
} from "./dataStoreRegistry";
|
|
28
|
-
export {
|
|
28
|
+
export {
|
|
29
|
+
gcTreeKey,
|
|
30
|
+
gcBlobPrefix,
|
|
31
|
+
gcTombstoneBlobKey,
|
|
32
|
+
IGarbageCollectionData,
|
|
33
|
+
IGarbageCollectionDetailsBase,
|
|
34
|
+
} from "./garbageCollection";
|
|
29
35
|
export { IAttachMessage, IEnvelope, IInboundSignalMessage, InboundAttachMessage, ISignalEnvelope } from "./protocol";
|
|
30
36
|
export {
|
|
31
37
|
blobCountPropertyName,
|
|
@@ -33,7 +39,9 @@ export {
|
|
|
33
39
|
CreateChildSummarizerNodeParam,
|
|
34
40
|
CreateSummarizerNodeSource,
|
|
35
41
|
IGarbageCollectionNodeData,
|
|
42
|
+
IGarbageCollectionSnapshotData,
|
|
36
43
|
IGarbageCollectionState,
|
|
44
|
+
IGarbageCollectionSummaryDetailsLegacy,
|
|
37
45
|
ISummarizeInternalResult,
|
|
38
46
|
ISummarizeResult,
|
|
39
47
|
ISummarizerNode,
|
package/src/summary.ts
CHANGED
|
@@ -35,7 +35,9 @@ export interface ISummaryStats {
|
|
|
35
35
|
* will be taking part of the summarization process.
|
|
36
36
|
*/
|
|
37
37
|
export interface ISummaryTreeWithStats {
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Represents an aggregation of node counts and blob sizes associated to the current summary information
|
|
40
|
+
*/
|
|
39
41
|
stats: ISummaryStats;
|
|
40
42
|
/**
|
|
41
43
|
* A recursive data structure that will be converted to a snapshot tree and uploaded
|
|
@@ -68,15 +70,23 @@ export interface ISummarizeResult {
|
|
|
68
70
|
*/
|
|
69
71
|
export interface ISummarizeInternalResult extends ISummarizeResult {
|
|
70
72
|
id: string;
|
|
71
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Additional path parts between this node's ID and its children's IDs.
|
|
75
|
+
*/
|
|
72
76
|
pathPartsForChildren?: string[];
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* The garbage collection data of each node in the reference graph.
|
|
81
|
+
*/
|
|
76
82
|
export interface IGarbageCollectionNodeData {
|
|
77
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* The set of routes to other nodes in the graph.
|
|
85
|
+
*/
|
|
78
86
|
outboundRoutes: string[];
|
|
79
|
-
/**
|
|
87
|
+
/**
|
|
88
|
+
* If the node is unreferenced, the timestamp of when it was marked unreferenced.
|
|
89
|
+
*/
|
|
80
90
|
unreferencedTimestampMs?: number;
|
|
81
91
|
}
|
|
82
92
|
|
|
@@ -88,6 +98,28 @@ export interface IGarbageCollectionState {
|
|
|
88
98
|
gcNodes: { [ id: string ]: IGarbageCollectionNodeData; };
|
|
89
99
|
}
|
|
90
100
|
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated - IGarbageCollectionState is written in the root of the summary now.
|
|
103
|
+
* Legacy GC details from when the GC details were written at the data store's summary tree.
|
|
104
|
+
*/
|
|
105
|
+
export interface IGarbageCollectionSummaryDetailsLegacy {
|
|
106
|
+
/** A list of routes to Fluid objects that are used in this node. */
|
|
107
|
+
usedRoutes?: string[];
|
|
108
|
+
/** The GC data of this node. */
|
|
109
|
+
gcData?: IGarbageCollectionData;
|
|
110
|
+
/** If this node is unreferenced, the time when it was marked as such. */
|
|
111
|
+
unrefTimestamp?: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The GC data that is read from a snapshot. It contains the Garbage CollectionState state and tombstone state.
|
|
116
|
+
*/
|
|
117
|
+
export interface IGarbageCollectionSnapshotData {
|
|
118
|
+
gcState: IGarbageCollectionState;
|
|
119
|
+
tombstones: string[] | undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
91
123
|
export type SummarizeInternalFn = (
|
|
92
124
|
fullTree: boolean,
|
|
93
125
|
trackState: boolean,
|
|
@@ -136,7 +168,9 @@ export type CreateChildSummarizerNodeParam = {
|
|
|
136
168
|
};
|
|
137
169
|
|
|
138
170
|
export interface ISummarizerNode {
|
|
139
|
-
/**
|
|
171
|
+
/**
|
|
172
|
+
* Latest successfully acked summary reference sequence number
|
|
173
|
+
*/
|
|
140
174
|
readonly referenceSequenceNumber: number;
|
|
141
175
|
/**
|
|
142
176
|
* Marks the node as having a change with the given sequence number.
|
|
@@ -173,9 +207,13 @@ export interface ISummarizerNode {
|
|
|
173
207
|
recordChange(op: ISequencedDocumentMessage): void;
|
|
174
208
|
|
|
175
209
|
createChild(
|
|
176
|
-
/**
|
|
210
|
+
/**
|
|
211
|
+
* Summarize function
|
|
212
|
+
*/
|
|
177
213
|
summarizeInternalFn: SummarizeInternalFn,
|
|
178
|
-
/**
|
|
214
|
+
/**
|
|
215
|
+
* Initial id or path part of this node
|
|
216
|
+
*/
|
|
179
217
|
id: string,
|
|
180
218
|
/**
|
|
181
219
|
* Information needed to create the node.
|
|
@@ -184,7 +222,9 @@ export interface ISummarizerNode {
|
|
|
184
222
|
* If it is local, it will throw unsupported errors on calls to summarize.
|
|
185
223
|
*/
|
|
186
224
|
createParam: CreateChildSummarizerNodeParam,
|
|
187
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Optional configuration affecting summarize behavior
|
|
227
|
+
*/
|
|
188
228
|
config?: ISummarizerNodeConfig,
|
|
189
229
|
): ISummarizerNode;
|
|
190
230
|
|
|
@@ -215,9 +255,13 @@ export interface ISummarizerNode {
|
|
|
215
255
|
*/
|
|
216
256
|
export interface ISummarizerNodeWithGC extends ISummarizerNode {
|
|
217
257
|
createChild(
|
|
218
|
-
/**
|
|
258
|
+
/**
|
|
259
|
+
* Summarize function
|
|
260
|
+
*/
|
|
219
261
|
summarizeInternalFn: SummarizeInternalFn,
|
|
220
|
-
/**
|
|
262
|
+
/**
|
|
263
|
+
* Initial id or path part of this node
|
|
264
|
+
*/
|
|
221
265
|
id: string,
|
|
222
266
|
/**
|
|
223
267
|
* Information needed to create the node.
|
|
@@ -226,9 +270,14 @@ export interface ISummarizerNodeWithGC extends ISummarizerNode {
|
|
|
226
270
|
* If it is local, it will throw unsupported errors on calls to summarize.
|
|
227
271
|
*/
|
|
228
272
|
createParam: CreateChildSummarizerNodeParam,
|
|
229
|
-
/**
|
|
273
|
+
/**
|
|
274
|
+
* Optional configuration affecting summarize behavior
|
|
275
|
+
*/
|
|
230
276
|
config?: ISummarizerNodeConfigWithGC,
|
|
231
277
|
getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
278
|
+
/**
|
|
279
|
+
* @deprecated - The functionality to update child's base GC details is incorporated in the summarizer node.
|
|
280
|
+
*/
|
|
232
281
|
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
|
|
233
282
|
): ISummarizerNodeWithGC;
|
|
234
283
|
|
|
@@ -246,7 +295,9 @@ export interface ISummarizerNodeWithGC extends ISummarizerNode {
|
|
|
246
295
|
*/
|
|
247
296
|
getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
|
|
248
297
|
|
|
249
|
-
/**
|
|
298
|
+
/**
|
|
299
|
+
* Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
|
|
300
|
+
*/
|
|
250
301
|
isReferenced(): boolean;
|
|
251
302
|
|
|
252
303
|
/**
|