@fluidframework/datastore 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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 +5 -7
- package/.mocharc.js +2 -2
- package/README.md +3 -0
- package/api-extractor.json +2 -2
- package/dist/channelContext.d.ts.map +1 -1
- package/dist/channelContext.js.map +1 -1
- package/dist/channelDeltaConnection.d.ts.map +1 -1
- package/dist/channelDeltaConnection.js.map +1 -1
- package/dist/channelStorageService.d.ts.map +1 -1
- package/dist/channelStorageService.js +1 -3
- package/dist/channelStorageService.js.map +1 -1
- package/dist/dataStoreRuntime.d.ts +10 -18
- package/dist/dataStoreRuntime.d.ts.map +1 -1
- package/dist/dataStoreRuntime.js +65 -83
- package/dist/dataStoreRuntime.js.map +1 -1
- package/dist/fluidHandle.d.ts.map +1 -1
- package/dist/fluidHandle.js.map +1 -1
- package/dist/localChannelContext.d.ts.map +1 -1
- package/dist/localChannelContext.js +9 -5
- package/dist/localChannelContext.js.map +1 -1
- package/dist/localChannelStorageService.d.ts.map +1 -1
- package/dist/localChannelStorageService.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/remoteChannelContext.d.ts +2 -2
- package/dist/remoteChannelContext.d.ts.map +1 -1
- package/dist/remoteChannelContext.js +4 -4
- package/dist/remoteChannelContext.js.map +1 -1
- package/lib/channelContext.d.ts.map +1 -1
- package/lib/channelContext.js.map +1 -1
- package/lib/channelDeltaConnection.d.ts.map +1 -1
- package/lib/channelDeltaConnection.js.map +1 -1
- package/lib/channelStorageService.d.ts.map +1 -1
- package/lib/channelStorageService.js +1 -3
- package/lib/channelStorageService.js.map +1 -1
- package/lib/dataStoreRuntime.d.ts +10 -18
- package/lib/dataStoreRuntime.d.ts.map +1 -1
- package/lib/dataStoreRuntime.js +68 -86
- package/lib/dataStoreRuntime.js.map +1 -1
- package/lib/fluidHandle.d.ts.map +1 -1
- package/lib/fluidHandle.js.map +1 -1
- package/lib/localChannelContext.d.ts.map +1 -1
- package/lib/localChannelContext.js +9 -5
- package/lib/localChannelContext.js.map +1 -1
- package/lib/localChannelStorageService.d.ts.map +1 -1
- package/lib/localChannelStorageService.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/remoteChannelContext.d.ts +2 -2
- package/lib/remoteChannelContext.d.ts.map +1 -1
- package/lib/remoteChannelContext.js +4 -4
- package/lib/remoteChannelContext.js.map +1 -1
- package/package.json +50 -49
- package/prettier.config.cjs +1 -1
- package/src/channelContext.ts +66 -65
- package/src/channelDeltaConnection.ts +50 -44
- package/src/channelStorageService.ts +58 -54
- package/src/dataStoreRuntime.ts +1131 -1087
- package/src/fluidHandle.ts +87 -91
- package/src/localChannelContext.ts +302 -255
- package/src/localChannelStorageService.ts +47 -45
- package/src/packageVersion.ts +1 -1
- package/src/remoteChannelContext.ts +297 -291
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
package/.eslintrc.js
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
}
|
|
7
|
+
extends: [require.resolve("@fluidframework/eslint-config-fluid/minimal"), "prettier"],
|
|
8
|
+
parserOptions: {
|
|
9
|
+
project: ["./tsconfig.json", "./src/test/tsconfig.json"],
|
|
10
|
+
},
|
|
11
|
+
};
|
package/.mocharc.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
"use strict";
|
|
7
7
|
|
|
8
|
-
const getFluidTestMochaConfig = require(
|
|
8
|
+
const getFluidTestMochaConfig = require("@fluidframework/mocha-test-setup/mocharc-common");
|
|
9
9
|
|
|
10
10
|
const packageDir = __dirname;
|
|
11
11
|
const config = getFluidTestMochaConfig(packageDir);
|
package/README.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
# @fluidframework/datastore
|
|
2
2
|
|
|
3
3
|
# Fluid Handle
|
|
4
|
+
|
|
4
5
|
A Fluid handle is a handle to a Fluid object like a `DataStore` or a `SharedObject` (DDS). It can be used to represent the object in the system and has the capability to get the underlying object by calling `get()` on it.
|
|
5
6
|
|
|
6
7
|
The two major interfaces required to implement a Fluid handle are `IFluidHandle` and `IFluidHandleContext` defined in [fluidHandle.ts](src/fluidHandle.ts).
|
|
7
8
|
|
|
8
9
|
## IFluidHandle
|
|
10
|
+
|
|
9
11
|
`IFluidHandle` has only one method `get` that is used to retrieve the underlying object it represents. It also extends `IFluidHandleContext`.
|
|
10
12
|
|
|
11
13
|
## IFluidHandleContext
|
|
14
|
+
|
|
12
15
|
`IFluidHandleContext` describes a routing context (another `IFluidHandleContext`) that has a path to this `IFluidHandleContext`. When creating a Data Store Handle the route context should be the `FluidDataStoreRuntime` which knows how to reach the `FluidDataStore`. Similarly, the `FluidDataStoreRuntime's` route context should be the `ContainerRuntime` which knows how to reach it.
|
|
13
16
|
|
|
14
17
|
For more details on Fluid Handles, check this [doc](../../../content/docs/advanced/handles.md).
|
package/api-extractor.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"extends": "@fluidframework/build-common/api-extractor-common-report.json"
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelContext.d.ts","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,o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elContext.js","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH,iEAAiE;AACjE,qEAAkE;AAClE,mEAAgE;AAEnD,QAAA,iBAAiB,GAAG,aAAa,CAAC;AAqC/C,SAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"channelContext.js","sourceRoot":"","sources":["../src/channelContext.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAaH,iEAAiE;AACjE,qEAAkE;AAClE,mEAAgE;AAEnD,QAAA,iBAAiB,GAAG,aAAa,CAAC;AAqC/C,SAAgB,sBAAsB,CACrC,EAAU,EACV,SAAkB,EAClB,QAA0D,EAC1D,OAAmB,EACnB,0BAA2F,EAC3F,cAAuC,EACvC,MAAwB,EACxB,IAAoB,EACpB,UAAyC;IAEzC,MAAM,eAAe,GAAG,IAAI,+CAAsB,CACjD,EAAE,EACF,SAAS,EACT,CAAC,OAAO,EAAE,eAAe,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,EAChE,OAAO,EACP,0BAA0B,CAC1B,CAAC;IACF,MAAM,aAAa,GAAG,IAAI,6CAAqB,CAAC,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAE1F,OAAO;QACN,eAAe;QACf,aAAa;KACb,CAAC;AACH,CAAC;AAxBD,wDAwBC;AAED,SAAgB,gBAAgB,CAC/B,OAAiB,EACjB,WAAoB,KAAK,EACzB,aAAsB,KAAK,EAC3B,gBAAoC;IAEpC,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAEzF,qDAAqD;IACrD,IAAA,gCAAgB,EAAC,eAAe,EAAE,yBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,OAAO,eAAe,CAAC;AACxB,CAAC;AAXD,4CAWC;AAEM,KAAK,UAAU,qBAAqB,CAC1C,OAAiB,EACjB,WAAoB,KAAK,EACzB,aAAsB,KAAK,EAC3B,gBAAoC;IAEpC,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IAExF,qDAAqD;IACrD,IAAA,gCAAgB,EAAC,eAAe,EAAE,yBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IACzF,OAAO,eAAe,CAAC;AACxB,CAAC;AAXD,sDAWC","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 { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { IChannel } from \"@fluidframework/datastore-definitions\";\nimport { IDocumentStorageService } from \"@fluidframework/driver-definitions\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIGarbageCollectionData,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { addBlobToSummary } from \"@fluidframework/runtime-utils\";\nimport { ChannelDeltaConnection } from \"./channelDeltaConnection\";\nimport { ChannelStorageService } from \"./channelStorageService\";\n\nexport const attributesBlobKey = \".attributes\";\n\nexport interface IChannelContext {\n\tgetChannel(): Promise<IChannel>;\n\n\tsetConnectionState(connected: boolean, clientId?: string);\n\n\tprocessOp(message: ISequencedDocumentMessage, local: boolean, localOpMetadata?: unknown): void;\n\n\tsummarize(\n\t\tfullTree?: boolean,\n\t\ttrackState?: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult>;\n\n\treSubmit(content: any, localOpMetadata: unknown): void;\n\n\tapplyStashedOp(content: any): unknown;\n\n\trollback(message: any, localOpMetadata: unknown): void;\n\n\t/**\n\t * Returns the data used for garbage collection. This includes a list of GC nodes that represent this context\n\t * including any of its children. Each node has a set of outbound routes to other GC nodes in the document.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\n\t/**\n\t * After GC has run, called to notify this context of routes that are used in it. These are used for the following:\n\t * 1. To identify if this context is being referenced in the document or not.\n\t * 2. To identify if this context or any of its children's used routes changed since last summary.\n\t * 3. They are added to the summary generated by this context.\n\t */\n\tupdateUsedRoutes(usedRoutes: string[]): void;\n}\n\nexport function createServiceEndpoints(\n\tid: string,\n\tconnected: boolean,\n\tsubmitFn: (content: any, localOpMetadata: unknown) => void,\n\tdirtyFn: () => void,\n\taddedGCOutboundReferenceFn: (srcHandle: IFluidHandle, outboundHandle: IFluidHandle) => void,\n\tstorageService: IDocumentStorageService,\n\tlogger: ITelemetryLogger,\n\ttree?: ISnapshotTree,\n\textraBlobs?: Map<string, ArrayBufferLike>,\n) {\n\tconst deltaConnection = new ChannelDeltaConnection(\n\t\tid,\n\t\tconnected,\n\t\t(message, localOpMetadata) => submitFn(message, localOpMetadata),\n\t\tdirtyFn,\n\t\taddedGCOutboundReferenceFn,\n\t);\n\tconst objectStorage = new ChannelStorageService(tree, storageService, logger, extraBlobs);\n\n\treturn {\n\t\tdeltaConnection,\n\t\tobjectStorage,\n\t};\n}\n\nexport function summarizeChannel(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n): ISummaryTreeWithStats {\n\tconst summarizeResult = channel.getAttachSummary(fullTree, trackState, telemetryContext);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n\nexport async function summarizeChannelAsync(\n\tchannel: IChannel,\n\tfullTree: boolean = false,\n\ttrackState: boolean = false,\n\ttelemetryContext?: ITelemetryContext,\n): Promise<ISummaryTreeWithStats> {\n\tconst summarizeResult = await channel.summarize(fullTree, trackState, telemetryContext);\n\n\t// Add the channel attributes to the returned result.\n\taddBlobToSummary(summarizeResult, attributesBlobKey, JSON.stringify(channel.attributes));\n\treturn summarizeResult;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelDeltaConnection.d.ts","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBAAa,sBAAuB,YAAW,gBAAgB;
|
|
1
|
+
{"version":3,"file":"channelDeltaConnection.d.ts","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACnG,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBAAa,sBAAuB,YAAW,gBAAgB;IAYtD,QAAQ,EAAE,MAAM;IACvB,OAAO,CAAC,UAAU;aACF,MAAM,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI;aACrE,KAAK,EAAE,MAAM,IAAI;aACjB,wBAAwB,EAAE,CACzC,SAAS,EAAE,YAAY,EACvB,cAAc,EAAE,YAAY,KACxB,IAAI;IAlBV,OAAO,CAAC,QAAQ,CAA4B;IAE5C,OAAO,KAAK,OAAO,GAGlB;IACD,IAAW,SAAS,IAAI,OAAO,CAE9B;gBAGO,QAAQ,EAAE,MAAM,EACf,UAAU,EAAE,OAAO,EACX,MAAM,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,EACrE,KAAK,EAAE,MAAM,IAAI,EACjB,wBAAwB,EAAE,CACzC,SAAS,EAAE,YAAY,EACvB,cAAc,EAAE,YAAY,KACxB,IAAI;IAGH,MAAM,CAAC,OAAO,EAAE,aAAa;IAK7B,kBAAkB,CAAC,SAAS,EAAE,OAAO;IAKrC,OAAO,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO;IAapF,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAI/C,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAO/C,cAAc,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO;CAGlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelDeltaConnection.js","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAGtD,qEAAsE;AAGtE,MAAa,sBAAsB;
|
|
1
|
+
{"version":3,"file":"channelDeltaConnection.js","sourceRoot":"","sources":["../src/channelDeltaConnection.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAGtD,qEAAsE;AAGtE,MAAa,sBAAsB;IAWlC,YACQ,QAAgB,EACf,UAAmB,EACX,MAAqE,EACrE,KAAiB,EACjB,wBAGP;QAPF,aAAQ,GAAR,QAAQ,CAAQ;QACf,eAAU,GAAV,UAAU,CAAS;QACX,WAAM,GAAN,MAAM,CAA+D;QACrE,UAAK,GAAL,KAAK,CAAY;QACjB,6BAAwB,GAAxB,wBAAwB,CAG/B;IACP,CAAC;IAjBJ,IAAY,OAAO;QAClB,IAAA,qBAAM,EAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7D,OAAO,IAAI,CAA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ation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport { IDocumentMessage, ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport { IDeltaConnection, IDeltaHandler } from \"@fluidframework/datastore-definitions\";\nimport { DataProcessingError } from \"@fluidframework/container-utils\";\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\n\nexport class ChannelDeltaConnection implements IDeltaConnection {\n\tprivate _handler: IDeltaHandler | undefined;\n\n\tprivate get handler(): IDeltaHandler {\n\t\tassert(!!this._handler, 0x177 /* \"Missing delta handler\" */);\n\t\treturn this._handler;\n\t}\n\tpublic get connected(): boolean {\n\t\treturn this._connected;\n\t}\n\n\tconstructor(\n\t\tpublic objectId: string,\n\t\tprivate _connected: boolean,\n\t\tpublic readonly submit: (message: IDocumentMessage, localOpMetadata: unknown) => void,\n\t\tpublic readonly dirty: () => void,\n\t\tpublic readonly addedGCOutboundReference: (\n\t\t\tsrcHandle: IFluidHandle,\n\t\t\toutboundHandle: IFluidHandle,\n\t\t) => void,\n\t) {}\n\n\tpublic attach(handler: IDeltaHandler) {\n\t\tassert(this._handler === undefined, 0x178 /* \"Missing delta handler on attach\" */);\n\t\tthis._handler = handler;\n\t}\n\n\tpublic setConnectionState(connected: boolean) {\n\t\tthis._connected = connected;\n\t\tthis.handler.setConnectionState(connected);\n\t}\n\n\tpublic process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n\t\ttry {\n\t\t\t// catches as data processing error whether or not they come from async pending queues\n\t\t\tthis.handler.process(message, local, localOpMetadata);\n\t\t} catch (error) {\n\t\t\tthrow DataProcessingError.wrapIfUnrecognized(\n\t\t\t\terror,\n\t\t\t\t\"channelDeltaConnectionFailedToProcessMessage\",\n\t\t\t\tmessage,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic reSubmit(content: any, localOpMetadata: unknown) {\n\t\tthis.handler.reSubmit(content, localOpMetadata);\n\t}\n\n\tpublic rollback(content: any, localOpMetadata: unknown) {\n\t\tif (this.handler.rollback === undefined) {\n\t\t\tthrow new Error(\"Handler doesn't support rollback\");\n\t\t}\n\t\tthis.handler.rollback(content, localOpMetadata);\n\t}\n\n\tpublic applyStashedOp(message: ISequencedDocumentMessage): unknown {\n\t\treturn this.handler.applyStashedOp(message);\n\t}\n}\n"]}
|
|
@@ -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;
|
|
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;IAoBlE,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAtB7B,OAAO,CAAC,MAAM,CAAC,WAAW;IAgB1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;gBAGzC,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,OAAO,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,CAAC,EAClD,MAAM,EAAE,gBAAgB,EACxB,UAAU,CAAC,0CAA8B;IAS9C,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;CAG1B"}
|
|
@@ -33,9 +33,7 @@ class ChannelStorageService {
|
|
|
33
33
|
}
|
|
34
34
|
async readBlob(path) {
|
|
35
35
|
const id = await this.getIdForPath(path);
|
|
36
|
-
const blob = this.extraBlobs !== undefined
|
|
37
|
-
? this.extraBlobs.get(id)
|
|
38
|
-
: undefined;
|
|
36
|
+
const blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;
|
|
39
37
|
if (blob !== undefined) {
|
|
40
38
|
return blob;
|
|
41
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAAoF;AAGpF,MAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"channelStorageService.js","sourceRoot":"","sources":["../src/channelStorageService.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAKH,iEAAoF;AAGpF,MAAa,qBAAqB;IAmBjC,YACkB,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;YACvB,qBAAqB,CAAC,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,OAAO,KAAK,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,IAAY;;QAC7B,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,MAAM,SAAS,GAAG,IAAA,mDAAmC,EAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAClD,oEAAoE;YACpE,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,EAAG,CAAC;YAChC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACxB;QACD,IAAI,IAAI,KAAK,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACjD,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;SACvC;QAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,mCAAI,EAAE,CAAC,CAAC;IACvC,CAAC;IAEO,KAAK,CAAC,YAAY,CAAC,IAAY;QACtC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACD;AArED,sDAqEC","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\tprivate static flattenTree(\n\t\tbase: string,\n\t\ttree: ISnapshotTree,\n\t\tresults: { [path: string]: string },\n\t) {\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const path in tree.trees) {\n\t\t\tChannelStorageService.flattenTree(`${base}${path}/`, tree.trees[path], results);\n\t\t}\n\n\t\t// eslint-disable-next-line guard-for-in, no-restricted-syntax\n\t\tfor (const blob in tree.blobs) {\n\t\t\tresults[`${base}${blob}`] = tree.blobs[blob];\n\t\t}\n\t}\n\n\tprivate readonly flattenedTree: { [path: string]: string };\n\n\tconstructor(\n\t\tprivate readonly tree: ISnapshotTree | undefined,\n\t\tprivate readonly storage: Pick<IDocumentStorageService, \"readBlob\">,\n\t\tprivate readonly logger: ITelemetryLogger,\n\t\tprivate readonly extraBlobs?: Map<string, ArrayBufferLike>,\n\t) {\n\t\tthis.flattenedTree = {};\n\t\t// Create a map from paths to blobs\n\t\tif (tree !== undefined) {\n\t\t\tChannelStorageService.flattenTree(\"\", tree, this.flattenedTree);\n\t\t}\n\t}\n\n\tpublic async contains(path: string): Promise<boolean> {\n\t\treturn this.flattenedTree[path] !== undefined;\n\t}\n\n\tpublic async readBlob(path: string): Promise<ArrayBufferLike> {\n\t\tconst id = await this.getIdForPath(path);\n\t\tconst blob = this.extraBlobs !== undefined ? this.extraBlobs.get(id) : undefined;\n\n\t\tif (blob !== undefined) {\n\t\t\treturn blob;\n\t\t}\n\t\tconst blobP = this.storage.readBlob(id);\n\t\tblobP.catch((error) =>\n\t\t\tthis.logger.sendErrorEvent({ eventName: \"ChannelStorageBlobError\" }, error),\n\t\t);\n\n\t\treturn blobP;\n\t}\n\n\tpublic async list(path: string): Promise<string[]> {\n\t\tlet tree = this.tree;\n\t\tconst pathParts = getNormalizedObjectStoragePathParts(path);\n\t\twhile (tree !== undefined && pathParts.length > 0) {\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst part = pathParts.shift()!;\n\t\t\ttree = tree.trees[part];\n\t\t}\n\t\tif (tree === undefined || pathParts.length !== 0) {\n\t\t\tthrow new Error(\"path does not exist\");\n\t\t}\n\n\t\treturn Object.keys(tree?.blobs ?? {});\n\t}\n\n\tprivate async getIdForPath(path: string): Promise<string> {\n\t\treturn this.flattenedTree[path];\n\t}\n}\n"]}
|
|
@@ -52,7 +52,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
52
52
|
private readonly contexts;
|
|
53
53
|
private readonly contextsDeferred;
|
|
54
54
|
private readonly pendingAttach;
|
|
55
|
-
private bindState;
|
|
56
55
|
private readonly deferredAttached;
|
|
57
56
|
private readonly localChannelContextQueue;
|
|
58
57
|
private readonly notBoundedChannelContextSet;
|
|
@@ -66,7 +65,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
66
65
|
private readonly audience;
|
|
67
66
|
private readonly mc;
|
|
68
67
|
get logger(): ITelemetryLogger;
|
|
69
|
-
private readonly channelsBaseGCDetails;
|
|
70
68
|
/**
|
|
71
69
|
* If the summarizer makes local changes, a telemetry event is logged. This has the potential to be very noisy.
|
|
72
70
|
* So, adding a count of how many telemetry events are logged per data store context. This can be
|
|
@@ -83,16 +81,16 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
83
81
|
*/
|
|
84
82
|
ensureNoDataModelChanges<T>(callback: () => T): T;
|
|
85
83
|
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
* Create an instance of a DataStore runtime.
|
|
85
|
+
*
|
|
86
|
+
* @param dataStoreContext - Context object for the runtime.
|
|
87
|
+
* @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
|
|
88
|
+
* @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
|
|
89
|
+
* @param initializeEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
|
|
90
|
+
* handle to this data store runtime will point to the object returned by this function. If this function is not
|
|
91
|
+
* provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
|
|
92
|
+
* and the primary way of interacting with some Fluid objects, and should be used if possible.
|
|
93
|
+
*/
|
|
96
94
|
constructor(dataStoreContext: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry, existing: boolean, initializeEntryPoint?: (runtime: IFluidDataStoreRuntime) => Promise<FluidObject>);
|
|
97
95
|
dispose(): void;
|
|
98
96
|
resolveHandle(request: IRequest): Promise<IResponse>;
|
|
@@ -179,12 +177,6 @@ export declare class FluidDataStoreRuntime extends TypedEventEmitter<IFluidDataS
|
|
|
179
177
|
* @param outboundHandle - The handle of the outbound node that is referenced.
|
|
180
178
|
*/
|
|
181
179
|
private addedGCOutboundReference;
|
|
182
|
-
/**
|
|
183
|
-
* Returns the base GC details for the channel with the given id. This is used to initialize its GC state.
|
|
184
|
-
* @param channelId - The id of the channel context that is asked for the initial GC details.
|
|
185
|
-
* @returns the requested channel's base GC details.
|
|
186
|
-
*/
|
|
187
|
-
private getChannelBaseGCDetails;
|
|
188
180
|
/**
|
|
189
181
|
* Returns a summary at the current sequence number.
|
|
190
182
|
* @param fullTree - true to bypass optimizations and force a full summary tree
|
|
@@ -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,
|
|
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,EACN,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,SAAS,EACT,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACN,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAIN,iBAAiB,EAEjB,MAAM,8BAA8B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reRuntime extends common_utils_1.TypedEventEmitter {
|
|
32
32
|
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
* Create an instance of a DataStore runtime.
|
|
34
|
+
*
|
|
35
|
+
* @param dataStoreContext - Context object for the runtime.
|
|
36
|
+
* @param sharedObjectRegistry - The registry of shared objects that this data store will be able to instantiate.
|
|
37
|
+
* @param existing - Pass 'true' if loading this datastore from an existing file; pass 'false' otherwise.
|
|
38
|
+
* @param initializeEntryPoint - Function to initialize the entryPoint object for the data store runtime. The
|
|
39
|
+
* handle to this data store runtime will point to the object returned by this function. If this function is not
|
|
40
|
+
* provided, the handle will be left undefined. This is here so we can start making handles a first-class citizen
|
|
41
|
+
* and the primary way of interacting with some Fluid objects, and should be used if possible.
|
|
42
|
+
*/
|
|
43
43
|
constructor(dataStoreContext, sharedObjectRegistry, existing, initializeEntryPoint) {
|
|
44
44
|
var _a;
|
|
45
45
|
super();
|
|
@@ -65,10 +65,6 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
65
65
|
this.quorum = dataStoreContext.getQuorum();
|
|
66
66
|
this.audience = dataStoreContext.getAudience();
|
|
67
67
|
const tree = dataStoreContext.baseSnapshot;
|
|
68
|
-
this.channelsBaseGCDetails = new common_utils_1.LazyPromise(async () => {
|
|
69
|
-
const baseGCDetails = await this.dataStoreContext.getBaseGCDetails();
|
|
70
|
-
return (0, garbage_collector_1.unpackChildNodesGCDetails)(baseGCDetails);
|
|
71
|
-
});
|
|
72
68
|
// Must always receive the data store type inside of the attributes
|
|
73
69
|
if ((tree === null || tree === void 0 ? void 0 : tree.trees) !== undefined) {
|
|
74
70
|
Object.keys(tree.trees).forEach((path) => {
|
|
@@ -94,7 +90,9 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
94
90
|
}
|
|
95
91
|
}
|
|
96
92
|
else {
|
|
97
|
-
channelContext = new remoteChannelContext_1.RemoteChannelContext(this, dataStoreContext, dataStoreContext.storage, (content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata), (address) => this.setChannelDirty(address), (srcHandle, outboundHandle) => this.addedGCOutboundReference(srcHandle, outboundHandle), path, tree.trees[path], this.sharedObjectRegistry, undefined /* extraBlobs */, this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
|
|
93
|
+
channelContext = new remoteChannelContext_1.RemoteChannelContext(this, dataStoreContext, dataStoreContext.storage, (content, localOpMetadata) => this.submitChannelOp(path, content, localOpMetadata), (address) => this.setChannelDirty(address), (srcHandle, outboundHandle) => this.addedGCOutboundReference(srcHandle, outboundHandle), path, tree.trees[path], this.sharedObjectRegistry, undefined /* extraBlobs */, this.dataStoreContext.getCreateChildSummarizerNodeFn(path, {
|
|
94
|
+
type: runtime_definitions_1.CreateSummarizerNodeSource.FromSummary,
|
|
95
|
+
}));
|
|
98
96
|
}
|
|
99
97
|
const deferred = new common_utils_1.Deferred();
|
|
100
98
|
deferred.resolve(channelContext);
|
|
@@ -107,8 +105,6 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
107
105
|
this.entryPoint = new fluidHandle_1.FluidObjectHandle(promise, "", this.objectsRoutingContext);
|
|
108
106
|
}
|
|
109
107
|
this.attachListener();
|
|
110
|
-
// If exists on storage or loaded from a snapshot, it should already be bound.
|
|
111
|
-
this.bindState = existing ? runtime_definitions_1.BindState.Bound : runtime_definitions_1.BindState.NotBound;
|
|
112
108
|
this._attachState = dataStoreContext.attachState;
|
|
113
109
|
/**
|
|
114
110
|
* If existing flag is false, this is a new data store and is not visible. The existing flag can be true in two
|
|
@@ -121,8 +117,10 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
121
117
|
* when an attach op comes in. In both these cases, the data store is already globally visible.
|
|
122
118
|
*/
|
|
123
119
|
if (existing) {
|
|
124
|
-
this.visibilityState =
|
|
125
|
-
|
|
120
|
+
this.visibilityState =
|
|
121
|
+
dataStoreContext.attachState === container_definitions_1.AttachState.Detached
|
|
122
|
+
? runtime_definitions_1.VisibilityState.LocallyVisible
|
|
123
|
+
: runtime_definitions_1.VisibilityState.GloballyVisible;
|
|
126
124
|
}
|
|
127
125
|
else {
|
|
128
126
|
this.visibilityState = runtime_definitions_1.VisibilityState.NotVisible;
|
|
@@ -146,7 +144,9 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
146
144
|
static load(context, sharedObjectRegistry, existing) {
|
|
147
145
|
return new FluidDataStoreRuntime(context, sharedObjectRegistry, existing, async (dataStoreRuntime) => (0, runtime_utils_1.requestFluidObject)(dataStoreRuntime, "/"));
|
|
148
146
|
}
|
|
149
|
-
get IFluidRouter() {
|
|
147
|
+
get IFluidRouter() {
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
150
|
get connected() {
|
|
151
151
|
return this.dataStoreContext.connected;
|
|
152
152
|
}
|
|
@@ -168,11 +168,21 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
168
168
|
get routeContext() {
|
|
169
169
|
return this.dataStoreContext.IFluidHandleContext;
|
|
170
170
|
}
|
|
171
|
-
get IFluidHandleContext() {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
get
|
|
175
|
-
|
|
171
|
+
get IFluidHandleContext() {
|
|
172
|
+
return this;
|
|
173
|
+
}
|
|
174
|
+
get rootRoutingContext() {
|
|
175
|
+
return this;
|
|
176
|
+
}
|
|
177
|
+
get channelsRoutingContext() {
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
180
|
+
get objectsRoutingContext() {
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
get disposed() {
|
|
184
|
+
return this._disposed;
|
|
185
|
+
}
|
|
176
186
|
get logger() {
|
|
177
187
|
return this.mc.logger;
|
|
178
188
|
}
|
|
@@ -186,9 +196,9 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
186
196
|
*/
|
|
187
197
|
ensureNoDataModelChanges(callback) {
|
|
188
198
|
// back-compat ADO:2309
|
|
189
|
-
return this.dataStoreContext.ensureNoDataModelChanges === undefined
|
|
190
|
-
callback()
|
|
191
|
-
this.dataStoreContext.ensureNoDataModelChanges(callback);
|
|
199
|
+
return this.dataStoreContext.ensureNoDataModelChanges === undefined
|
|
200
|
+
? callback()
|
|
201
|
+
: this.dataStoreContext.ensureNoDataModelChanges(callback);
|
|
192
202
|
}
|
|
193
203
|
dispose() {
|
|
194
204
|
if (this._disposed) {
|
|
@@ -310,7 +320,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
310
320
|
handle.attachGraph();
|
|
311
321
|
});
|
|
312
322
|
this.pendingHandlesToMakeVisible.clear();
|
|
313
|
-
this.
|
|
323
|
+
this.dataStoreContext.makeLocallyVisible();
|
|
314
324
|
}
|
|
315
325
|
/**
|
|
316
326
|
* This function is called when a handle to this data store is added to a visible DDS.
|
|
@@ -326,12 +336,7 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
326
336
|
* 2. Attaching the graph if the data store becomes attached.
|
|
327
337
|
*/
|
|
328
338
|
bindToContext() {
|
|
329
|
-
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
this.bindState = runtime_definitions_1.BindState.Binding;
|
|
333
|
-
this.dataStoreContext.bindToContext();
|
|
334
|
-
this.bindState = runtime_definitions_1.BindState.Bound;
|
|
339
|
+
this.makeVisibleAndAttachGraph();
|
|
335
340
|
}
|
|
336
341
|
bind(handle) {
|
|
337
342
|
// If visible, attach the incoming handle's graph. Else, this will be done when we become visible.
|
|
@@ -373,14 +378,14 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
373
378
|
this.pendingAttach.delete(id);
|
|
374
379
|
}
|
|
375
380
|
else {
|
|
376
|
-
(0, common_utils_1.assert)(!this.contexts.has(id), 0x17d);
|
|
381
|
+
(0, common_utils_1.assert)(!this.contexts.has(id), 0x17d /* "Unexpected attach channel OP" */);
|
|
377
382
|
const flatBlobs = new Map();
|
|
378
383
|
const snapshotTree = (0, driver_utils_1.buildSnapshotTree)(attachMessage.snapshot.entries, flatBlobs);
|
|
379
384
|
const remoteChannelContext = new remoteChannelContext_1.RemoteChannelContext(this, this.dataStoreContext, this.dataStoreContext.storage, (content, localContentMetadata) => this.submitChannelOp(id, content, localContentMetadata), (address) => this.setChannelDirty(address), (srcHandle, outboundHandle) => this.addedGCOutboundReference(srcHandle, outboundHandle), id, snapshotTree, this.sharedObjectRegistry, flatBlobs, this.dataStoreContext.getCreateChildSummarizerNodeFn(id, {
|
|
380
385
|
type: runtime_definitions_1.CreateSummarizerNodeSource.FromAttach,
|
|
381
386
|
sequenceNumber: message.sequenceNumber,
|
|
382
387
|
snapshot: attachMessage.snapshot,
|
|
383
|
-
}),
|
|
388
|
+
}), attachMessage.type);
|
|
384
389
|
this.contexts.set(id, remoteChannelContext);
|
|
385
390
|
if (this.contextsDeferred.has(id)) {
|
|
386
391
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -412,13 +417,13 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
412
417
|
return (
|
|
413
418
|
// Added in createChannel
|
|
414
419
|
// Removed when bindChannel is called
|
|
415
|
-
!this.notBoundedChannelContextSet.has(id)
|
|
420
|
+
!this.notBoundedChannelContextSet.has(id) &&
|
|
416
421
|
// Added in bindChannel only if this is not attached yet
|
|
417
422
|
// Removed when this is attached by calling attachGraph
|
|
418
|
-
|
|
423
|
+
!this.localChannelContextQueue.has(id) &&
|
|
419
424
|
// Added in attachChannel called by bindChannel
|
|
420
425
|
// Removed when attach op is broadcast
|
|
421
|
-
|
|
426
|
+
!this.pendingAttach.has(id));
|
|
422
427
|
}
|
|
423
428
|
/**
|
|
424
429
|
* Returns the outbound routes of this channel. Currently, all contexts in this channel are considered
|
|
@@ -468,7 +473,8 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
468
473
|
// Get GC data only for attached contexts. Detached contexts are not connected in the GC reference
|
|
469
474
|
// graph so any references they might have won't be connected as well.
|
|
470
475
|
return this.isChannelAttached(contextId);
|
|
471
|
-
})
|
|
476
|
+
})
|
|
477
|
+
.map(async ([contextId, context]) => {
|
|
472
478
|
const contextGCData = await context.getGCData(fullGC);
|
|
473
479
|
// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.
|
|
474
480
|
// This also gradually builds the id of each node to be a path from the root.
|
|
@@ -505,29 +511,6 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
505
511
|
var _a, _b;
|
|
506
512
|
(_b = (_a = this.dataStoreContext).addedGCOutboundReference) === null || _b === void 0 ? void 0 : _b.call(_a, srcHandle, outboundHandle);
|
|
507
513
|
}
|
|
508
|
-
/**
|
|
509
|
-
* Returns the base GC details for the channel with the given id. This is used to initialize its GC state.
|
|
510
|
-
* @param channelId - The id of the channel context that is asked for the initial GC details.
|
|
511
|
-
* @returns the requested channel's base GC details.
|
|
512
|
-
*/
|
|
513
|
-
async getChannelBaseGCDetails(channelId) {
|
|
514
|
-
var _a;
|
|
515
|
-
let channelBaseGCDetails = (await this.channelsBaseGCDetails).get(channelId);
|
|
516
|
-
if (channelBaseGCDetails === undefined) {
|
|
517
|
-
channelBaseGCDetails = {};
|
|
518
|
-
}
|
|
519
|
-
else if (((_a = channelBaseGCDetails.gcData) === null || _a === void 0 ? void 0 : _a.gcNodes) !== undefined) {
|
|
520
|
-
// Note: if the child channel has an explicit handle route to its parent, it will be removed here and
|
|
521
|
-
// expected to be added back by the parent when getGCData is called.
|
|
522
|
-
(0, garbage_collector_1.removeRouteFromAllNodes)(channelBaseGCDetails.gcData.gcNodes, this.absolutePath);
|
|
523
|
-
}
|
|
524
|
-
// Currently, channel context's are always considered used. So, it there are no used routes for it, we still
|
|
525
|
-
// need to mark it as used. Add self-route (empty string) to the channel context's used routes.
|
|
526
|
-
if (channelBaseGCDetails.usedRoutes === undefined || channelBaseGCDetails.usedRoutes.length === 0) {
|
|
527
|
-
channelBaseGCDetails.usedRoutes = [""];
|
|
528
|
-
}
|
|
529
|
-
return channelBaseGCDetails;
|
|
530
|
-
}
|
|
531
514
|
/**
|
|
532
515
|
* Returns a summary at the current sequence number.
|
|
533
516
|
* @param fullTree - true to bypass optimizations and force a full summary tree
|
|
@@ -545,7 +528,8 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
545
528
|
// If the object is registered - and we have received the sequenced op creating the object
|
|
546
529
|
// (i.e. it has a base mapping) - then we go ahead and summarize
|
|
547
530
|
return isAttached;
|
|
548
|
-
})
|
|
531
|
+
})
|
|
532
|
+
.map(async ([contextId, context]) => {
|
|
549
533
|
const contextSummary = await context.summarize(fullTree, trackState, telemetryContext);
|
|
550
534
|
summaryBuilder.addWithStats(contextId, contextSummary);
|
|
551
535
|
}));
|
|
@@ -650,15 +634,14 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
650
634
|
reSubmit(type, content, localOpMetadata) {
|
|
651
635
|
this.verifyNotClosed();
|
|
652
636
|
switch (type) {
|
|
653
|
-
case DataStoreMessageType.ChannelOp:
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
637
|
+
case DataStoreMessageType.ChannelOp: {
|
|
638
|
+
// For Operations, find the right channel and trigger resubmission on it.
|
|
639
|
+
const envelope = content;
|
|
640
|
+
const channelContext = this.contexts.get(envelope.address);
|
|
641
|
+
(0, common_utils_1.assert)(!!channelContext, 0x183 /* "There should be a channel context for the op" */);
|
|
642
|
+
channelContext.reSubmit(envelope.contents, localOpMetadata);
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
662
645
|
case DataStoreMessageType.Attach:
|
|
663
646
|
// For Attach messages, just submit them again.
|
|
664
647
|
this.submit(type, content, localOpMetadata);
|
|
@@ -675,15 +658,14 @@ class FluidDataStoreRuntime extends common_utils_1.TypedEventEmitter {
|
|
|
675
658
|
rollback(type, content, localOpMetadata) {
|
|
676
659
|
this.verifyNotClosed();
|
|
677
660
|
switch (type) {
|
|
678
|
-
case DataStoreMessageType.ChannelOp:
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
661
|
+
case DataStoreMessageType.ChannelOp: {
|
|
662
|
+
// For Operations, find the right channel and trigger resubmission on it.
|
|
663
|
+
const envelope = content;
|
|
664
|
+
const channelContext = this.contexts.get(envelope.address);
|
|
665
|
+
(0, common_utils_1.assert)(!!channelContext, 0x2ed /* "There should be a channel context for the op" */);
|
|
666
|
+
channelContext.rollback(envelope.contents, localOpMetadata);
|
|
667
|
+
break;
|
|
668
|
+
}
|
|
687
669
|
default:
|
|
688
670
|
throw new telemetry_utils_1.LoggingError(`Can't rollback ${type} message`);
|
|
689
671
|
}
|