@fluidframework/container-runtime 0.55.0 → 0.56.1
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.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.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
package/src/dataStoreContext.ts
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
IAudience,
|
|
15
15
|
IDeltaManager,
|
|
16
|
-
ContainerWarning,
|
|
17
16
|
BindState,
|
|
18
17
|
AttachState,
|
|
19
18
|
ILoaderOptions,
|
|
@@ -120,6 +119,36 @@ interface FluidDataStoreMessage {
|
|
|
120
119
|
type: string;
|
|
121
120
|
}
|
|
122
121
|
|
|
122
|
+
/** Properties necessary for creating a FluidDataStoreContext */
|
|
123
|
+
export interface IFluidDataStoreContextProps {
|
|
124
|
+
readonly id: string;
|
|
125
|
+
readonly runtime: ContainerRuntime;
|
|
126
|
+
readonly storage: IDocumentStorageService;
|
|
127
|
+
readonly scope: FluidObject;
|
|
128
|
+
readonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;
|
|
129
|
+
readonly writeGCDataAtRoot: boolean;
|
|
130
|
+
readonly disableIsolatedChannels: boolean;
|
|
131
|
+
readonly pkg?: Readonly<string[]>;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/** Properties necessary for creating a local FluidDataStoreContext */
|
|
135
|
+
export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
136
|
+
readonly pkg: Readonly<string[]> | undefined;
|
|
137
|
+
readonly snapshotTree: ISnapshotTree | undefined;
|
|
138
|
+
readonly isRootDataStore: boolean | undefined;
|
|
139
|
+
readonly bindChannelFn: (channel: IFluidDataStoreChannel) => void;
|
|
140
|
+
/**
|
|
141
|
+
* @deprecated 0.16 Issue #1635, #3631
|
|
142
|
+
*/
|
|
143
|
+
readonly createProps?: any;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Properties necessary for creating a remote FluidDataStoreContext */
|
|
147
|
+
export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
148
|
+
readonly snapshotTree: ISnapshotTree | string | undefined;
|
|
149
|
+
readonly getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase | undefined>;
|
|
150
|
+
}
|
|
151
|
+
|
|
123
152
|
/**
|
|
124
153
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
125
154
|
*/
|
|
@@ -186,15 +215,6 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
186
215
|
return (await this.getInitialSnapshotDetails()).isRootDataStore;
|
|
187
216
|
}
|
|
188
217
|
|
|
189
|
-
protected get disableIsolatedChannels(): boolean {
|
|
190
|
-
return this._containerRuntime.disableIsolatedChannels;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** Tells whether GC data will be written at the root of the summary tree. If so, data store should not write it. */
|
|
194
|
-
protected get writeGCDataAtRoot(): boolean {
|
|
195
|
-
return this._containerRuntime.writeGCDataAtRoot;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
218
|
protected registry: IFluidDataStoreRegistry | undefined;
|
|
199
219
|
|
|
200
220
|
protected detachedRuntimeCreation = false;
|
|
@@ -214,23 +234,34 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
214
234
|
// if it realizes after GC is run.
|
|
215
235
|
private lastUsedState: { usedRoutes: string[], gcTimestamp?: number } | undefined;
|
|
216
236
|
|
|
237
|
+
public readonly id: string;
|
|
238
|
+
private readonly _containerRuntime: ContainerRuntime;
|
|
239
|
+
public readonly storage: IDocumentStorageService;
|
|
240
|
+
public readonly scope: FluidObject;
|
|
241
|
+
private readonly writeGCDataAtRoot: boolean;
|
|
242
|
+
protected readonly disableIsolatedChannels: boolean;
|
|
243
|
+
protected pkg?: readonly string[];
|
|
244
|
+
|
|
217
245
|
constructor(
|
|
218
|
-
|
|
219
|
-
public readonly id: string,
|
|
246
|
+
props: IFluidDataStoreContextProps,
|
|
220
247
|
private readonly existing: boolean,
|
|
221
|
-
public readonly storage: IDocumentStorageService,
|
|
222
|
-
public readonly scope: FluidObject | FluidObject,
|
|
223
|
-
createSummarizerNode: CreateChildSummarizerNodeFn,
|
|
224
248
|
private bindState: BindState,
|
|
225
249
|
public readonly isLocalDataStore: boolean,
|
|
226
|
-
|
|
227
|
-
protected pkg?: readonly string[],
|
|
250
|
+
bindChannelFn: (channel: IFluidDataStoreChannel) => void,
|
|
228
251
|
) {
|
|
229
252
|
super();
|
|
230
253
|
|
|
254
|
+
this._containerRuntime = props.runtime;
|
|
255
|
+
this.id = props.id;
|
|
256
|
+
this.storage = props.storage;
|
|
257
|
+
this.scope = props.scope;
|
|
258
|
+
this.writeGCDataAtRoot = props.writeGCDataAtRoot;
|
|
259
|
+
this.disableIsolatedChannels = props.disableIsolatedChannels;
|
|
260
|
+
this.pkg = props.pkg;
|
|
261
|
+
|
|
231
262
|
// URIs use slashes as delimiters. Handles use URIs.
|
|
232
263
|
// Thus having slashes in types almost guarantees trouble down the road!
|
|
233
|
-
assert(id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
|
|
264
|
+
assert(this.id.indexOf("/") === -1, 0x13a /* `Data store ID contains slash: ${id}` */);
|
|
234
265
|
|
|
235
266
|
this._attachState = this.containerRuntime.attachState !== AttachState.Detached && this.existing ?
|
|
236
267
|
this.containerRuntime.attachState : AttachState.Detached;
|
|
@@ -239,14 +270,14 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
239
270
|
assert(this.bindState === BindState.NotBound, 0x13b /* "datastore context is already in bound state" */);
|
|
240
271
|
this.bindState = BindState.Binding;
|
|
241
272
|
assert(this.channel !== undefined, 0x13c /* "undefined channel on datastore context" */);
|
|
242
|
-
|
|
273
|
+
bindChannelFn(this.channel);
|
|
243
274
|
this.bindState = BindState.Bound;
|
|
244
275
|
};
|
|
245
276
|
|
|
246
277
|
const thisSummarizeInternal =
|
|
247
278
|
async (fullTree: boolean, trackState: boolean) => this.summarizeInternal(fullTree, trackState);
|
|
248
279
|
|
|
249
|
-
this.summarizerNode =
|
|
280
|
+
this.summarizerNode = props.createSummarizerNodeFn(
|
|
250
281
|
thisSummarizeInternal,
|
|
251
282
|
async (fullGC?: boolean) => this.getGCDataInternal(fullGC),
|
|
252
283
|
async () => this.getBaseGCDetails(),
|
|
@@ -581,11 +612,6 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
581
612
|
return this._containerRuntime.submitDataStoreSignal(this.id, type, content);
|
|
582
613
|
}
|
|
583
614
|
|
|
584
|
-
// @deprecated Warnings are being deprecated
|
|
585
|
-
public raiseContainerWarning(warning: ContainerWarning): void {
|
|
586
|
-
this.containerRuntime.raiseContainerWarning(warning);
|
|
587
|
-
}
|
|
588
|
-
|
|
589
615
|
protected bindRuntime(channel: IFluidDataStoreChannel) {
|
|
590
616
|
if (this.channel) {
|
|
591
617
|
throw new Error("Runtime already bound");
|
|
@@ -702,37 +728,25 @@ export abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidData
|
|
|
702
728
|
}
|
|
703
729
|
}
|
|
704
730
|
|
|
705
|
-
export class
|
|
731
|
+
export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
706
732
|
private isRootDataStore: boolean | undefined;
|
|
733
|
+
private readonly initSnapshotValue: ISnapshotTree | string | undefined;
|
|
707
734
|
private readonly baseGCDetailsP: Promise<IGarbageCollectionDetailsBase>;
|
|
708
735
|
|
|
709
|
-
constructor(
|
|
710
|
-
id: string,
|
|
711
|
-
private readonly initSnapshotValue: ISnapshotTree | string | undefined,
|
|
712
|
-
getBaseGCDetails: () => Promise<IGarbageCollectionDetailsBase | undefined>,
|
|
713
|
-
runtime: ContainerRuntime,
|
|
714
|
-
storage: IDocumentStorageService,
|
|
715
|
-
scope: FluidObject,
|
|
716
|
-
createSummarizerNode: CreateChildSummarizerNodeFn,
|
|
717
|
-
pkg?: string[],
|
|
718
|
-
) {
|
|
736
|
+
constructor(props: IRemoteFluidDataStoreContextProps) {
|
|
719
737
|
super(
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
true,
|
|
723
|
-
storage,
|
|
724
|
-
scope,
|
|
725
|
-
createSummarizerNode,
|
|
738
|
+
props,
|
|
739
|
+
true /* existing */,
|
|
726
740
|
BindState.Bound,
|
|
727
|
-
false
|
|
741
|
+
false /* isLocalDataStore */,
|
|
728
742
|
() => {
|
|
729
743
|
throw new Error("Already attached");
|
|
730
744
|
},
|
|
731
|
-
pkg,
|
|
732
745
|
);
|
|
733
746
|
|
|
747
|
+
this.initSnapshotValue = props.snapshotTree;
|
|
734
748
|
this.baseGCDetailsP = new LazyPromise<IGarbageCollectionDetailsBase>(async () => {
|
|
735
|
-
return (await getBaseGCDetails()) ?? {};
|
|
749
|
+
return (await props.getBaseGCDetails()) ?? {};
|
|
736
750
|
});
|
|
737
751
|
}
|
|
738
752
|
|
|
@@ -831,32 +845,20 @@ export class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
831
845
|
* Base class for detached & attached context classes
|
|
832
846
|
*/
|
|
833
847
|
export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
storage: IDocumentStorageService,
|
|
839
|
-
scope: FluidObject,
|
|
840
|
-
createSummarizerNode: CreateChildSummarizerNodeFn,
|
|
841
|
-
bindChannel: (channel: IFluidDataStoreChannel) => void,
|
|
842
|
-
private readonly snapshotTree: ISnapshotTree | undefined,
|
|
843
|
-
protected isRootDataStore: boolean | undefined,
|
|
844
|
-
/**
|
|
845
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
846
|
-
*/
|
|
847
|
-
public readonly createProps?: any,
|
|
848
|
-
) {
|
|
848
|
+
private readonly snapshotTree: ISnapshotTree | undefined;
|
|
849
|
+
protected isRootDataStore: boolean | undefined;
|
|
850
|
+
|
|
851
|
+
constructor(props: ILocalFluidDataStoreContextProps) {
|
|
849
852
|
super(
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
snapshotTree
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
pkg);
|
|
853
|
+
props,
|
|
854
|
+
props.snapshotTree !== undefined ? true : false /* existing */,
|
|
855
|
+
props.snapshotTree ? BindState.Bound : BindState.NotBound,
|
|
856
|
+
true /* isLocalDataStore */,
|
|
857
|
+
props.bindChannelFn,
|
|
858
|
+
);
|
|
859
|
+
|
|
860
|
+
this.snapshotTree = props.snapshotTree;
|
|
861
|
+
this.isRootDataStore = props.isRootDataStore;
|
|
860
862
|
this.attachListeners();
|
|
861
863
|
}
|
|
862
864
|
|
|
@@ -892,11 +894,6 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
892
894
|
);
|
|
893
895
|
addBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
894
896
|
|
|
895
|
-
// Add GC data to the summary if it's not written at the root.
|
|
896
|
-
if (!this.writeGCDataAtRoot) {
|
|
897
|
-
addBlobToSummary(summarizeResult, gcBlobKey, JSON.stringify(this.summarizerNode.getGCSummaryDetails()));
|
|
898
|
-
}
|
|
899
|
-
|
|
900
897
|
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
901
898
|
const snapshot = convertSummaryTreeToITree(summarizeResult.summary);
|
|
902
899
|
|
|
@@ -970,32 +967,8 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
970
967
|
* Runtime is created using data store factory that is associated with this context.
|
|
971
968
|
*/
|
|
972
969
|
export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
973
|
-
constructor(
|
|
974
|
-
|
|
975
|
-
pkg: string[] | undefined,
|
|
976
|
-
runtime: ContainerRuntime,
|
|
977
|
-
storage: IDocumentStorageService,
|
|
978
|
-
scope: FluidObject & FluidObject,
|
|
979
|
-
createSummarizerNode: CreateChildSummarizerNodeFn,
|
|
980
|
-
bindChannel: (channel: IFluidDataStoreChannel) => void,
|
|
981
|
-
snapshotTree: ISnapshotTree | undefined,
|
|
982
|
-
isRootDataStore: boolean | undefined,
|
|
983
|
-
/**
|
|
984
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
985
|
-
*/
|
|
986
|
-
createProps?: any,
|
|
987
|
-
) {
|
|
988
|
-
super(
|
|
989
|
-
id,
|
|
990
|
-
pkg,
|
|
991
|
-
runtime,
|
|
992
|
-
storage,
|
|
993
|
-
scope,
|
|
994
|
-
createSummarizerNode,
|
|
995
|
-
bindChannel,
|
|
996
|
-
snapshotTree,
|
|
997
|
-
isRootDataStore,
|
|
998
|
-
createProps);
|
|
970
|
+
constructor(props: ILocalFluidDataStoreContextProps) {
|
|
971
|
+
super(props);
|
|
999
972
|
}
|
|
1000
973
|
}
|
|
1001
974
|
|
|
@@ -1009,27 +982,8 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1009
982
|
extends LocalFluidDataStoreContextBase
|
|
1010
983
|
implements IFluidDataStoreContextDetached
|
|
1011
984
|
{
|
|
1012
|
-
constructor(
|
|
1013
|
-
|
|
1014
|
-
pkg: Readonly<string[]>,
|
|
1015
|
-
runtime: ContainerRuntime,
|
|
1016
|
-
storage: IDocumentStorageService,
|
|
1017
|
-
scope: FluidObject & FluidObject,
|
|
1018
|
-
createSummarizerNode: CreateChildSummarizerNodeFn,
|
|
1019
|
-
bindChannel: (channel: IFluidDataStoreChannel) => void,
|
|
1020
|
-
isRootDataStore: boolean,
|
|
1021
|
-
) {
|
|
1022
|
-
super(
|
|
1023
|
-
id,
|
|
1024
|
-
pkg,
|
|
1025
|
-
runtime,
|
|
1026
|
-
storage,
|
|
1027
|
-
scope,
|
|
1028
|
-
createSummarizerNode,
|
|
1029
|
-
bindChannel,
|
|
1030
|
-
undefined,
|
|
1031
|
-
isRootDataStore,
|
|
1032
|
-
);
|
|
985
|
+
constructor(props: ILocalFluidDataStoreContextProps) {
|
|
986
|
+
super(props);
|
|
1033
987
|
this.detachedRuntimeCreation = true;
|
|
1034
988
|
}
|
|
1035
989
|
|
package/src/dataStores.ts
CHANGED
|
@@ -44,7 +44,7 @@ import { DataStoreContexts } from "./dataStoreContexts";
|
|
|
44
44
|
import { ContainerRuntime } from "./containerRuntime";
|
|
45
45
|
import {
|
|
46
46
|
FluidDataStoreContext,
|
|
47
|
-
|
|
47
|
+
RemoteFluidDataStoreContext,
|
|
48
48
|
LocalFluidDataStoreContext,
|
|
49
49
|
createAttributesBlob,
|
|
50
50
|
LocalDetachedFluidDataStoreContext,
|
|
@@ -117,6 +117,7 @@ export class DataStores implements IDisposable {
|
|
|
117
117
|
getBaseGCDetails: () => Promise<Map<string, IGarbageCollectionDetailsBase>>,
|
|
118
118
|
private readonly dataStoreChanged: (id: string) => void,
|
|
119
119
|
private readonly aliasMap: Map<string, string>,
|
|
120
|
+
private readonly writeGCDataAtRoot: boolean,
|
|
120
121
|
private readonly contexts: DataStoreContexts = new DataStoreContexts(baseLogger),
|
|
121
122
|
) {
|
|
122
123
|
this.logger = ChildLogger.create(baseLogger);
|
|
@@ -150,30 +151,41 @@ export class DataStores implements IDisposable {
|
|
|
150
151
|
}
|
|
151
152
|
// If we have a detached container, then create local data store contexts.
|
|
152
153
|
if (this.runtime.attachState !== AttachState.Detached) {
|
|
153
|
-
dataStoreContext = new
|
|
154
|
-
key,
|
|
155
|
-
value,
|
|
156
|
-
async () => dataStoreBaseGCDetails(key),
|
|
157
|
-
this.runtime,
|
|
158
|
-
this.runtime.storage,
|
|
159
|
-
this.runtime.scope,
|
|
160
|
-
this.getCreateChildSummarizerNodeFn(
|
|
154
|
+
dataStoreContext = new RemoteFluidDataStoreContext({
|
|
155
|
+
id: key,
|
|
156
|
+
snapshotTree: value,
|
|
157
|
+
getBaseGCDetails: async () => dataStoreBaseGCDetails(key),
|
|
158
|
+
runtime: this.runtime,
|
|
159
|
+
storage: this.runtime.storage,
|
|
160
|
+
scope: this.runtime.scope,
|
|
161
|
+
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(
|
|
162
|
+
key,
|
|
163
|
+
{ type: CreateSummarizerNodeSource.FromSummary },
|
|
164
|
+
),
|
|
165
|
+
writeGCDataAtRoot: this.writeGCDataAtRoot,
|
|
166
|
+
disableIsolatedChannels: this.runtime.disableIsolatedChannels,
|
|
167
|
+
});
|
|
161
168
|
} else {
|
|
162
169
|
if (typeof value !== "object") {
|
|
163
170
|
throw new Error("Snapshot should be there to load from!!");
|
|
164
171
|
}
|
|
165
172
|
const snapshotTree = value;
|
|
166
|
-
dataStoreContext = new LocalFluidDataStoreContext(
|
|
167
|
-
key,
|
|
168
|
-
undefined,
|
|
169
|
-
this.runtime,
|
|
170
|
-
this.runtime.storage,
|
|
171
|
-
this.runtime.scope,
|
|
172
|
-
this.getCreateChildSummarizerNodeFn(
|
|
173
|
-
|
|
173
|
+
dataStoreContext = new LocalFluidDataStoreContext({
|
|
174
|
+
id: key,
|
|
175
|
+
pkg: undefined,
|
|
176
|
+
runtime: this.runtime,
|
|
177
|
+
storage: this.runtime.storage,
|
|
178
|
+
scope: this.runtime.scope,
|
|
179
|
+
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(
|
|
180
|
+
key,
|
|
181
|
+
{ type: CreateSummarizerNodeSource.FromSummary },
|
|
182
|
+
),
|
|
183
|
+
bindChannelFn: (cr: IFluidDataStoreChannel) => this.bindFluidDataStore(cr),
|
|
174
184
|
snapshotTree,
|
|
175
|
-
undefined,
|
|
176
|
-
|
|
185
|
+
isRootDataStore: undefined,
|
|
186
|
+
writeGCDataAtRoot: this.writeGCDataAtRoot,
|
|
187
|
+
disableIsolatedChannels: this.runtime.disableIsolatedChannels,
|
|
188
|
+
});
|
|
177
189
|
}
|
|
178
190
|
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
179
191
|
}
|
|
@@ -224,17 +236,17 @@ export class DataStores implements IDisposable {
|
|
|
224
236
|
}
|
|
225
237
|
|
|
226
238
|
// Include the type of attach message which is the pkg of the store to be
|
|
227
|
-
// used by
|
|
239
|
+
// used by RemoteFluidDataStoreContext in case it is not in the snapshot.
|
|
228
240
|
const pkg = [attachMessage.type];
|
|
229
|
-
const
|
|
230
|
-
attachMessage.id,
|
|
241
|
+
const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
|
|
242
|
+
id: attachMessage.id,
|
|
231
243
|
snapshotTree,
|
|
232
244
|
// New data stores begin with empty GC details since GC hasn't run on them yet.
|
|
233
|
-
async () => { return {}; },
|
|
234
|
-
this.runtime,
|
|
235
|
-
new BlobCacheStorageService(this.runtime.storage, flatBlobs),
|
|
236
|
-
this.runtime.scope,
|
|
237
|
-
this.getCreateChildSummarizerNodeFn(
|
|
245
|
+
getBaseGCDetails: async () => { return {}; },
|
|
246
|
+
runtime: this.runtime,
|
|
247
|
+
storage: new BlobCacheStorageService(this.runtime.storage, flatBlobs),
|
|
248
|
+
scope: this.runtime.scope,
|
|
249
|
+
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(
|
|
238
250
|
attachMessage.id,
|
|
239
251
|
{
|
|
240
252
|
type: CreateSummarizerNodeSource.FromAttach,
|
|
@@ -246,10 +258,14 @@ export class DataStores implements IDisposable {
|
|
|
246
258
|
this.runtime.disableIsolatedChannels,
|
|
247
259
|
)],
|
|
248
260
|
},
|
|
249
|
-
}
|
|
250
|
-
|
|
261
|
+
},
|
|
262
|
+
),
|
|
263
|
+
writeGCDataAtRoot: this.writeGCDataAtRoot,
|
|
264
|
+
disableIsolatedChannels: this.runtime.disableIsolatedChannels,
|
|
265
|
+
pkg,
|
|
266
|
+
});
|
|
251
267
|
|
|
252
|
-
this.contexts.addBoundOrRemoted(
|
|
268
|
+
this.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);
|
|
253
269
|
}
|
|
254
270
|
|
|
255
271
|
public processAliasMessage(
|
|
@@ -322,33 +338,44 @@ export class DataStores implements IDisposable {
|
|
|
322
338
|
isRoot: boolean,
|
|
323
339
|
id = uuid()): IFluidDataStoreContextDetached
|
|
324
340
|
{
|
|
325
|
-
const context = new LocalDetachedFluidDataStoreContext(
|
|
341
|
+
const context = new LocalDetachedFluidDataStoreContext({
|
|
326
342
|
id,
|
|
327
343
|
pkg,
|
|
328
|
-
this.runtime,
|
|
329
|
-
this.runtime.storage,
|
|
330
|
-
this.runtime.scope,
|
|
331
|
-
this.getCreateChildSummarizerNodeFn(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
344
|
+
runtime: this.runtime,
|
|
345
|
+
storage: this.runtime.storage,
|
|
346
|
+
scope: this.runtime.scope,
|
|
347
|
+
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(
|
|
348
|
+
id,
|
|
349
|
+
{ type: CreateSummarizerNodeSource.Local },
|
|
350
|
+
),
|
|
351
|
+
bindChannelFn: (cr: IFluidDataStoreChannel) => this.bindFluidDataStore(cr),
|
|
352
|
+
snapshotTree: undefined,
|
|
353
|
+
isRootDataStore: isRoot,
|
|
354
|
+
writeGCDataAtRoot: this.writeGCDataAtRoot,
|
|
355
|
+
disableIsolatedChannels: this.runtime.disableIsolatedChannels,
|
|
356
|
+
});
|
|
335
357
|
this.contexts.addUnbound(context);
|
|
336
358
|
return context;
|
|
337
359
|
}
|
|
338
360
|
|
|
339
361
|
public _createFluidDataStoreContext(pkg: string[], id: string, isRoot: boolean, props?: any) {
|
|
340
|
-
const context = new LocalFluidDataStoreContext(
|
|
362
|
+
const context = new LocalFluidDataStoreContext({
|
|
341
363
|
id,
|
|
342
364
|
pkg,
|
|
343
|
-
this.runtime,
|
|
344
|
-
this.runtime.storage,
|
|
345
|
-
this.runtime.scope,
|
|
346
|
-
this.getCreateChildSummarizerNodeFn(
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
365
|
+
runtime: this.runtime,
|
|
366
|
+
storage: this.runtime.storage,
|
|
367
|
+
scope: this.runtime.scope,
|
|
368
|
+
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(
|
|
369
|
+
id,
|
|
370
|
+
{ type: CreateSummarizerNodeSource.Local },
|
|
371
|
+
),
|
|
372
|
+
bindChannelFn: (cr: IFluidDataStoreChannel) => this.bindFluidDataStore(cr),
|
|
373
|
+
snapshotTree: undefined,
|
|
374
|
+
isRootDataStore: isRoot,
|
|
375
|
+
writeGCDataAtRoot: this.writeGCDataAtRoot,
|
|
376
|
+
disableIsolatedChannels: this.runtime.disableIsolatedChannels,
|
|
377
|
+
createProps: props,
|
|
378
|
+
});
|
|
352
379
|
this.contexts.addUnbound(context);
|
|
353
380
|
return context;
|
|
354
381
|
}
|