@fluidframework/container-runtime 0.55.1 → 0.56.0-49831
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 +22 -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.d.ts.map +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/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.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 +23 -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.d.ts.map +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/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.map +1 -1
- package/package.json +14 -14
- package/src/containerRuntime.ts +36 -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/summaryFormat.ts +2 -1
- package/src/summaryGenerator.ts +0 -5
|
@@ -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,EACb,UAAU,EACb,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACH,iBAAiB,EACpB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAEH,2BAA2B,EAC3B,8BAA8B,EAG9B,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B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AY,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/lib/dataStoreContext.js
CHANGED
|
@@ -31,34 +31,36 @@ export function createAttributesBlob(pkg, isRootDataStore, disableIsolatedChanne
|
|
|
31
31
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
32
32
|
*/
|
|
33
33
|
export class FluidDataStoreContext extends TypedEventEmitter {
|
|
34
|
-
constructor(
|
|
34
|
+
constructor(props, existing, bindState, isLocalDataStore, bindChannelFn) {
|
|
35
35
|
super();
|
|
36
|
-
this._containerRuntime = _containerRuntime;
|
|
37
|
-
this.id = id;
|
|
38
36
|
this.existing = existing;
|
|
39
|
-
this.storage = storage;
|
|
40
|
-
this.scope = scope;
|
|
41
37
|
this.bindState = bindState;
|
|
42
38
|
this.isLocalDataStore = isLocalDataStore;
|
|
43
|
-
this.pkg = pkg;
|
|
44
39
|
this._disposed = false;
|
|
45
40
|
this.detachedRuntimeCreation = false;
|
|
46
41
|
this.loaded = false;
|
|
47
42
|
this.pending = [];
|
|
43
|
+
this._containerRuntime = props.runtime;
|
|
44
|
+
this.id = props.id;
|
|
45
|
+
this.storage = props.storage;
|
|
46
|
+
this.scope = props.scope;
|
|
47
|
+
this.writeGCDataAtRoot = props.writeGCDataAtRoot;
|
|
48
|
+
this.disableIsolatedChannels = props.disableIsolatedChannels;
|
|
49
|
+
this.pkg = props.pkg;
|
|
48
50
|
// URIs use slashes as delimiters. Handles use URIs.
|
|
49
51
|
// Thus having slashes in types almost guarantees trouble down the road!
|
|
50
|
-
assert(id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
|
|
52
|
+
assert(this.id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
|
|
51
53
|
this._attachState = this.containerRuntime.attachState !== AttachState.Detached && this.existing ?
|
|
52
54
|
this.containerRuntime.attachState : AttachState.Detached;
|
|
53
55
|
this.bindToContext = () => {
|
|
54
56
|
assert(this.bindState === BindState.NotBound, 0x13b /* "datastore context is already in bound state" */);
|
|
55
57
|
this.bindState = BindState.Binding;
|
|
56
58
|
assert(this.channel !== undefined, 0x13c /* "undefined channel on datastore context" */);
|
|
57
|
-
|
|
59
|
+
bindChannelFn(this.channel);
|
|
58
60
|
this.bindState = BindState.Bound;
|
|
59
61
|
};
|
|
60
62
|
const thisSummarizeInternal = async (fullTree, trackState) => this.summarizeInternal(fullTree, trackState);
|
|
61
|
-
this.summarizerNode =
|
|
63
|
+
this.summarizerNode = props.createSummarizerNodeFn(thisSummarizeInternal, async (fullGC) => this.getGCDataInternal(fullGC), async () => this.getBaseGCDetails());
|
|
62
64
|
this.subLogger = ChildLogger.create(this.logger, "FluidDataStoreContext");
|
|
63
65
|
this.thresholdOpsCounter = new ThresholdCounter(FluidDataStoreContext.pendingOpsCountThreshold, this.subLogger);
|
|
64
66
|
}
|
|
@@ -106,13 +108,6 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
106
108
|
async isRoot() {
|
|
107
109
|
return (await this.getInitialSnapshotDetails()).isRootDataStore;
|
|
108
110
|
}
|
|
109
|
-
get disableIsolatedChannels() {
|
|
110
|
-
return this._containerRuntime.disableIsolatedChannels;
|
|
111
|
-
}
|
|
112
|
-
/** Tells whether GC data will be written at the root of the summary tree. If so, data store should not write it. */
|
|
113
|
-
get writeGCDataAtRoot() {
|
|
114
|
-
return this._containerRuntime.writeGCDataAtRoot;
|
|
115
|
-
}
|
|
116
111
|
dispose() {
|
|
117
112
|
if (this._disposed) {
|
|
118
113
|
return;
|
|
@@ -379,10 +374,6 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
379
374
|
assert(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
|
|
380
375
|
return this._containerRuntime.submitDataStoreSignal(this.id, type, content);
|
|
381
376
|
}
|
|
382
|
-
// @deprecated Warnings are being deprecated
|
|
383
|
-
raiseContainerWarning(warning) {
|
|
384
|
-
this.containerRuntime.raiseContainerWarning(warning);
|
|
385
|
-
}
|
|
386
377
|
bindRuntime(channel) {
|
|
387
378
|
var _a;
|
|
388
379
|
if (this.channel) {
|
|
@@ -456,12 +447,11 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
456
447
|
}
|
|
457
448
|
}
|
|
458
449
|
FluidDataStoreContext.pendingOpsCountThreshold = 1000;
|
|
459
|
-
export class
|
|
460
|
-
constructor(
|
|
461
|
-
super(
|
|
450
|
+
export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
451
|
+
constructor(props) {
|
|
452
|
+
super(props, true /* existing */, BindState.Bound, false /* isLocalDataStore */, () => {
|
|
462
453
|
throw new Error("Already attached");
|
|
463
|
-
}
|
|
464
|
-
this.initSnapshotValue = initSnapshotValue;
|
|
454
|
+
});
|
|
465
455
|
this.initialSnapshotDetailsP = new LazyPromise(async () => {
|
|
466
456
|
var _a, _b;
|
|
467
457
|
let tree;
|
|
@@ -518,9 +508,10 @@ export class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
518
508
|
isRootDataStore,
|
|
519
509
|
};
|
|
520
510
|
});
|
|
511
|
+
this.initSnapshotValue = props.snapshotTree;
|
|
521
512
|
this.baseGCDetailsP = new LazyPromise(async () => {
|
|
522
513
|
var _a;
|
|
523
|
-
return (_a = (await getBaseGCDetails())) !== null && _a !== void 0 ? _a : {};
|
|
514
|
+
return (_a = (await props.getBaseGCDetails())) !== null && _a !== void 0 ? _a : {};
|
|
524
515
|
});
|
|
525
516
|
}
|
|
526
517
|
async getInitialSnapshotDetails() {
|
|
@@ -551,15 +542,10 @@ export class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
551
542
|
* Base class for detached & attached context classes
|
|
552
543
|
*/
|
|
553
544
|
export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
554
|
-
constructor(
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
createProps) {
|
|
559
|
-
super(runtime, id, snapshotTree !== undefined ? true : false, storage, scope, createSummarizerNode, snapshotTree ? BindState.Bound : BindState.NotBound, true, bindChannel, pkg);
|
|
560
|
-
this.snapshotTree = snapshotTree;
|
|
561
|
-
this.isRootDataStore = isRootDataStore;
|
|
562
|
-
this.createProps = createProps;
|
|
545
|
+
constructor(props) {
|
|
546
|
+
super(props, props.snapshotTree !== undefined ? true : false /* existing */, props.snapshotTree ? BindState.Bound : BindState.NotBound, true /* isLocalDataStore */, props.bindChannelFn);
|
|
547
|
+
this.snapshotTree = props.snapshotTree;
|
|
548
|
+
this.isRootDataStore = props.isRootDataStore;
|
|
563
549
|
this.attachListeners();
|
|
564
550
|
}
|
|
565
551
|
attachListeners() {
|
|
@@ -584,10 +570,6 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
584
570
|
// Add data store's attributes to the summary.
|
|
585
571
|
const attributes = createAttributes(this.pkg, this.isRootDataStore, this.disableIsolatedChannels);
|
|
586
572
|
addBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
587
|
-
// Add GC data to the summary if it's not written at the root.
|
|
588
|
-
if (!this.writeGCDataAtRoot) {
|
|
589
|
-
addBlobToSummary(summarizeResult, gcBlobKey, JSON.stringify(this.summarizerNode.getGCSummaryDetails()));
|
|
590
|
-
}
|
|
591
573
|
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
592
574
|
const snapshot = convertSummaryTreeToITree(summarizeResult.summary);
|
|
593
575
|
const message = {
|
|
@@ -652,12 +634,8 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
652
634
|
* Runtime is created using data store factory that is associated with this context.
|
|
653
635
|
*/
|
|
654
636
|
export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
655
|
-
constructor(
|
|
656
|
-
|
|
657
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
658
|
-
*/
|
|
659
|
-
createProps) {
|
|
660
|
-
super(id, pkg, runtime, storage, scope, createSummarizerNode, bindChannel, snapshotTree, isRootDataStore, createProps);
|
|
637
|
+
constructor(props) {
|
|
638
|
+
super(props);
|
|
661
639
|
}
|
|
662
640
|
}
|
|
663
641
|
/**
|
|
@@ -667,8 +645,8 @@ export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
|
667
645
|
* Attachment process provides all missing parts - package path, data store runtime, and data store factory
|
|
668
646
|
*/
|
|
669
647
|
export class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
670
|
-
constructor(
|
|
671
|
-
super(
|
|
648
|
+
constructor(props) {
|
|
649
|
+
super(props);
|
|
672
650
|
this.detachedRuntimeCreation = true;
|
|
673
651
|
}
|
|
674
652
|
async attachRuntime(registry, dataStoreRuntime) {
|