@fluidframework/datastore 0.59.2000 → 0.59.3000-67119
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/channelContext.js +2 -2
- package/dist/channelContext.js.map +1 -1
- package/dist/channelDeltaConnection.js +2 -2
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/channelStorageService.d.ts +1 -1
- package/dist/channelStorageService.d.ts.map +1 -1
- package/dist/channelStorageService.js +1 -1
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +37 -37
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/fluidHandle.js +1 -1
- package/dist/fluidHandle.js.map +1 -1
- package/dist/localChannelContext.js +19 -19
- package/dist/localChannelContext.js.map +1 -1
- package/dist/localChannelStorageService.js +2 -2
- package/dist/localChannelStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +21 -12
- package/dist/remoteChannelContext.js.map +1 -1
- package/lib/channelStorageService.d.ts +1 -1
- package/lib/channelStorageService.d.ts.map +1 -1
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +8 -8
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/localChannelContext.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.d.ts.map +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +12 -3
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +16 -15
- package/src/channelStorageService.ts +3 -3
- package/src/dataStoreRuntime.ts +8 -9
- package/src/localChannelContext.ts +7 -7
- package/src/packageVersion.ts +1 -1
- package/src/remoteChannelContext.ts +15 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localChannelStorageService.js","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAA8D;AAC9D,+EAA+E;AAC/E,iEAAoE;AAEpE,MAAa,0BAA0B;IACnC,YAA6B,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;IACxC,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,IAAY;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;SACrC;QACD,OAAO,6BAAc,
|
|
1
|
+
{"version":3,"file":"localChannelStorageService.js","sourceRoot":"","sources":["../src/localChannelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAA8D;AAC9D,+EAA+E;AAC/E,iEAAoE;AAEpE,MAAa,0BAA0B;IACnC,YAA6B,IAAW;QAAX,SAAI,GAAJ,IAAI,CAAO;IACxC,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,IAAY;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;SACrC;QACD,OAAO,IAAA,6BAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACxD,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,IAAY;QAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;IACpE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;QAC1B,OAAO,IAAA,mCAAmB,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;IAEO,YAAY,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAEO,oBAAoB,CAAC,IAAY,EAAE,IAAW;QAClD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE;YAC9B,QAAQ,KAAK,CAAC,IAAI,EAAE;gBAChB,KAAK,gCAAS,CAAC,IAAI;oBACf,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE;wBACrB,OAAO,KAAK,CAAC,KAAK,CAAC;qBACtB;oBACD,MAAM;gBAEV,KAAK,gCAAS,CAAC,IAAI;oBACf,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;wBAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;qBACrF;oBACD,MAAM;gBAEV,QAAQ;aACX;SACJ;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AA9CD,gEA8CC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { stringToBuffer } from \"@fluidframework/common-utils\";\nimport { IBlob, ITree, TreeEntry } from \"@fluidframework/protocol-definitions\";\nimport { listBlobsAtTreePath } from \"@fluidframework/runtime-utils\";\n\nexport class LocalChannelStorageService implements IChannelStorageService {\n constructor(private readonly tree: ITree) {\n }\n\n public async readBlob(path: string): Promise<ArrayBufferLike> {\n const blob = this.readBlobSync(path);\n if (blob === undefined) {\n throw new Error(\"Blob Not Found\");\n }\n return stringToBuffer(blob.contents, blob.encoding);\n }\n\n public async contains(path: string): Promise<boolean> {\n const blob = this.readBlobSync(path);\n return blob !== undefined ? blob.contents !== undefined : false;\n }\n\n public async list(path: string): Promise<string[]> {\n return listBlobsAtTreePath(this.tree, path);\n }\n\n private readBlobSync(path: string): IBlob | undefined {\n return this.readBlobSyncInternal(path, this.tree);\n }\n\n private readBlobSyncInternal(path: string, tree: ITree): IBlob | undefined {\n for (const entry of tree.entries) {\n switch (entry.type) {\n case TreeEntry.Blob:\n if (path === entry.path) {\n return entry.value;\n }\n break;\n\n case TreeEntry.Tree:\n if (path.startsWith(entry.path)) {\n return this.readBlobSyncInternal(path.substr(entry.path.length + 1), entry.value);\n }\n break;\n\n default:\n }\n }\n\n return undefined;\n }\n}\n"]}
|
package/dist/packageVersion.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
|
|
6
6
|
*/
|
|
7
7
|
export declare const pkgName = "@fluidframework/datastore";
|
|
8
|
-
export declare const pkgVersion = "0.59.
|
|
8
|
+
export declare const pkgVersion = "0.59.3000-67119";
|
|
9
9
|
//# sourceMappingURL=packageVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,8BAA8B,CAAC;AACnD,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,8BAA8B,CAAC;AACnD,eAAO,MAAM,UAAU,oBAAoB,CAAC"}
|
package/dist/packageVersion.js
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.pkgVersion = exports.pkgName = void 0;
|
|
10
10
|
exports.pkgName = "@fluidframework/datastore";
|
|
11
|
-
exports.pkgVersion = "0.59.
|
|
11
|
+
exports.pkgVersion = "0.59.3000-67119";
|
|
12
12
|
//# sourceMappingURL=packageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,2BAA2B,CAAC;AACtC,QAAA,UAAU,GAAG,
|
|
1
|
+
{"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,2BAA2B,CAAC;AACtC,QAAA,UAAU,GAAG,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/datastore\";\nexport const pkgVersion = \"0.59.3000-67119\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteChannelContext.d.ts","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACH,QAAQ,EAER,sBAAsB,EAEzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAE7E,OAAO,EACH,yBAAyB,EACzB,aAAa,EAChB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,2BAA2B,EAC3B,sBAAsB,EACtB,sBAAsB,E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AAS,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAa7F,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAMtD;;;;OAIG;IACU,SAAS,CAAC,QAAQ,GAAE,OAAe,EAAE,UAAU,GAAE,OAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAI1F,iBAAiB;YAMjB,WAAW;IA8GzB;;;;;;OAMG;IACU,SAAS,CAAC,MAAM,GAAE,OAAe,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIhF;;;;OAIG;YACW,iBAAiB;IAKxB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,WAAW,CAAC,EAAE,MAAM;CASrE"}
|
|
@@ -20,7 +20,7 @@ class RemoteChannelContext {
|
|
|
20
20
|
this.isLoaded = false;
|
|
21
21
|
this.pending = [];
|
|
22
22
|
this.subLogger = telemetry_utils_1.ChildLogger.create(this.runtime.logger, "RemoteChannelContext");
|
|
23
|
-
this.services = channelContext_1.createServiceEndpoints(this.id, this.dataStoreContext.connected, submitFn, () => dirtyFn(this.id), addedGCOutboundReferenceFn, storageService, this.subLogger, baseSnapshot, extraBlobs);
|
|
23
|
+
this.services = (0, channelContext_1.createServiceEndpoints)(this.id, this.dataStoreContext.connected, submitFn, () => dirtyFn(this.id), addedGCOutboundReferenceFn, storageService, this.subLogger, baseSnapshot, extraBlobs);
|
|
24
24
|
const thisSummarizeInternal = async (fullTree, trackState) => this.summarizeInternal(fullTree, trackState);
|
|
25
25
|
this.summarizerNode = createSummarizerNode(thisSummarizeInternal, async (fullGC) => this.getGCDataInternal(fullGC), async () => getBaseGCDetails());
|
|
26
26
|
this.thresholdOpsCounter = new telemetry_utils_1.ThresholdCounter(RemoteChannelContext.pendingOpsCountThreshold, this.subLogger);
|
|
@@ -40,7 +40,7 @@ class RemoteChannelContext {
|
|
|
40
40
|
this.services.deltaConnection.setConnectionState(connected);
|
|
41
41
|
}
|
|
42
42
|
applyStashedOp(message) {
|
|
43
|
-
common_utils_1.assert(this.isLoaded, 0x194 /* "Remote channel must be loaded when rebasing op" */);
|
|
43
|
+
(0, common_utils_1.assert)(this.isLoaded, 0x194 /* "Remote channel must be loaded when rebasing op" */);
|
|
44
44
|
return this.services.deltaConnection.applyStashedOp(message);
|
|
45
45
|
}
|
|
46
46
|
processOp(message, local, localOpMetadata) {
|
|
@@ -49,14 +49,14 @@ class RemoteChannelContext {
|
|
|
49
49
|
this.services.deltaConnection.process(message, local, localOpMetadata);
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
|
-
common_utils_1.assert(!local, 0x195 /* "Remote channel must not be local when processing op" */);
|
|
53
|
-
common_utils_1.assert(this.pending !== undefined, 0x23e /* "pending is undefined" */);
|
|
52
|
+
(0, common_utils_1.assert)(!local, 0x195 /* "Remote channel must not be local when processing op" */);
|
|
53
|
+
(0, common_utils_1.assert)(this.pending !== undefined, 0x23e /* "pending is undefined" */);
|
|
54
54
|
this.pending.push(message);
|
|
55
55
|
this.thresholdOpsCounter.sendIfMultiple("StorePendingOps", this.pending.length);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
reSubmit(content, localOpMetadata) {
|
|
59
|
-
common_utils_1.assert(this.isLoaded, 0x196 /* "Remote channel must be loaded when resubmitting op" */);
|
|
59
|
+
(0, common_utils_1.assert)(this.isLoaded, 0x196 /* "Remote channel must be loaded when resubmitting op" */);
|
|
60
60
|
this.services.deltaConnection.reSubmit(content, localOpMetadata);
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -69,14 +69,14 @@ class RemoteChannelContext {
|
|
|
69
69
|
}
|
|
70
70
|
async summarizeInternal(fullTree, trackState) {
|
|
71
71
|
const channel = await this.getChannel();
|
|
72
|
-
const summarizeResult = await channelContext_1.summarizeChannelAsync(channel, fullTree, trackState);
|
|
72
|
+
const summarizeResult = await (0, channelContext_1.summarizeChannelAsync)(channel, fullTree, trackState);
|
|
73
73
|
return Object.assign(Object.assign({}, summarizeResult), { id: this.id });
|
|
74
74
|
}
|
|
75
75
|
async loadChannel() {
|
|
76
|
-
common_utils_1.assert(!this.isLoaded, 0x197 /* "Remote channel must not already be loaded when loading" */);
|
|
76
|
+
(0, common_utils_1.assert)(!this.isLoaded, 0x197 /* "Remote channel must not already be loaded when loading" */);
|
|
77
77
|
let attributes;
|
|
78
78
|
if (await this.services.objectStorage.contains(channelContext_1.attributesBlobKey)) {
|
|
79
|
-
attributes = await driver_utils_1.readAndParse(this.services.objectStorage, channelContext_1.attributesBlobKey);
|
|
79
|
+
attributes = await (0, driver_utils_1.readAndParse)(this.services.objectStorage, channelContext_1.attributesBlobKey);
|
|
80
80
|
}
|
|
81
81
|
let factory;
|
|
82
82
|
// this is a backward compatibility case where
|
|
@@ -88,7 +88,10 @@ class RemoteChannelContext {
|
|
|
88
88
|
if (this.attachMessageType === undefined) {
|
|
89
89
|
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
90
90
|
throw new container_utils_1.DataCorruptionError("channelTypeNotAvailable", {
|
|
91
|
-
channelId:
|
|
91
|
+
channelId: {
|
|
92
|
+
value: this.id,
|
|
93
|
+
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
94
|
+
},
|
|
92
95
|
dataStoreId: {
|
|
93
96
|
value: this.dataStoreContext.id,
|
|
94
97
|
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
@@ -100,7 +103,10 @@ class RemoteChannelContext {
|
|
|
100
103
|
if (factory === undefined) {
|
|
101
104
|
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
102
105
|
throw new container_utils_1.DataCorruptionError("channelFactoryNotRegisteredForAttachMessageType", {
|
|
103
|
-
channelId:
|
|
106
|
+
channelId: {
|
|
107
|
+
value: this.id,
|
|
108
|
+
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
109
|
+
},
|
|
104
110
|
dataStoreId: {
|
|
105
111
|
value: this.dataStoreContext.id,
|
|
106
112
|
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
@@ -116,7 +122,10 @@ class RemoteChannelContext {
|
|
|
116
122
|
if (factory === undefined) {
|
|
117
123
|
// TODO: dataStoreId may require a different tag from PackageData #7488
|
|
118
124
|
throw new container_utils_1.DataCorruptionError("channelFactoryNotRegisteredForGivenType", {
|
|
119
|
-
channelId:
|
|
125
|
+
channelId: {
|
|
126
|
+
value: this.id,
|
|
127
|
+
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
128
|
+
},
|
|
120
129
|
dataStoreId: {
|
|
121
130
|
value: this.dataStoreContext.id,
|
|
122
131
|
tag: telemetry_utils_1.TelemetryDataTag.PackageData,
|
|
@@ -144,7 +153,7 @@ class RemoteChannelContext {
|
|
|
144
153
|
}
|
|
145
154
|
const channel = await factory.load(this.runtime, this.id, this.services, attributes);
|
|
146
155
|
// Send all pending messages to the channel
|
|
147
|
-
common_utils_1.assert(this.pending !== undefined, 0x23f /* "pending undefined" */);
|
|
156
|
+
(0, common_utils_1.assert)(this.pending !== undefined, 0x23f /* "pending undefined" */);
|
|
148
157
|
for (const message of this.pending) {
|
|
149
158
|
this.services.deltaConnection.process(message, false, undefined /* localOpMetadata */);
|
|
150
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remoteChannelContext.js","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsD;AACtD,qEAAsE;AAStE,+DAA4D;AAc5D,qEAAkG;AAClG,qDAK0B;AAK1B,MAAa,oBAAoB;IAc7B,YACqB,OAA+B,EAC/B,gBAAwC,EACzD,cAAuC,EACvC,QAA0D,EAC1D,OAAkC,EAClC,0BAA2F,EAC1E,EAAU,EAC3B,YAA2B,EACV,QAA+B,EAChD,UAAoD,EACpD,oBAAiD,EACjD,gBAA8D,EAC7C,iBAA0B;QAZ1B,YAAO,GAAP,OAAO,CAAwB;QAC/B,qB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CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAClF,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,SAAkB,KAAK;QAC1C,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,iBAAiB,CAAC,SAAkB,KAAK;QACnD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACrC,CAAC;IAEM,gBAAgB,CAAC,UAAoB,EAAE,WAAoB;QAC9D;;;;;WAKG;QACH,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;;AApPL,oDAqPC;AAzO2B,6CAAwB,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { DataCorruptionError } from \"@fluidframework/container-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n IChannel,\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n ISequencedDocumentMessage,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n CreateChildSummarizerNodeFn,\n IFluidDataStoreContext,\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n ISummarizeInternalResult,\n ISummarizeResult,\n ISummarizerNodeWithGC,\n} from \"@fluidframework/runtime-definitions\";\nimport { ChildLogger, TelemetryDataTag, ThresholdCounter } from \"@fluidframework/telemetry-utils\";\nimport {\n attributesBlobKey,\n createServiceEndpoints,\n IChannelContext,\n summarizeChannelAsync,\n} from \"./channelContext\";\nimport { ChannelDeltaConnection } from \"./channelDeltaConnection\";\nimport { ChannelStorageService } from \"./channelStorageService\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime\";\n\nexport class RemoteChannelContext implements IChannelContext {\n private isLoaded = false;\n private pending: ISequencedDocumentMessage[] | undefined = [];\n private channelP: Promise<IChannel> | undefined;\n private channel: IChannel | undefined;\n private readonly services: {\n readonly deltaConnection: ChannelDeltaConnection,\n readonly objectStorage: ChannelStorageService,\n };\n private readonly summarizerNode: ISummarizerNodeWithGC;\n private readonly subLogger: ITelemetryLogger;\n private readonly thresholdOpsCounter: ThresholdCounter;\n private static readonly pendingOpsCountThreshold = 1000;\n\n constructor(\n private readonly runtime: IFluidDataStoreRuntime,\n private readonly dataStoreContext: IFluidDataStoreContext,\n storageService: IDocumentStorageService,\n submitFn: (content: any, localOpMetadata: unknown) => void,\n dirtyFn: (address: string) => void,\n addedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n private readonly id: string,\n baseSnapshot: ISnapshotTree,\n private readonly registry: ISharedObjectRegistry,\n extraBlobs: Map<string, ArrayBufferLike> | undefined,\n createSummarizerNode: CreateChildSummarizerNodeFn,\n getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase>,\n private readonly attachMessageType?: string,\n ) {\n this.subLogger = ChildLogger.create(this.runtime.logger, \"RemoteChannelContext\");\n\n this.services = createServiceEndpoints(\n this.id,\n this.dataStoreContext.connected,\n submitFn,\n () => dirtyFn(this.id),\n addedGCOutboundReferenceFn,\n storageService,\n this.subLogger,\n baseSnapshot,\n extraBlobs);\n\n const thisSummarizeInternal =\n async (fullTree: boolean, trackState: boolean) => this.summarizeInternal(fullTree, trackState);\n\n this.summarizerNode = createSummarizerNode(\n thisSummarizeInternal,\n async (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n async () => getBaseGCDetails(),\n );\n\n this.thresholdOpsCounter = new ThresholdCounter(\n RemoteChannelContext.pendingOpsCountThreshold,\n this.subLogger,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n public getChannel(): Promise<IChannel> {\n if (this.channelP === undefined) {\n this.channelP = this.loadChannel();\n }\n\n return this.channelP;\n }\n\n public setConnectionState(connected: boolean, clientId?: string) {\n // Connection events are ignored if the data store is not yet loaded\n if (!this.isLoaded) {\n return;\n }\n\n this.services.deltaConnection.setConnectionState(connected);\n }\n\n public applyStashedOp(message: ISequencedDocumentMessage): unknown {\n assert(this.isLoaded, 0x194 /* \"Remote channel must be loaded when rebasing op\" */);\n return this.services.deltaConnection.applyStashedOp(message);\n }\n\n public processOp(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void {\n this.summarizerNode.invalidate(message.sequenceNumber);\n\n if (this.isLoaded) {\n this.services.deltaConnection.process(message, local, localOpMetadata);\n } else {\n assert(!local, 0x195 /* \"Remote channel must not be local when processing op\" */);\n assert(this.pending !== undefined, 0x23e /* \"pending is undefined\" */);\n this.pending.push(message);\n this.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n }\n }\n\n public reSubmit(content: any, localOpMetadata: unknown) {\n assert(this.isLoaded, 0x196 /* \"Remote channel must be loaded when resubmitting op\" */);\n\n this.services.deltaConnection.reSubmit(content, localOpMetadata);\n }\n\n /**\n * Returns a summary at the current sequence number.\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 */\n public async summarize(fullTree: boolean = false, trackState: boolean = true): Promise<ISummarizeResult> {\n return this.summarizerNode.summarize(fullTree, trackState);\n }\n\n private async summarizeInternal(fullTree: boolean, trackState: boolean): Promise<ISummarizeInternalResult> {\n const channel = await this.getChannel();\n const summarizeResult = await summarizeChannelAsync(channel, fullTree, trackState);\n return { ...summarizeResult, id: this.id };\n }\n\n private async loadChannel(): Promise<IChannel> {\n assert(!this.isLoaded, 0x197 /* \"Remote channel must not already be loaded when loading\" */);\n\n let attributes: IChannelAttributes | undefined;\n if (await this.services.objectStorage.contains(attributesBlobKey)) {\n attributes = await readAndParse<IChannelAttributes | undefined>(\n this.services.objectStorage,\n attributesBlobKey);\n }\n\n let factory: IChannelFactory | undefined;\n // this is a backward compatibility case where\n // the attach message doesn't include\n // the attributes. Since old attach messages\n // will not have attributes we need to keep\n // this as long as we support old attach messages\n if (attributes === undefined) {\n if (this.attachMessageType === undefined) {\n // TODO: dataStoreId may require a different tag from PackageData #7488\n throw new DataCorruptionError(\"channelTypeNotAvailable\", {\n channelId: this.id,\n dataStoreId: {\n value: this.dataStoreContext.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n });\n }\n factory = this.registry.get(this.attachMessageType);\n if (factory === undefined) {\n // TODO: dataStoreId may require a different tag from PackageData #7488\n throw new DataCorruptionError(\"channelFactoryNotRegisteredForAttachMessageType\", {\n channelId: this.id,\n dataStoreId: {\n value: this.dataStoreContext.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n channelFactoryType: this.attachMessageType,\n });\n }\n attributes = factory.attributes;\n } else {\n factory = this.registry.get(attributes.type);\n if (factory === undefined) {\n // TODO: dataStoreId may require a different tag from PackageData #7488\n throw new DataCorruptionError(\"channelFactoryNotRegisteredForGivenType\", {\n channelId: this.id,\n dataStoreId: {\n value: this.dataStoreContext.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n channelFactoryType: attributes.type,\n });\n }\n }\n\n // Compare snapshot version to collaborative object version\n if (attributes.snapshotFormatVersion !== undefined\n && attributes.snapshotFormatVersion !== factory.attributes.snapshotFormatVersion) {\n this.subLogger.sendTelemetryEvent(\n {\n eventName: \"ChannelAttributesVersionMismatch\",\n channelType: {value: attributes.type, tag: TelemetryDataTag.PackageData},\n channelSnapshotVersion: {\n value: `${attributes.snapshotFormatVersion}@${attributes.packageVersion}`,\n tag: TelemetryDataTag.PackageData,\n },\n channelCodeVersion: {\n value: `${factory.attributes.snapshotFormatVersion}@${factory.attributes.packageVersion}`,\n tag: TelemetryDataTag.PackageData,\n },\n },\n );\n }\n\n const channel = await factory.load(\n this.runtime,\n this.id,\n this.services,\n attributes);\n\n // Send all pending messages to the channel\n assert(this.pending !== undefined, 0x23f /* \"pending undefined\" */);\n for (const message of this.pending) {\n this.services.deltaConnection.process(message, false, undefined /* localOpMetadata */);\n }\n this.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pending.length);\n\n // Commit changes.\n this.channel = channel;\n this.pending = undefined;\n this.isLoaded = true;\n\n // Because have some await between we created the service and here, the connection state might have changed\n // and we don't propagate the connection state when we are not loaded. So we have to set it again here.\n this.services.deltaConnection.setConnectionState(this.dataStoreContext.connected);\n return this.channel;\n }\n\n /**\n * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context.\n * Each node has a set of outbound routes to other GC nodes in the document.\n * If there is no new data in this context since the last summary, previous GC data is used.\n * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n public async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n return this.summarizerNode.getGCData(fullGC);\n }\n\n /**\n * Generates the data used for garbage collection. This is called when there is new data since last summary. It\n * loads the context and calls into the channel to get its GC data.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n private async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n const channel = await this.getChannel();\n return channel.getGCData(fullGC);\n }\n\n public updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number) {\n /**\n * Currently, DDSs are always considered referenced and are not garbage collected. Update the summarizer node's\n * used routes to contain a route to this channel context.\n * Once we have GC at DDS level, this will be updated to use the passed usedRoutes. See -\n * https://github.com/microsoft/FluidFramework/issues/4611\n */\n this.summarizerNode.updateUsedRoutes([\"\"]);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"remoteChannelContext.js","sourceRoot":"","sources":["../src/remoteChannelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,+DAAsD;AACtD,qEAAsE;AAStE,+DAA4D;AAc5D,qEAAkG;AAClG,qDAK0B;AAK1B,MAAa,oBAAoB;IAc7B,YACqB,OAA+B,EAC/B,gBAAwC,EACzD,cAAuC,EACvC,QAA0D,EAC1D,OAAkC,EAClC,0BAA2F,EAC1E,EAAU,EAC3B,YAA2B,EACV,QAA+B,EAChD,UAAoD,EACpD,oBAAiD,EACjD,gBAA8D,EAC7C,iBAA0B;QAZ1B,YAAO,GAAP,OAAO,CAAwB;QAC/B,qBAAgB,GAAhB,gBAAgB,CAAwB;QAKxC,OAAE,GAAF,EAAE,CAAQ;QAEV,aAAQ,GAAR,QAAQ,CAAuB;QAI/B,sBAAiB,GAAjB,iBAAiB,CAAS;QA1BvC,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAA4C,EAAE,CAAC;QA2B1D,IAAI,CAAC,SAAS,GAAG,6BAAW,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;QAEjF,IAAI,CAAC,QAAQ,GAAG,IAAA,uCAAsB,EAClC,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAC/B,QAAQ,EACR,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EACtB,0BAA0B,EAC1B,cAAc,EACd,IAAI,CAAC,SAAS,EACd,YAAY,EACZ,UAAU,CAAC,CAAC;QAEhB,MAAM,qBAAqB,GACvB,KAAK,EAAE,QAAiB,EAAE,UAAmB,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAEnG,IAAI,CAAC,cAAc,GAAG,oBAAo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AC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;;AA7PL,oDA8PC;AAlP2B,6CAAwB,GAAG,IAAI,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\nimport { assert } from \"@fluidframework/common-utils\";\nimport { DataCorruptionError } from \"@fluidframework/container-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n IChannel,\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n ISequencedDocumentMessage,\n ISnapshotTree,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n CreateChildSummarizerNodeFn,\n IFluidDataStoreContext,\n IGarbageCollectionData,\n IGarbageCollectionDetailsBase,\n ISummarizeInternalResult,\n ISummarizeResult,\n ISummarizerNodeWithGC,\n} from \"@fluidframework/runtime-definitions\";\nimport { ChildLogger, TelemetryDataTag, ThresholdCounter } from \"@fluidframework/telemetry-utils\";\nimport {\n attributesBlobKey,\n createServiceEndpoints,\n IChannelContext,\n summarizeChannelAsync,\n} from \"./channelContext\";\nimport { ChannelDeltaConnection } from \"./channelDeltaConnection\";\nimport { ChannelStorageService } from \"./channelStorageService\";\nimport { ISharedObjectRegistry } from \"./dataStoreRuntime\";\n\nexport class RemoteChannelContext implements IChannelContext {\n private isLoaded = false;\n private pending: ISequencedDocumentMessage[] | undefined = [];\n private channelP: Promise<IChannel> | undefined;\n private channel: IChannel | undefined;\n private readonly services: {\n readonly deltaConnection: ChannelDeltaConnection;\n readonly objectStorage: ChannelStorageService;\n };\n private readonly summarizerNode: ISummarizerNodeWithGC;\n private readonly subLogger: ITelemetryLogger;\n private readonly thresholdOpsCounter: ThresholdCounter;\n private static readonly pendingOpsCountThreshold = 1000;\n\n constructor(\n private readonly runtime: IFluidDataStoreRuntime,\n private readonly dataStoreContext: IFluidDataStoreContext,\n storageService: IDocumentStorageService,\n submitFn: (content: any, localOpMetadata: unknown) => void,\n dirtyFn: (address: string) => void,\n addedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n private readonly id: string,\n baseSnapshot: ISnapshotTree,\n private readonly registry: ISharedObjectRegistry,\n extraBlobs: Map<string, ArrayBufferLike> | undefined,\n createSummarizerNode: CreateChildSummarizerNodeFn,\n getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase>,\n private readonly attachMessageType?: string,\n ) {\n this.subLogger = ChildLogger.create(this.runtime.logger, \"RemoteChannelContext\");\n\n this.services = createServiceEndpoints(\n this.id,\n this.dataStoreContext.connected,\n submitFn,\n () => dirtyFn(this.id),\n addedGCOutboundReferenceFn,\n storageService,\n this.subLogger,\n baseSnapshot,\n extraBlobs);\n\n const thisSummarizeInternal =\n async (fullTree: boolean, trackState: boolean) => this.summarizeInternal(fullTree, trackState);\n\n this.summarizerNode = createSummarizerNode(\n thisSummarizeInternal,\n async (fullGC?: boolean) => this.getGCDataInternal(fullGC),\n async () => getBaseGCDetails(),\n );\n\n this.thresholdOpsCounter = new ThresholdCounter(\n RemoteChannelContext.pendingOpsCountThreshold,\n this.subLogger,\n );\n }\n\n // eslint-disable-next-line @typescript-eslint/promise-function-async\n public getChannel(): Promise<IChannel> {\n if (this.channelP === undefined) {\n this.channelP = this.loadChannel();\n }\n\n return this.channelP;\n }\n\n public setConnectionState(connected: boolean, clientId?: string) {\n // Connection events are ignored if the data store is not yet loaded\n if (!this.isLoaded) {\n return;\n }\n\n this.services.deltaConnection.setConnectionState(connected);\n }\n\n public applyStashedOp(message: ISequencedDocumentMessage): unknown {\n assert(this.isLoaded, 0x194 /* \"Remote channel must be loaded when rebasing op\" */);\n return this.services.deltaConnection.applyStashedOp(message);\n }\n\n public processOp(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void {\n this.summarizerNode.invalidate(message.sequenceNumber);\n\n if (this.isLoaded) {\n this.services.deltaConnection.process(message, local, localOpMetadata);\n } else {\n assert(!local, 0x195 /* \"Remote channel must not be local when processing op\" */);\n assert(this.pending !== undefined, 0x23e /* \"pending is undefined\" */);\n this.pending.push(message);\n this.thresholdOpsCounter.sendIfMultiple(\"StorePendingOps\", this.pending.length);\n }\n }\n\n public reSubmit(content: any, localOpMetadata: unknown) {\n assert(this.isLoaded, 0x196 /* \"Remote channel must be loaded when resubmitting op\" */);\n\n this.services.deltaConnection.reSubmit(content, localOpMetadata);\n }\n\n /**\n * Returns a summary at the current sequence number.\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 */\n public async summarize(fullTree: boolean = false, trackState: boolean = true): Promise<ISummarizeResult> {\n return this.summarizerNode.summarize(fullTree, trackState);\n }\n\n private async summarizeInternal(fullTree: boolean, trackState: boolean): Promise<ISummarizeInternalResult> {\n const channel = await this.getChannel();\n const summarizeResult = await summarizeChannelAsync(channel, fullTree, trackState);\n return { ...summarizeResult, id: this.id };\n }\n\n private async loadChannel(): Promise<IChannel> {\n assert(!this.isLoaded, 0x197 /* \"Remote channel must not already be loaded when loading\" */);\n\n let attributes: IChannelAttributes | undefined;\n if (await this.services.objectStorage.contains(attributesBlobKey)) {\n attributes = await readAndParse<IChannelAttributes | undefined>(\n this.services.objectStorage,\n attributesBlobKey);\n }\n\n let factory: IChannelFactory | undefined;\n // this is a backward compatibility case where\n // the attach message doesn't include\n // the attributes. Since old attach messages\n // will not have attributes we need to keep\n // this as long as we support old attach messages\n if (attributes === undefined) {\n if (this.attachMessageType === undefined) {\n // TODO: dataStoreId may require a different tag from PackageData #7488\n throw new DataCorruptionError(\"channelTypeNotAvailable\", {\n channelId: {\n value: this.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStoreId: {\n value: this.dataStoreContext.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n });\n }\n factory = this.registry.get(this.attachMessageType);\n if (factory === undefined) {\n // TODO: dataStoreId may require a different tag from PackageData #7488\n throw new DataCorruptionError(\"channelFactoryNotRegisteredForAttachMessageType\", {\n channelId: {\n value: this.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStoreId: {\n value: this.dataStoreContext.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n channelFactoryType: this.attachMessageType,\n });\n }\n attributes = factory.attributes;\n } else {\n factory = this.registry.get(attributes.type);\n if (factory === undefined) {\n // TODO: dataStoreId may require a different tag from PackageData #7488\n throw new DataCorruptionError(\"channelFactoryNotRegisteredForGivenType\", {\n channelId: {\n value: this.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStoreId: {\n value: this.dataStoreContext.id,\n tag: TelemetryDataTag.PackageData,\n },\n dataStorePackagePath: this.dataStoreContext.packagePath.join(\"/\"),\n channelFactoryType: attributes.type,\n });\n }\n }\n\n // Compare snapshot version to collaborative object version\n if (attributes.snapshotFormatVersion !== undefined\n && attributes.snapshotFormatVersion !== factory.attributes.snapshotFormatVersion) {\n this.subLogger.sendTelemetryEvent(\n {\n eventName: \"ChannelAttributesVersionMismatch\",\n channelType: { value: attributes.type, tag: TelemetryDataTag.PackageData },\n channelSnapshotVersion: {\n value: `${attributes.snapshotFormatVersion}@${attributes.packageVersion}`,\n tag: TelemetryDataTag.PackageData,\n },\n channelCodeVersion: {\n value: `${factory.attributes.snapshotFormatVersion}@${factory.attributes.packageVersion}`,\n tag: TelemetryDataTag.PackageData,\n },\n },\n );\n }\n\n const channel = await factory.load(\n this.runtime,\n this.id,\n this.services,\n attributes);\n\n // Send all pending messages to the channel\n assert(this.pending !== undefined, 0x23f /* \"pending undefined\" */);\n for (const message of this.pending) {\n this.services.deltaConnection.process(message, false, undefined /* localOpMetadata */);\n }\n this.thresholdOpsCounter.send(\"ProcessPendingOps\", this.pending.length);\n\n // Commit changes.\n this.channel = channel;\n this.pending = undefined;\n this.isLoaded = true;\n\n // Because have some await between we created the service and here, the connection state might have changed\n // and we don't propagate the connection state when we are not loaded. So we have to set it again here.\n this.services.deltaConnection.setConnectionState(this.dataStoreContext.connected);\n return this.channel;\n }\n\n /**\n * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context.\n * Each node has a set of outbound routes to other GC nodes in the document.\n * If there is no new data in this context since the last summary, previous GC data is used.\n * If there is new data, the GC data is generated again (by calling getGCDataInternal).\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n public async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n return this.summarizerNode.getGCData(fullGC);\n }\n\n /**\n * Generates the data used for garbage collection. This is called when there is new data since last summary. It\n * loads the context and calls into the channel to get its GC data.\n * @param fullGC - true to bypass optimizations and force full generation of GC data.\n */\n private async getGCDataInternal(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n const channel = await this.getChannel();\n return channel.getGCData(fullGC);\n }\n\n public updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number) {\n /**\n * Currently, DDSs are always considered referenced and are not garbage collected. Update the summarizer node's\n * used routes to contain a route to this channel context.\n * Once we have GC at DDS level, this will be updated to use the passed usedRoutes. See -\n * https://github.com/microsoft/FluidFramework/issues/4611\n */\n this.summarizerNode.updateUsedRoutes([\"\"]);\n }\n}\n"]}
|
|
@@ -13,7 +13,7 @@ export declare class ChannelStorageService implements IChannelStorageService {
|
|
|
13
13
|
private readonly extraBlobs?;
|
|
14
14
|
private static flattenTree;
|
|
15
15
|
private readonly flattenedTree;
|
|
16
|
-
constructor(tree: ISnapshotTree | undefined, storage: Pick<IDocumentStorageService, "readBlob">, logger: ITelemetryLogger, extraBlobs?: Map<string,
|
|
16
|
+
constructor(tree: ISnapshotTree | undefined, storage: Pick<IDocumentStorageService, "readBlob">, logger: ITelemetryLogger, extraBlobs?: Map<string, ArrayBufferLike> | undefined);
|
|
17
17
|
contains(path: string): Promise<boolean>;
|
|
18
18
|
readBlob(path: string): Promise<ArrayBufferLike>;
|
|
19
19
|
list(path: string): Promise<string[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelStorageService.d.ts","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,qBAAa,qBAAsB,YAAW,sBAAsB;IAgB5D,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAlBhC,OAAO,CAAC,MAAM,CAAC,WAAW;IAY1B,OAAO,CAAC,QAAQ,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"channelStorageService.d.ts","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEtE,qBAAa,qBAAsB,YAAW,sBAAsB;IAgB5D,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAlBhC,OAAO,CAAC,MAAM,CAAC,WAAW;IAY1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA8B;gBAGvC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,EAClD,MAAM,EAAE,gBAAgB,EACxB,UAAU,CAAC,0CAA8B;IASjD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAehD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAepC,YAAY;CAG7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AAGpF,MAAM,OAAO,qBAAqB;IAe9B,YACqB,IAA+B,EAC/B,OAAkD,EAClD,MAAwB,EACxB,UAAyC;QAHzC,SAAI,GAAJ,IAAI,CAA2B;QAC/B,YAAO,GAAP,OAAO,CAA2C;QAClD,WAAM,GAAN,MAAM,CAAkB;QACxB,eAAU,GAAV,UAAU,CAA+B;QAE1D,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,mCAAmC;QACnC,IAAI,IAAI,KAAK,SAAS,EAAE;YACnB,qBAAqB,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;SACpE;IACL,CAAC;IAzBO,MAAM,CAAC,WAAW,CAAC,IAAY,EAAE,IAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AAGp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AAC,SAAS,CAAC;QAEhB,IAAI,IAAI,KAAK,SAAS,EAAE;YACpB,OAAO,IAAI,CAAC;SACf;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,SAAS,EAAE,yBAAyB,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;QAEpG,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;;QAC1B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,MAAM,SAAS,GAAG,mCAAmC,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/C,oEAAoE;YACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAG,CAAC;YAChC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3B;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9C,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SAC1C;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,IAAY;QACnC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport { IChannelStorageService } from \"@fluidframework/datastore-definitions\";\nimport { getNormalizedObjectStoragePathParts } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryLogger } from \"@fluidframework/common-definitions\";\n\nexport class ChannelStorageService implements IChannelStorageService {\n private static flattenTree(base: string, tree: ISnapshotTree, results: { [path: string]: string; }) {\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (const path in tree.trees) {\n ChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);\n }\n\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (const blob in tree.blobs) {\n results[`${base}${blob}`] = tree.blobs[blob];\n }\n }\n\n private readonly flattenedTree: { [path: string]: string; };\n\n constructor(\n private readonly tree: ISnapshotTree | undefined,\n private readonly storage: Pick<IDocumentStorageService, \"readBlob\">,\n private readonly logger: ITelemetryLogger,\n private readonly extraBlobs?: Map<string, ArrayBufferLike>,\n ) {\n this.flattenedTree = {};\n // Create a map from paths to blobs\n if (tree !== undefined) {\n ChannelStorageService.flattenTree(\"\", tree, this.flattenedTree);\n }\n }\n\n public async contains(path: string): Promise<boolean> {\n return this.flattenedTree[path] !== undefined;\n }\n\n public async readBlob(path: string): Promise<ArrayBufferLike> {\n const id = await this.getIdForPath(path);\n const blob = this.extraBlobs !== undefined\n ? this.extraBlobs.get(id)\n : undefined;\n\n if (blob !== undefined) {\n return blob;\n }\n const blobP = this.storage.readBlob(id);\n blobP.catch((error) => this.logger.sendErrorEvent({ eventName: \"ChannelStorageBlobError\" }, error));\n\n return blobP;\n }\n\n public async list(path: string): Promise<string[]> {\n let tree = this.tree;\n const pathParts = getNormalizedObjectStoragePathParts(path);\n while (tree !== undefined && pathParts.length > 0) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const part = pathParts.shift()!;\n tree = tree.trees[part];\n }\n if (tree === undefined || pathParts.length !== 0) {\n throw new Error(\"path does not exist\");\n }\n\n return Object.keys(tree?.blobs ?? {});\n }\n\n private async getIdForPath(path: string): Promise<string> {\n return this.flattenedTree[path];\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EAEb,WAAW,EACX,cAAc,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAIH,iBAAiB,EAEpB,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EAIzB,cAAc,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAIH,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EAClB,MAAM,qCAAqC,CAAC;AAW7C,OAAO,EACH,QAAQ,EACR,sBAAsB,EACtB,4BAA4B,EAC5B,eAAe,EAClB,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"dataStoreRuntime.d.ts","sourceRoot":"","sources":["../src/dataStoreRuntime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACZ,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EAEb,WAAW,EACX,cAAc,EACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAIH,iBAAiB,EAEpB,MAAM,8BAA8B,CAAC;AAMtC,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EAIzB,cAAc,EACjB,MAAM,sCAAsC,CAAC;AAC9C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,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAsBrE,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC;IAQ3D,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,cAAc;IAsCtB,OAAO,CAAC,eAAe;CAK1B;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,6BACF,QAAQ,WAAW,qBAAqB,KAAK,QAAQ,SAAS,CAAC,SACnF,4BAA4B,iCASD,CAAC;AAEtC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sBACT,qBAAqB,KAAK,QAAQ;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;CAAE,GAAG,SAAS,CAAE,SACjG,4BAA4B,iCAiCD,CAAC"}
|
package/lib/dataStoreRuntime.js
CHANGED
|
@@ -10,7 +10,7 @@ import { buildSnapshotTree } from "@fluidframework/driver-utils";
|
|
|
10
10
|
import { SummaryType, } from "@fluidframework/protocol-definitions";
|
|
11
11
|
import { CreateSummarizerNodeSource, VisibilityState, } from "@fluidframework/runtime-definitions";
|
|
12
12
|
import { convertSnapshotTreeToSummaryTree, convertSummaryTreeToITree, generateHandleContextPath, RequestParser, SummaryTreeBuilder, create404Response, createResponseError, exceptionToResponse, } from "@fluidframework/runtime-utils";
|
|
13
|
-
import { GCDataBuilder, unpackChildNodesGCDetails, unpackChildNodesUsedRoutes, } from "@fluidframework/garbage-collector";
|
|
13
|
+
import { GCDataBuilder, removeRouteFromAllNodes, unpackChildNodesGCDetails, unpackChildNodesUsedRoutes, } from "@fluidframework/garbage-collector";
|
|
14
14
|
import { v4 as uuid } from "uuid";
|
|
15
15
|
import { summarizeChannel } from "./channelContext";
|
|
16
16
|
import { LocalChannelContext, LocalChannelContextBase, RehydratedLocalChannelContext } from "./localChannelContext";
|
|
@@ -454,10 +454,16 @@ export class FluidDataStoreRuntime extends TypedEventEmitter {
|
|
|
454
454
|
* @returns the requested channel's base GC details.
|
|
455
455
|
*/
|
|
456
456
|
async getChannelBaseGCDetails(channelId) {
|
|
457
|
+
var _a;
|
|
457
458
|
let channelBaseGCDetails = (await this.channelsBaseGCDetails).get(channelId);
|
|
458
459
|
if (channelBaseGCDetails === undefined) {
|
|
459
460
|
channelBaseGCDetails = {};
|
|
460
461
|
}
|
|
462
|
+
else if (((_a = channelBaseGCDetails.gcData) === null || _a === void 0 ? void 0 : _a.gcNodes) !== undefined) {
|
|
463
|
+
// Note: if the child channel has an explicit handle route to its parent, it will be removed here and
|
|
464
|
+
// expected to be added back by the parent when getGCData is called.
|
|
465
|
+
removeRouteFromAllNodes(channelBaseGCDetails.gcData.gcNodes, this.absolutePath);
|
|
466
|
+
}
|
|
461
467
|
// Currently, channel context's are always considered used. So, it there are no used routes for it, we still
|
|
462
468
|
// need to mark it as used. Add self-route (empty string) to the channel context's used routes.
|
|
463
469
|
if (channelBaseGCDetails.usedRoutes === undefined || channelBaseGCDetails.usedRoutes.length === 0) {
|
|
@@ -482,13 +488,7 @@ export class FluidDataStoreRuntime extends TypedEventEmitter {
|
|
|
482
488
|
// (i.e. it has a base mapping) - then we go ahead and summarize
|
|
483
489
|
return isAttached;
|
|
484
490
|
}).map(async ([contextId, context]) => {
|
|
485
|
-
|
|
486
|
-
// BlobAggregationStorage relies on this behavior, as it aggregates blobs across DDSs.
|
|
487
|
-
// Not generating full summary will mean data loss, as we will overwrite aggregate blob in new summary,
|
|
488
|
-
// and any virtual blobs that stayed (for unchanged DDSs) will need aggregate blob in previous summary
|
|
489
|
-
// that is no longer present in this summary.
|
|
490
|
-
// This is temporal limitation that can be lifted in future once BlobAggregationStorage becomes smarter.
|
|
491
|
-
const contextSummary = await context.summarize(true /* fullTree */, trackState);
|
|
491
|
+
const contextSummary = await context.summarize(fullTree, trackState);
|
|
492
492
|
summaryBuilder.addWithStats(contextId, contextSummary);
|
|
493
493
|
}));
|
|
494
494
|
return summaryBuilder.getSummaryTree();
|