@fluidframework/container-runtime 0.54.2 → 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/.eslintrc.js +1 -1
- package/dist/blobManager.js +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +20 -14
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +51 -58
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStoreContext.d.ts +57 -33
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +44 -54
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStores.d.ts +12 -2
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +106 -32
- package/dist/dataStores.js.map +1 -1
- package/dist/garbageCollection.d.ts +49 -14
- package/dist/garbageCollection.d.ts.map +1 -1
- package/dist/garbageCollection.js +122 -26
- package/dist/garbageCollection.js.map +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -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 +2 -0
- package/dist/summaryFormat.d.ts.map +1 -1
- package/dist/summaryFormat.js +2 -4
- 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/dist/summaryManager.d.ts +1 -0
- package/dist/summaryManager.d.ts.map +1 -1
- package/dist/summaryManager.js +7 -2
- package/dist/summaryManager.js.map +1 -1
- package/garbageCollection.md +33 -0
- package/lib/blobManager.js +1 -1
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +20 -14
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +51 -58
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStoreContext.d.ts +57 -33
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +42 -52
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStores.d.ts +12 -2
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +107 -33
- package/lib/dataStores.js.map +1 -1
- package/lib/garbageCollection.d.ts +49 -14
- package/lib/garbageCollection.d.ts.map +1 -1
- package/lib/garbageCollection.js +122 -26
- package/lib/garbageCollection.js.map +1 -1
- package/lib/index.d.ts +7 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +6 -7
- 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 +2 -0
- package/lib/summaryFormat.d.ts.map +1 -1
- package/lib/summaryFormat.js +2 -4
- 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/lib/summaryManager.d.ts +1 -0
- package/lib/summaryManager.d.ts.map +1 -1
- package/lib/summaryManager.js +7 -2
- package/lib/summaryManager.js.map +1 -1
- package/package.json +24 -23
- package/src/blobManager.ts +1 -1
- package/src/containerRuntime.ts +69 -65
- package/src/dataStoreContext.ts +105 -129
- package/src/dataStores.ts +118 -68
- package/src/garbageCollection.ts +156 -31
- package/src/index.ts +52 -6
- package/src/packageVersion.ts +1 -1
- package/src/runningSummarizer.ts +2 -7
- package/src/summaryFormat.ts +4 -4
- package/src/summaryGenerator.ts +0 -5
- package/src/summaryManager.ts +9 -3
|
@@ -4,12 +4,12 @@
|
|
|
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";
|
|
11
11
|
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
12
|
-
import { CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IAttachMessage, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreContextEvents, IFluidDataStoreRegistry, IGarbageCollectionData, IGarbageCollectionSummaryDetails, IInboundSignalMessage, IProvideFluidDataStoreFactory, ISummarizeResult, ISummarizerNodeWithGC, SummarizeInternalFn } from "@fluidframework/runtime-definitions";
|
|
12
|
+
import { CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IAttachMessage, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreContextEvents, IFluidDataStoreRegistry, IGarbageCollectionData, IGarbageCollectionDetailsBase, IGarbageCollectionSummaryDetails, IInboundSignalMessage, IProvideFluidDataStoreFactory, ISummarizeResult, ISummarizerNodeWithGC, SummarizeInternalFn } from "@fluidframework/runtime-definitions";
|
|
13
13
|
import { ContainerRuntime } from "./containerRuntime";
|
|
14
14
|
export declare function createAttributesBlob(pkg: readonly string[], isRootDataStore: boolean, disableIsolatedChannels: boolean): ITreeEntry;
|
|
15
15
|
interface ISnapshotDetails {
|
|
@@ -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;
|
|
@@ -162,22 +187,29 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
162
187
|
* It will be removed, as the source of truth for this flag will be the aliasing blob.
|
|
163
188
|
*/
|
|
164
189
|
abstract setRoot(): void;
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated - Renamed to getBaseGCDetails().
|
|
192
|
+
*/
|
|
165
193
|
abstract getInitialGCSummaryDetails(): Promise<IGarbageCollectionSummaryDetails>;
|
|
194
|
+
abstract getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
166
195
|
reSubmit(contents: any, localOpMetadata: unknown): void;
|
|
167
196
|
applyStashedOp(contents: any): Promise<unknown>;
|
|
168
197
|
private verifyNotClosed;
|
|
169
|
-
getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean | undefined) => Promise<IGarbageCollectionData>,
|
|
198
|
+
getCreateChildSummarizerNodeFn(id: string, createParam: CreateChildSummarizerNodeParam): (summarizeInternal: SummarizeInternalFn, getGCDataFn: (fullGC?: boolean | undefined) => Promise<IGarbageCollectionData>, getBaseGCDetailsFn: () => Promise<IGarbageCollectionDetailsBase>) => ISummarizerNodeWithGC;
|
|
170
199
|
uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
171
200
|
}
|
|
172
|
-
export declare class
|
|
173
|
-
private readonly initSnapshotValue;
|
|
174
|
-
private readonly getBaseSummaryGCDetails;
|
|
201
|
+
export declare class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
175
202
|
private isRootDataStore;
|
|
176
|
-
|
|
203
|
+
private readonly initSnapshotValue;
|
|
204
|
+
private readonly baseGCDetailsP;
|
|
205
|
+
constructor(props: IRemoteFluidDataStoreContextProps);
|
|
177
206
|
private readonly initialSnapshotDetailsP;
|
|
178
|
-
private readonly gcDetailsInInitialSummaryP;
|
|
179
207
|
protected getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
208
|
+
/**
|
|
209
|
+
* @deprecated - Renamed to getBaseGCDetails.
|
|
210
|
+
*/
|
|
180
211
|
getInitialGCSummaryDetails(): Promise<IGarbageCollectionSummaryDetails>;
|
|
212
|
+
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
181
213
|
generateAttachMessage(): IAttachMessage;
|
|
182
214
|
/**
|
|
183
215
|
* @deprecated - Sets the datastore as root, for aliasing purposes: #7948
|
|
@@ -192,19 +224,15 @@ export declare class RemotedFluidDataStoreContext extends FluidDataStoreContext
|
|
|
192
224
|
export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
193
225
|
private readonly snapshotTree;
|
|
194
226
|
protected isRootDataStore: boolean | undefined;
|
|
195
|
-
|
|
196
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
197
|
-
*/
|
|
198
|
-
readonly createProps?: any;
|
|
199
|
-
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,
|
|
200
|
-
/**
|
|
201
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
202
|
-
*/
|
|
203
|
-
createProps?: any);
|
|
227
|
+
constructor(props: ILocalFluidDataStoreContextProps);
|
|
204
228
|
private attachListeners;
|
|
205
229
|
generateAttachMessage(): IAttachMessage;
|
|
206
230
|
protected getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
231
|
+
/**
|
|
232
|
+
* @deprecated - Renamed to getBaseGCDetails.
|
|
233
|
+
*/
|
|
207
234
|
getInitialGCSummaryDetails(): Promise<IGarbageCollectionSummaryDetails>;
|
|
235
|
+
getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;
|
|
208
236
|
/**
|
|
209
237
|
* @deprecated - Sets the datastore as root, for aliasing purposes: #7948
|
|
210
238
|
* This method should not be used outside of the aliasing context.
|
|
@@ -219,11 +247,7 @@ export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContex
|
|
|
219
247
|
* Runtime is created using data store factory that is associated with this context.
|
|
220
248
|
*/
|
|
221
249
|
export declare class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
222
|
-
constructor(
|
|
223
|
-
/**
|
|
224
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
225
|
-
*/
|
|
226
|
-
createProps?: any);
|
|
250
|
+
constructor(props: ILocalFluidDataStoreContextProps);
|
|
227
251
|
}
|
|
228
252
|
/**
|
|
229
253
|
* Detached context. Data Store runtime will be attached to it by attachRuntime() call
|
|
@@ -232,7 +256,7 @@ export declare class LocalFluidDataStoreContext extends LocalFluidDataStoreConte
|
|
|
232
256
|
* Attachment process provides all missing parts - package path, data store runtime, and data store factory
|
|
233
257
|
*/
|
|
234
258
|
export declare class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase implements IFluidDataStoreContextDetached {
|
|
235
|
-
constructor(
|
|
259
|
+
constructor(props: ILocalFluidDataStoreContextProps);
|
|
236
260
|
attachRuntime(registry: IProvideFluidDataStoreFactory, dataStoreRuntime: IFluidDataStoreChannel): Promise<void>;
|
|
237
261
|
protected getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
238
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,4BAA4B,EAC5B,uBAAuB,EACvB,sBAAsB,EACtB,6BAA6B,EAC7B,gCAAgC,EAChC,qBAAqB,EACrB,6BAA6B,EAE7B,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACtB,MAA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B,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) {
|
|
@@ -447,22 +438,20 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
447
438
|
}
|
|
448
439
|
}
|
|
449
440
|
getCreateChildSummarizerNodeFn(id, createParam) {
|
|
450
|
-
return (summarizeInternal, getGCDataFn,
|
|
441
|
+
return (summarizeInternal, getGCDataFn, getBaseGCDetailsFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam,
|
|
451
442
|
// DDS will not create failure summaries
|
|
452
|
-
{ throwOnFailure: true }, getGCDataFn,
|
|
443
|
+
{ throwOnFailure: true }, getGCDataFn, getBaseGCDetailsFn);
|
|
453
444
|
}
|
|
454
445
|
async uploadBlob(blob) {
|
|
455
446
|
return this.containerRuntime.uploadBlob(blob);
|
|
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;
|
|
465
|
-
this.getBaseSummaryGCDetails = getBaseSummaryGCDetails;
|
|
454
|
+
});
|
|
466
455
|
this.initialSnapshotDetailsP = new LazyPromise(async () => {
|
|
467
456
|
var _a, _b;
|
|
468
457
|
let tree;
|
|
@@ -519,16 +508,23 @@ export class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
519
508
|
isRootDataStore,
|
|
520
509
|
};
|
|
521
510
|
});
|
|
522
|
-
this.
|
|
511
|
+
this.initSnapshotValue = props.snapshotTree;
|
|
512
|
+
this.baseGCDetailsP = new LazyPromise(async () => {
|
|
523
513
|
var _a;
|
|
524
|
-
return (_a = (await
|
|
514
|
+
return (_a = (await props.getBaseGCDetails())) !== null && _a !== void 0 ? _a : {};
|
|
525
515
|
});
|
|
526
516
|
}
|
|
527
517
|
async getInitialSnapshotDetails() {
|
|
528
518
|
return this.initialSnapshotDetailsP;
|
|
529
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* @deprecated - Renamed to getBaseGCDetails.
|
|
522
|
+
*/
|
|
530
523
|
async getInitialGCSummaryDetails() {
|
|
531
|
-
return this.
|
|
524
|
+
return this.getBaseGCDetails();
|
|
525
|
+
}
|
|
526
|
+
async getBaseGCDetails() {
|
|
527
|
+
return this.baseGCDetailsP;
|
|
532
528
|
}
|
|
533
529
|
generateAttachMessage() {
|
|
534
530
|
throw new Error("Cannot attach remote store");
|
|
@@ -546,15 +542,10 @@ export class RemotedFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
546
542
|
* Base class for detached & attached context classes
|
|
547
543
|
*/
|
|
548
544
|
export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
549
|
-
constructor(
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
createProps) {
|
|
554
|
-
super(runtime, id, snapshotTree !== undefined ? true : false, storage, scope, createSummarizerNode, snapshotTree ? BindState.Bound : BindState.NotBound, true, bindChannel, pkg);
|
|
555
|
-
this.snapshotTree = snapshotTree;
|
|
556
|
-
this.isRootDataStore = isRootDataStore;
|
|
557
|
-
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;
|
|
558
549
|
this.attachListeners();
|
|
559
550
|
}
|
|
560
551
|
attachListeners() {
|
|
@@ -579,10 +570,6 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
579
570
|
// Add data store's attributes to the summary.
|
|
580
571
|
const attributes = createAttributes(this.pkg, this.isRootDataStore, this.disableIsolatedChannels);
|
|
581
572
|
addBlobToSummary(summarizeResult, dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
582
|
-
// Add GC data to the summary if it's not written at the root.
|
|
583
|
-
if (!this.writeGCDataAtRoot) {
|
|
584
|
-
addBlobToSummary(summarizeResult, gcBlobKey, JSON.stringify(this.summarizerNode.getGCSummaryDetails()));
|
|
585
|
-
}
|
|
586
573
|
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
587
574
|
const snapshot = convertSummaryTreeToITree(summarizeResult.summary);
|
|
588
575
|
const message = {
|
|
@@ -620,10 +607,17 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
620
607
|
isRootDataStore: this.isRootDataStore,
|
|
621
608
|
};
|
|
622
609
|
}
|
|
610
|
+
/**
|
|
611
|
+
* @deprecated - Renamed to getBaseGCDetails.
|
|
612
|
+
*/
|
|
623
613
|
async getInitialGCSummaryDetails() {
|
|
624
614
|
// Local data store does not have initial summary.
|
|
625
615
|
return {};
|
|
626
616
|
}
|
|
617
|
+
async getBaseGCDetails() {
|
|
618
|
+
// Local data store does not have initial summary.
|
|
619
|
+
return {};
|
|
620
|
+
}
|
|
627
621
|
/**
|
|
628
622
|
* @deprecated - Sets the datastore as root, for aliasing purposes: #7948
|
|
629
623
|
* This method should not be used outside of the aliasing context.
|
|
@@ -640,12 +634,8 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
640
634
|
* Runtime is created using data store factory that is associated with this context.
|
|
641
635
|
*/
|
|
642
636
|
export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
643
|
-
constructor(
|
|
644
|
-
|
|
645
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
646
|
-
*/
|
|
647
|
-
createProps) {
|
|
648
|
-
super(id, pkg, runtime, storage, scope, createSummarizerNode, bindChannel, snapshotTree, isRootDataStore, createProps);
|
|
637
|
+
constructor(props) {
|
|
638
|
+
super(props);
|
|
649
639
|
}
|
|
650
640
|
}
|
|
651
641
|
/**
|
|
@@ -655,8 +645,8 @@ export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
|
655
645
|
* Attachment process provides all missing parts - package path, data store runtime, and data store factory
|
|
656
646
|
*/
|
|
657
647
|
export class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
658
|
-
constructor(
|
|
659
|
-
super(
|
|
648
|
+
constructor(props) {
|
|
649
|
+
super(props);
|
|
660
650
|
this.detachedRuntimeCreation = true;
|
|
661
651
|
}
|
|
662
652
|
async attachRuntime(registry, dataStoreRuntime) {
|