@fluidframework/container-runtime 0.55.2 → 0.56.2
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/containerRuntime.d.ts +3 -12
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +24 -38
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +42 -29
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +27 -49
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +2 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +74 -16
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +22 -9
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +55 -35
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -17
- package/dist/index.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/runningSummarizer.d.ts.map +1 -1
- package/dist/runningSummarizer.js +2 -9
- package/dist/runningSummarizer.js.map +1 -1
- package/dist/summarizerTypes.d.ts +2 -0
- package/dist/summarizerTypes.d.ts.map +1 -1
- package/dist/summarizerTypes.js.map +1 -1
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js +2 -1
- package/dist/summaryFormat.js.map +1 -1
- package/dist/summaryGenerator.d.ts +0 -5
- package/dist/summaryGenerator.d.ts.map +1 -1
- package/dist/summaryGenerator.js +2 -1
- package/dist/summaryGenerator.js.map +1 -1
- package/garbageCollection.md +33 -0
- package/lib/containerRuntime.d.ts +3 -12
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +25 -39
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +42 -29
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +25 -47
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +2 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +75 -17
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +22 -9
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +55 -35
- package/lib/garbageCollection.js.map +1 -1
- package/lib/index.d.ts +6 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -6
- package/lib/index.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/runningSummarizer.d.ts.map +1 -1
- package/lib/runningSummarizer.js +2 -9
- package/lib/runningSummarizer.js.map +1 -1
- package/lib/summarizerTypes.d.ts +2 -0
- package/lib/summarizerTypes.d.ts.map +1 -1
- package/lib/summarizerTypes.js.map +1 -1
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js +2 -1
- package/lib/summaryFormat.js.map +1 -1
- package/lib/summaryGenerator.d.ts +0 -5
- package/lib/summaryGenerator.d.ts.map +1 -1
- package/lib/summaryGenerator.js +2 -1
- package/lib/summaryGenerator.js.map +1 -1
- package/package.json +14 -14
- package/src/containerRuntime.ts +38 -42
- package/src/dataStoreContext.ts +76 -122
- package/src/dataStores.ts +75 -48
- package/src/garbageCollection.ts +62 -39
- package/src/index.ts +51 -6
- package/src/packageVersion.ts +1 -1
- package/src/runningSummarizer.ts +2 -7
- package/src/summarizerTypes.ts +2 -0
- package/src/summaryFormat.ts +2 -1
- package/src/summaryGenerator.ts +2 -6
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IDisposable, ITelemetryLogger } from "@fluidframework/common-definitions";
|
|
6
6
|
import { FluidObject, IRequest, IResponse, IFluidHandle } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IAudience, IDeltaManager,
|
|
7
|
+
import { IAudience, IDeltaManager, BindState, AttachState, ILoaderOptions } from "@fluidframework/container-definitions";
|
|
8
8
|
import { Deferred, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
9
9
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
10
10
|
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISnapshotTree, ITreeEntry } from "@fluidframework/protocol-definitions";
|
|
@@ -21,18 +21,40 @@ interface ISnapshotDetails {
|
|
|
21
21
|
isRootDataStore: boolean;
|
|
22
22
|
snapshot?: ISnapshotTree;
|
|
23
23
|
}
|
|
24
|
+
/** Properties necessary for creating a FluidDataStoreContext */
|
|
25
|
+
export interface IFluidDataStoreContextProps {
|
|
26
|
+
readonly id: string;
|
|
27
|
+
readonly runtime: ContainerRuntime;
|
|
28
|
+
readonly storage: IDocumentStorageService;
|
|
29
|
+
readonly scope: FluidObject;
|
|
30
|
+
readonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;
|
|
31
|
+
readonly writeGCDataAtRoot: boolean;
|
|
32
|
+
readonly disableIsolatedChannels: boolean;
|
|
33
|
+
readonly pkg?: Readonly<string[]>;
|
|
34
|
+
}
|
|
35
|
+
/** Properties necessary for creating a local FluidDataStoreContext */
|
|
36
|
+
export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
37
|
+
readonly pkg: Readonly<string[]> | undefined;
|
|
38
|
+
readonly snapshotTree: ISnapshotTree | undefined;
|
|
39
|
+
readonly isRootDataStore: boolean | undefined;
|
|
40
|
+
readonly bindChannelFn: (channel: IFluidDataStoreChannel) => void;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
43
|
+
*/
|
|
44
|
+
readonly createProps?: any;
|
|
45
|
+
}
|
|
46
|
+
/** Properties necessary for creating a remote FluidDataStoreContext */
|
|
47
|
+
export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
48
|
+
readonly snapshotTree: ISnapshotTree | string | undefined;
|
|
49
|
+
readonly getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase | undefined>;
|
|
50
|
+
}
|
|
24
51
|
/**
|
|
25
52
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
26
53
|
*/
|
|
27
54
|
export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidDataStoreContextEvents> implements IFluidDataStoreContext, IDisposable {
|
|
28
|
-
private readonly _containerRuntime;
|
|
29
|
-
readonly id: string;
|
|
30
55
|
private readonly existing;
|
|
31
|
-
readonly storage: IDocumentStorageService;
|
|
32
|
-
readonly scope: FluidObject | FluidObject;
|
|
33
56
|
private bindState;
|
|
34
57
|
readonly isLocalDataStore: boolean;
|
|
35
|
-
protected pkg?: readonly string[] | undefined;
|
|
36
58
|
get packagePath(): readonly string[];
|
|
37
59
|
get options(): ILoaderOptions;
|
|
38
60
|
get clientId(): string | undefined;
|
|
@@ -49,9 +71,6 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
49
71
|
get attachState(): AttachState;
|
|
50
72
|
get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined;
|
|
51
73
|
isRoot(): Promise<boolean>;
|
|
52
|
-
protected get disableIsolatedChannels(): boolean;
|
|
53
|
-
/** Tells whether GC data will be written at the root of the summary tree. If so, data store should not write it. */
|
|
54
|
-
protected get writeGCDataAtRoot(): boolean;
|
|
55
74
|
protected registry: IFluidDataStoreRegistry | undefined;
|
|
56
75
|
protected detachedRuntimeCreation: boolean;
|
|
57
76
|
readonly bindToContext: () => void;
|
|
@@ -66,7 +85,14 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
66
85
|
private readonly thresholdOpsCounter;
|
|
67
86
|
private static readonly pendingOpsCountThreshold;
|
|
68
87
|
private lastUsedState;
|
|
69
|
-
|
|
88
|
+
readonly id: string;
|
|
89
|
+
private readonly _containerRuntime;
|
|
90
|
+
readonly storage: IDocumentStorageService;
|
|
91
|
+
readonly scope: FluidObject;
|
|
92
|
+
private readonly writeGCDataAtRoot;
|
|
93
|
+
protected readonly disableIsolatedChannels: boolean;
|
|
94
|
+
protected pkg?: readonly string[];
|
|
95
|
+
constructor(props: IFluidDataStoreContextProps, existing: boolean, bindState: BindState, isLocalDataStore: boolean, bindChannelFn: (channel: IFluidDataStoreChannel) => void);
|
|
70
96
|
dispose(): void;
|
|
71
97
|
private rejectDeferredRealize;
|
|
72
98
|
realize(): Promise<IFluidDataStoreChannel>;
|
|
@@ -151,7 +177,6 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
151
177
|
*/
|
|
152
178
|
setChannelDirty(address: string): void;
|
|
153
179
|
submitSignal(type: string, content: any): void;
|
|
154
|
-
raiseContainerWarning(warning: ContainerWarning): void;
|
|
155
180
|
protected bindRuntime(channel: IFluidDataStoreChannel): void;
|
|
156
181
|
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
157
182
|
abstract generateAttachMessage(): IAttachMessage;
|
|
@@ -173,11 +198,11 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
173
198
|
getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean | undefined) => Promise<IGarbageCollectionData>, getBaseGCDetailsFn: () => Promise<IGarbageCollectionDetailsBase>) => ISummarizerNodeWithGC;
|
|
174
199
|
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
175
200
|
}
|
|
176
|
-
export declare class
|
|
177
|
-
private readonly initSnapshotValue;
|
|
201
|
+
export declare class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
178
202
|
private isRootDataStore;
|
|
203
|
+
private readonly initSnapshotValue;
|
|
179
204
|
private readonly baseGCDetailsP;
|
|
180
|
-
constructor(
|
|
205
|
+
constructor(props: IRemoteFluidDataStoreContextProps);
|
|
181
206
|
private readonly initialSnapshotDetailsP;
|
|
182
207
|
protected getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
183
208
|
/**
|
|
@@ -199,15 +224,7 @@ export declare class RemotedFluidDataStoreContext extends FluidDataStoreContext
|
|
|
199
224
|
export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
200
225
|
private readonly snapshotTree;
|
|
201
226
|
protected isRootDataStore: boolean | undefined;
|
|
202
|
-
|
|
203
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
204
|
-
*/
|
|
205
|
-
readonly createProps?: any;
|
|
206
|
-
constructor(id: string, pkg: Readonly<string[]> | undefined, runtime: ContainerRuntime, storage: IDocumentStorageService, scope: FluidObject, createSummarizerNode: CreateChildSummarizerNodeFn, bindChannel: (channel: IFluidDataStoreChannel) => void, snapshotTree: ISnapshotTree | undefined, isRootDataStore: boolean | undefined,
|
|
207
|
-
/**
|
|
208
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
209
|
-
*/
|
|
210
|
-
createProps?: any);
|
|
227
|
+
constructor(props: ILocalFluidDataStoreContextProps);
|
|
211
228
|
private attachListeners;
|
|
212
229
|
generateAttachMessage(): IAttachMessage;
|
|
213
230
|
protected getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
@@ -230,11 +247,7 @@ export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContex
|
|
|
230
247
|
* Runtime is created using data store factory that is associated with this context.
|
|
231
248
|
*/
|
|
232
249
|
export declare class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
233
|
-
constructor(
|
|
234
|
-
/**
|
|
235
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
236
|
-
*/
|
|
237
|
-
createProps?: any);
|
|
250
|
+
constructor(props: ILocalFluidDataStoreContextProps);
|
|
238
251
|
}
|
|
239
252
|
/**
|
|
240
253
|
* Detached context. Data Store runtime will be attached to it by attachRuntime() call
|
|
@@ -243,7 +256,7 @@ export declare class LocalFluidDataStoreContext extends LocalFluidDataStoreConte
|
|
|
243
256
|
* Attachment process provides all missing parts - package path, data store runtime, and data store factory
|
|
244
257
|
*/
|
|
245
258
|
export declare class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase implements IFluidDataStoreContextDetached {
|
|
246
|
-
constructor(
|
|
259
|
+
constructor(props: ILocalFluidDataStoreContextProps);
|
|
247
260
|
attachRuntime(registry: IProvideFluidDataStoreFactory, dataStoreRuntime: IFluidDataStoreChannel): Promise<void>;
|
|
248
261
|
protected getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
249
262
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EACH,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EACH,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACH,SAAS,EACT,aAAa,EACb,SAAS,EACT,WAAW,EACX,cAAc,EACjB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAEH,QAAQ,EAER,iBAAiB,EACpB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,OAAO,EACH,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,aAAa,EAC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,IAAI,OAAO,CAAC,6BAA6B,CAAC;IAIhE,qBAAqB,IAAI,cAAc;IAI9C;;;;OAIG;IACI,OAAO,IAAI,IAAI;CAGzB;AAED;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,qBAAqB;IACrE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA4B;IACzD,SAAS,CAAC,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;gBAEnC,KAAK,EAAE,gCAAgC;IAcnD,OAAO,CAAC,eAAe;IAWhB,qBAAqB,IAAI,cAAc;cAiC9B,yBAAyB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IA+BtE;;OAEG;IACU,0BAA0B,IAAI,OAAO,CAAC,gCAAgC,CAAC;IAKvE,gBAAgB,IAAI,OAAO,CAAC,6BAA6B,CAAC;IAKvE;;;;OAIG;IACI,OAAO,IAAI,IAAI;CAGzB;AAED;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,8BAA8B;gBAC9D,KAAK,EAAE,gCAAgC;CAGtD;AAED;;;;;GAKG;AACH,qBAAa,kCACT,SAAQ,8BACR,YAAW,8BAA8B;gBAE7B,KAAK,EAAE,gCAAgC;IAKtC,aAAa,CACtB,QAAQ,EAAE,6BAA6B,EACvC,gBAAgB,EAAE,sBAAsB;cAuB5B,yBAAyB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAMzE"}
|
package/dist/dataStoreContext.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.LocalDetachedFluidDataStoreContext = exports.LocalFluidDataStoreContext = exports.LocalFluidDataStoreContextBase = exports.
|
|
7
|
+
exports.LocalDetachedFluidDataStoreContext = exports.LocalFluidDataStoreContext = exports.LocalFluidDataStoreContextBase = exports.RemoteFluidDataStoreContext = exports.FluidDataStoreContext = exports.createAttributesBlob = void 0;
|
|
8
8
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
9
9
|
const common_utils_1 = require("@fluidframework/common-utils");
|
|
10
10
|
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
@@ -35,34 +35,36 @@ exports.createAttributesBlob = createAttributesBlob;
|
|
|
35
35
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
36
36
|
*/
|
|
37
37
|
class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
38
|
-
constructor(
|
|
38
|
+
constructor(props, existing, bindState, isLocalDataStore, bindChannelFn) {
|
|
39
39
|
super();
|
|
40
|
-
this._containerRuntime = _containerRuntime;
|
|
41
|
-
this.id = id;
|
|
42
40
|
this.existing = existing;
|
|
43
|
-
this.storage = storage;
|
|
44
|
-
this.scope = scope;
|
|
45
41
|
this.bindState = bindState;
|
|
46
42
|
this.isLocalDataStore = isLocalDataStore;
|
|
47
|
-
this.pkg = pkg;
|
|
48
43
|
this._disposed = false;
|
|
49
44
|
this.detachedRuntimeCreation = false;
|
|
50
45
|
this.loaded = false;
|
|
51
46
|
this.pending = [];
|
|
47
|
+
this._containerRuntime = props.runtime;
|
|
48
|
+
this.id = props.id;
|
|
49
|
+
this.storage = props.storage;
|
|
50
|
+
this.scope = props.scope;
|
|
51
|
+
this.writeGCDataAtRoot = props.writeGCDataAtRoot;
|
|
52
|
+
this.disableIsolatedChannels = props.disableIsolatedChannels;
|
|
53
|
+
this.pkg = props.pkg;
|
|
52
54
|
// URIs use slashes as delimiters. Handles use URIs.
|
|
53
55
|
// Thus having slashes in types almost guarantees trouble down the road!
|
|
54
|
-
common_utils_1.assert(id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
|
|
56
|
+
common_utils_1.assert(this.id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
|
|
55
57
|
this._attachState = this.containerRuntime.attachState !== container_definitions_1.AttachState.Detached && this.existing ?
|
|
56
58
|
this.containerRuntime.attachState : container_definitions_1.AttachState.Detached;
|
|
57
59
|
this.bindToContext = () => {
|
|
58
60
|
common_utils_1.assert(this.bindState === container_definitions_1.BindState.NotBound, 0x13b /* "datastore context is already in bound state" */);
|
|
59
61
|
this.bindState = container_definitions_1.BindState.Binding;
|
|
60
62
|
common_utils_1.assert(this.channel !== undefined, 0x13c /* "undefined channel on datastore context" */);
|
|
61
|
-
|
|
63
|
+
bindChannelFn(this.channel);
|
|
62
64
|
this.bindState = container_definitions_1.BindState.Bound;
|
|
63
65
|
};
|
|
64
66
|
const thisSummarizeInternal = async (fullTree, trackState) => this.summarizeInternal(fullTree, trackState);
|
|
65
|
-
this.summarizerNode =
|
|
67
|
+
this.summarizerNode = props.createSummarizerNodeFn(thisSummarizeInternal, async (fullGC) => this.getGCDataInternal(fullGC), async () => this.getBaseGCDetails());
|
|
66
68
|
this.subLogger = telemetry_utils_1.ChildLogger.create(this.logger, "FluidDataStoreContext");
|
|
67
69
|
this.thresholdOpsCounter = new telemetry_utils_1.ThresholdCounter(FluidDataStoreContext.pendingOpsCountThreshold, this.subLogger);
|
|
68
70
|
}
|
|
@@ -110,13 +112,6 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
110
112
|
async isRoot() {
|
|
111
113
|
return (await this.getInitialSnapshotDetails()).isRootDataStore;
|
|
112
114
|
}
|
|
113
|
-
get disableIsolatedChannels() {
|
|
114
|
-
return this._containerRuntime.disableIsolatedChannels;
|
|
115
|
-
}
|
|
116
|
-
/** Tells whether GC data will be written at the root of the summary tree. If so, data store should not write it. */
|
|
117
|
-
get writeGCDataAtRoot() {
|
|
118
|
-
return this._containerRuntime.writeGCDataAtRoot;
|
|
119
|
-
}
|
|
120
115
|
dispose() {
|
|
121
116
|
if (this._disposed) {
|
|
122
117
|
return;
|
|
@@ -383,10 +378,6 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
383
378
|
common_utils_1.assert(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
|
|
384
379
|
return this._containerRuntime.submitDataStoreSignal(this.id, type, content);
|
|
385
380
|
}
|
|
386
|
-
// @deprecated Warnings are being deprecated
|
|
387
|
-
raiseContainerWarning(warning) {
|
|
388
|
-
this.containerRuntime.raiseContainerWarning(warning);
|
|
389
|
-
}
|
|
390
381
|
bindRuntime(channel) {
|
|
391
382
|
var _a;
|
|
392
383
|
if (this.channel) {
|
|
@@ -461,12 +452,11 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
461
452
|
}
|
|
462
453
|
exports.FluidDataStoreContext = FluidDataStoreContext;
|
|
463
454
|
FluidDataStoreContext.pendingOpsCountThreshold = 1000;
|
|
464
|
-
class
|
|
465
|
-
constructor(
|
|
466
|
-
super(
|
|
455
|
+
class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
456
|
+
constructor(props) {
|
|
457
|
+
super(props, true /* existing */, container_definitions_1.BindState.Bound, false /* isLocalDataStore */, () => {
|
|
467
458
|
throw new Error("Already attached");
|
|
468
|
-
}
|
|
469
|
-
this.initSnapshotValue = initSnapshotValue;
|
|
459
|
+
});
|
|
470
460
|
this.initialSnapshotDetailsP = new common_utils_1.LazyPromise(async () => {
|
|
471
461
|
var _a, _b;
|
|
472
462
|
let tree;
|
|
@@ -523,9 +513,10 @@ class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
523
513
|
isRootDataStore,
|
|
524
514
|
};
|
|
525
515
|
});
|
|
516
|
+
this.initSnapshotValue = props.snapshotTree;
|
|
526
517
|
this.baseGCDetailsP = new common_utils_1.LazyPromise(async () => {
|
|
527
518
|
var _a;
|
|
528
|
-
return (_a = (await getBaseGCDetails())) !== null && _a !== void 0 ? _a : {};
|
|
519
|
+
return (_a = (await props.getBaseGCDetails())) !== null && _a !== void 0 ? _a : {};
|
|
529
520
|
});
|
|
530
521
|
}
|
|
531
522
|
async getInitialSnapshotDetails() {
|
|
@@ -552,20 +543,15 @@ class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
552
543
|
this.isRootDataStore = true;
|
|
553
544
|
}
|
|
554
545
|
}
|
|
555
|
-
exports.
|
|
546
|
+
exports.RemoteFluidDataStoreContext = RemoteFluidDataStoreContext;
|
|
556
547
|
/**
|
|
557
548
|
* Base class for detached & attached context classes
|
|
558
549
|
*/
|
|
559
550
|
class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
560
|
-
constructor(
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
createProps) {
|
|
565
|
-
super(runtime, id, snapshotTree !== undefined ? true : false, storage, scope, createSummarizerNode, snapshotTree ? container_definitions_1.BindState.Bound : container_definitions_1.BindState.NotBound, true, bindChannel, pkg);
|
|
566
|
-
this.snapshotTree = snapshotTree;
|
|
567
|
-
this.isRootDataStore = isRootDataStore;
|
|
568
|
-
this.createProps = createProps;
|
|
551
|
+
constructor(props) {
|
|
552
|
+
super(props, props.snapshotTree !== undefined ? true : false /* existing */, props.snapshotTree ? container_definitions_1.BindState.Bound : container_definitions_1.BindState.NotBound, true /* isLocalDataStore */, props.bindChannelFn);
|
|
553
|
+
this.snapshotTree = props.snapshotTree;
|
|
554
|
+
this.isRootDataStore = props.isRootDataStore;
|
|
569
555
|
this.attachListeners();
|
|
570
556
|
}
|
|
571
557
|
attachListeners() {
|
|
@@ -590,10 +576,6 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
590
576
|
// Add data store's attributes to the summary.
|
|
591
577
|
const attributes = createAttributes(this.pkg, this.isRootDataStore, this.disableIsolatedChannels);
|
|
592
578
|
runtime_utils_1.addBlobToSummary(summarizeResult, summaryFormat_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
593
|
-
// Add GC data to the summary if it's not written at the root.
|
|
594
|
-
if (!this.writeGCDataAtRoot) {
|
|
595
|
-
runtime_utils_1.addBlobToSummary(summarizeResult, runtime_definitions_1.gcBlobKey, JSON.stringify(this.summarizerNode.getGCSummaryDetails()));
|
|
596
|
-
}
|
|
597
579
|
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
598
580
|
const snapshot = runtime_utils_1.convertSummaryTreeToITree(summarizeResult.summary);
|
|
599
581
|
const message = {
|
|
@@ -659,12 +641,8 @@ exports.LocalFluidDataStoreContextBase = LocalFluidDataStoreContextBase;
|
|
|
659
641
|
* Runtime is created using data store factory that is associated with this context.
|
|
660
642
|
*/
|
|
661
643
|
class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
662
|
-
constructor(
|
|
663
|
-
|
|
664
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
665
|
-
*/
|
|
666
|
-
createProps) {
|
|
667
|
-
super(id, pkg, runtime, storage, scope, createSummarizerNode, bindChannel, snapshotTree, isRootDataStore, createProps);
|
|
644
|
+
constructor(props) {
|
|
645
|
+
super(props);
|
|
668
646
|
}
|
|
669
647
|
}
|
|
670
648
|
exports.LocalFluidDataStoreContext = LocalFluidDataStoreContext;
|
|
@@ -675,8 +653,8 @@ exports.LocalFluidDataStoreContext = LocalFluidDataStoreContext;
|
|
|
675
653
|
* Attachment process provides all missing parts - package path, data store runtime, and data store factory
|
|
676
654
|
*/
|
|
677
655
|
class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
678
|
-
constructor(
|
|
679
|
-
super(
|
|
656
|
+
constructor(props) {
|
|
657
|
+
super(props);
|
|
680
658
|
this.detachedRuntimeCreation = true;
|
|
681
659
|
}
|
|
682
660
|
async attachRuntime(registry, dataStoreRuntime) {
|