@fluidframework/runtime-definitions 0.59.3002 → 0.59.4000-71130
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/dist/summary.d.ts +28 -0
- package/dist/summary.d.ts.map +1 -1
- package/dist/summary.js.map +1 -1
- package/package.json +8 -6
- package/src/summary.ts +28 -0
package/dist/summary.d.ts
CHANGED
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { SummaryTree, ISummaryTree, ISequencedDocumentMessage, ISnapshotTree, ITree } from "@fluidframework/protocol-definitions";
|
|
6
6
|
import { IGarbageCollectionData, IGarbageCollectionDetailsBase, IGarbageCollectionSummaryDetails } from "./garbageCollection";
|
|
7
|
+
/**
|
|
8
|
+
* Contains the aggregation data from a Tree/Subtree.
|
|
9
|
+
*/
|
|
7
10
|
export interface ISummaryStats {
|
|
8
11
|
treeNodeCount: number;
|
|
9
12
|
blobNodeCount: number;
|
|
@@ -11,14 +14,39 @@ export interface ISummaryStats {
|
|
|
11
14
|
totalBlobSize: number;
|
|
12
15
|
unreferencedBlobSize: number;
|
|
13
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Represents the summary tree for a node along with the statistics for that tree.
|
|
19
|
+
* For example, for a given data store, it contains the data for data store along with a subtree for
|
|
20
|
+
* each of its DDS.
|
|
21
|
+
* Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject
|
|
22
|
+
* will be taking part of the summarization process.
|
|
23
|
+
*/
|
|
14
24
|
export interface ISummaryTreeWithStats {
|
|
25
|
+
/** Represents an agreggation of node counts and blob sizes associated to the current summary information */
|
|
15
26
|
stats: ISummaryStats;
|
|
27
|
+
/**
|
|
28
|
+
* A recursive data structure that will be converted to a snapshot tree and uploaded
|
|
29
|
+
* to the backend.
|
|
30
|
+
*/
|
|
16
31
|
summary: ISummaryTree;
|
|
17
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Represents a summary at a current sequence number.
|
|
35
|
+
*/
|
|
18
36
|
export interface ISummarizeResult {
|
|
19
37
|
stats: ISummaryStats;
|
|
20
38
|
summary: SummaryTree;
|
|
21
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Contains the same data as ISummaryResult but in order to avoid naming colisions,
|
|
42
|
+
* the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.
|
|
43
|
+
* Ex: id:""
|
|
44
|
+
pathPartsForChildren: ["path1"]
|
|
45
|
+
stats: ...
|
|
46
|
+
summary:
|
|
47
|
+
...
|
|
48
|
+
"path1":
|
|
49
|
+
*/
|
|
22
50
|
export interface ISummarizeInternalResult extends ISummarizeResult {
|
|
23
51
|
id: string;
|
|
24
52
|
/** Additional path parts between this node's ID and its children's IDs. */
|
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,EACH,WAAW,EACX,YAAY,EACZ,yBAAyB,EACzB,aAAa,EACb,KAAK,EACR,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,EACnC,MAAM,qBAAqB,CAAC;AAE7B,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,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3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B,kCAA0B,QAIrC;AAiJY,QAAA,gBAAgB,GAAG,WAAW,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n SummaryTree,\n ISummaryTree,\n ISequencedDocumentMessage,\n ISnapshotTree,\n ITree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n IGarbageCollectionSummaryDetails,\n} from \"./garbageCollection\";\n\nexport interface ISummaryStats {\n treeNodeCount: number;\n blobNodeCount: number;\n handleNodeCount: number;\n totalBlobSize: number;\n unreferencedBlobSize: number;\n}\n\nexport interface ISummaryTreeWithStats {\n stats: ISummaryStats;\n summary: ISummaryTree;\n}\n\nexport interface ISummarizeResult {\n stats: ISummaryStats;\n summary: SummaryTree;\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 = (fullTree: boolean, trackState: boolean) => 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 */\n summarize(fullTree: boolean): 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 loadBaseSummaryWithoutDifferential(snapshot: ISnapshotTree): void;\n /**\n * Does all the work of loadBaseSummaryWithoutDifferential. Additionally if\n * the base summary is a differential summary containing handle + outstanding ops blob,\n * then this will return the innermost base summary, and update the state by\n * tracking the outstanding ops.\n * @param snapshot - the base summary to parse\n * @param readAndParseBlob - function to read and parse blobs from storage\n * @returns the base summary to be used\n */\n loadBaseSummary(\n snapshot: ISnapshotTree,\n readAndParseBlob: <T>(id: string) => Promise<T>,\n ): Promise<{ baseSummary: ISnapshotTree; outstandingOps: ISequencedDocumentMessage[]; }>;\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: (fullTree: boolean) => Promise<ISummarizeInternalResult>,\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 / udpates the following APIs:\n * - usedRoutes - The routes in this node that are currently in use.\n * - getGCData - A new API that can be used to get the garbage collection data for this node.\n * - summarize - Added a trackState flag which indicates whether the summarizer node should track the state of the\n * summary or not.\n * - createChild - Added the following params:\n * - getGCDataFn - This gets the GC data from the caller. This must be provided in order for getGCData to work.\n * - getInitialGCDetailsFn - This gets the initial GC details from the caller.\n * - deleteChild - Deletes a child node.\n * - isReferenced - This tells whether this node is referenced in the document or not.\n * - updateUsedRoutes - Used to notify this node of routes that are currently in use in it.\n */\nexport interface ISummarizerNodeWithGC extends ISummarizerNode {\n summarize(fullTree: boolean, trackState?: boolean): Promise<ISummarizeResult>;\n createChild(\n /** Summarize function */\n summarizeInternalFn: (fullTree: boolean, trackState: boolean) => Promise<ISummarizeInternalResult>,\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 getInitialGCSummaryDetailsFn?: () => Promise<IGarbageCollectionSummaryDetails>,\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 * @param gcTimestamp - The time when GC was run that generated these used routes. If a node becomes unreferenced\n * as part of this GC run, this timestamp is used to update the time when it happens.\n */\n updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number): void;\n\n /**\n * @deprecated - Renamed to getBaseGCDetails.\n * Returns the GC details that may be added to this node's summary.\n */\n getGCSummaryDetails(): IGarbageCollectionSummaryDetails;\n\n /** Returns the GC details to be added to this node's summary and is used to initialize new nodes' GC state. */\n getBaseGCDetails?(): IGarbageCollectionDetailsBase;\n}\n\nexport const channelsTreeName = \".channels\";\n"]}
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../src/summary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA+GH,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,yFAAW,CAAA;IACX,uFAAU,CAAA;IACV,6EAAK,CAAA;AACT,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC;AAiJY,QAAA,gBAAgB,GAAG,WAAW,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n SummaryTree,\n ISummaryTree,\n ISequencedDocumentMessage,\n ISnapshotTree,\n ITree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n IGarbageCollectionSummaryDetails,\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 agreggation 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 colisions,\n * the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.\n * Ex: id:\"\"\n pathPartsForChildren: [\"path1\"]\n stats: ...\n summary:\n ...\n \"path1\":\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 = (fullTree: boolean, trackState: boolean) => 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 */\n summarize(fullTree: boolean): 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 loadBaseSummaryWithoutDifferential(snapshot: ISnapshotTree): void;\n /**\n * Does all the work of loadBaseSummaryWithoutDifferential. Additionally if\n * the base summary is a differential summary containing handle + outstanding ops blob,\n * then this will return the innermost base summary, and update the state by\n * tracking the outstanding ops.\n * @param snapshot - the base summary to parse\n * @param readAndParseBlob - function to read and parse blobs from storage\n * @returns the base summary to be used\n */\n loadBaseSummary(\n snapshot: ISnapshotTree,\n readAndParseBlob: <T>(id: string) => Promise<T>,\n ): Promise<{ baseSummary: ISnapshotTree; outstandingOps: ISequencedDocumentMessage[]; }>;\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: (fullTree: boolean) => Promise<ISummarizeInternalResult>,\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 / udpates the following APIs:\n * - usedRoutes - The routes in this node that are currently in use.\n * - getGCData - A new API that can be used to get the garbage collection data for this node.\n * - summarize - Added a trackState flag which indicates whether the summarizer node should track the state of the\n * summary or not.\n * - createChild - Added the following params:\n * - getGCDataFn - This gets the GC data from the caller. This must be provided in order for getGCData to work.\n * - getInitialGCDetailsFn - This gets the initial GC details from the caller.\n * - deleteChild - Deletes a child node.\n * - isReferenced - This tells whether this node is referenced in the document or not.\n * - updateUsedRoutes - Used to notify this node of routes that are currently in use in it.\n */\nexport interface ISummarizerNodeWithGC extends ISummarizerNode {\n summarize(fullTree: boolean, trackState?: boolean): Promise<ISummarizeResult>;\n createChild(\n /** Summarize function */\n summarizeInternalFn: (fullTree: boolean, trackState: boolean) => Promise<ISummarizeInternalResult>,\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 getInitialGCSummaryDetailsFn?: () => Promise<IGarbageCollectionSummaryDetails>,\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 * @param gcTimestamp - The time when GC was run that generated these used routes. If a node becomes unreferenced\n * as part of this GC run, this timestamp is used to update the time when it happens.\n */\n updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number): void;\n\n /**\n * @deprecated - Renamed to getBaseGCDetails.\n * Returns the GC details that may be added to this node's summary.\n */\n getGCSummaryDetails(): IGarbageCollectionSummaryDetails;\n\n /** Returns the GC details to be added to this node's summary and is used to initialize new nodes' GC state. */\n getBaseGCDetails?(): IGarbageCollectionDetailsBase;\n}\n\nexport const channelsTreeName = \".channels\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidframework/runtime-definitions",
|
|
3
|
-
"version": "0.59.
|
|
3
|
+
"version": "0.59.4000-71130",
|
|
4
4
|
"description": "Fluid Runtime definitions",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@fluidframework/common-definitions": "^0.20.1",
|
|
36
36
|
"@fluidframework/common-utils": "^0.32.1",
|
|
37
|
-
"@fluidframework/container-definitions": "^0.48.
|
|
37
|
+
"@fluidframework/container-definitions": "^0.48.2000-0",
|
|
38
38
|
"@fluidframework/core-interfaces": "^0.43.1000",
|
|
39
|
-
"@fluidframework/driver-definitions": "^0.46.
|
|
40
|
-
"@fluidframework/protocol-definitions": "^0.1028.
|
|
39
|
+
"@fluidframework/driver-definitions": "^0.46.2000-0",
|
|
40
|
+
"@fluidframework/protocol-definitions": "^0.1028.2000-0",
|
|
41
41
|
"@types/node": "^14.18.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@fluidframework/build-common": "^0.23.0",
|
|
45
|
-
"@fluidframework/build-tools": "^0.2.
|
|
45
|
+
"@fluidframework/build-tools": "^0.2.70857",
|
|
46
46
|
"@fluidframework/eslint-config-fluid": "^0.28.2000",
|
|
47
47
|
"@fluidframework/runtime-definitions-previous": "npm:@fluidframework/runtime-definitions@0.59.3000",
|
|
48
48
|
"@microsoft/api-extractor": "^7.22.2",
|
|
@@ -56,17 +56,19 @@
|
|
|
56
56
|
"eslint-plugin-eslint-comments": "~3.2.0",
|
|
57
57
|
"eslint-plugin-import": "~2.25.4",
|
|
58
58
|
"eslint-plugin-jest": "~26.1.3",
|
|
59
|
+
"eslint-plugin-jsdoc": "~39.3.0",
|
|
59
60
|
"eslint-plugin-mocha": "~10.0.3",
|
|
60
61
|
"eslint-plugin-promise": "~6.0.0",
|
|
61
62
|
"eslint-plugin-react": "~7.28.0",
|
|
62
63
|
"eslint-plugin-tsdoc": "~0.2.14",
|
|
63
64
|
"eslint-plugin-unicorn": "~40.0.0",
|
|
65
|
+
"eslint-plugin-unused-imports": "~2.0.0",
|
|
64
66
|
"rimraf": "^2.6.2",
|
|
65
67
|
"typescript": "~4.5.5",
|
|
66
68
|
"typescript-formatter": "7.1.0"
|
|
67
69
|
},
|
|
68
70
|
"typeValidation": {
|
|
69
|
-
"version": "0.59.
|
|
71
|
+
"version": "0.59.4000",
|
|
70
72
|
"broken": {}
|
|
71
73
|
}
|
|
72
74
|
}
|
package/src/summary.ts
CHANGED
|
@@ -16,6 +16,9 @@ import {
|
|
|
16
16
|
IGarbageCollectionSummaryDetails,
|
|
17
17
|
} from "./garbageCollection";
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Contains the aggregation data from a Tree/Subtree.
|
|
21
|
+
*/
|
|
19
22
|
export interface ISummaryStats {
|
|
20
23
|
treeNodeCount: number;
|
|
21
24
|
blobNodeCount: number;
|
|
@@ -24,16 +27,41 @@ export interface ISummaryStats {
|
|
|
24
27
|
unreferencedBlobSize: number;
|
|
25
28
|
}
|
|
26
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Represents the summary tree for a node along with the statistics for that tree.
|
|
32
|
+
* For example, for a given data store, it contains the data for data store along with a subtree for
|
|
33
|
+
* each of its DDS.
|
|
34
|
+
* Any component that implements IChannelContext, IFluidDataStoreChannel or extends SharedObject
|
|
35
|
+
* will be taking part of the summarization process.
|
|
36
|
+
*/
|
|
27
37
|
export interface ISummaryTreeWithStats {
|
|
38
|
+
/** Represents an agreggation of node counts and blob sizes associated to the current summary information */
|
|
28
39
|
stats: ISummaryStats;
|
|
40
|
+
/**
|
|
41
|
+
* A recursive data structure that will be converted to a snapshot tree and uploaded
|
|
42
|
+
* to the backend.
|
|
43
|
+
*/
|
|
29
44
|
summary: ISummaryTree;
|
|
30
45
|
}
|
|
31
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Represents a summary at a current sequence number.
|
|
49
|
+
*/
|
|
32
50
|
export interface ISummarizeResult {
|
|
33
51
|
stats: ISummaryStats;
|
|
34
52
|
summary: SummaryTree;
|
|
35
53
|
}
|
|
36
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Contains the same data as ISummaryResult but in order to avoid naming colisions,
|
|
57
|
+
* the data store summaries are wrapped around an array of labels identified by pathPartsForChildren.
|
|
58
|
+
* Ex: id:""
|
|
59
|
+
pathPartsForChildren: ["path1"]
|
|
60
|
+
stats: ...
|
|
61
|
+
summary:
|
|
62
|
+
...
|
|
63
|
+
"path1":
|
|
64
|
+
*/
|
|
37
65
|
export interface ISummarizeInternalResult extends ISummarizeResult {
|
|
38
66
|
id: string;
|
|
39
67
|
/** Additional path parts between this node's ID and its children's IDs. */
|