@fluidframework/container-runtime 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.225277
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 +19 -29
- package/.mocharc.js +12 -0
- package/CHANGELOG.md +427 -0
- package/README.md +69 -0
- package/api-extractor-esm.json +4 -0
- package/api-extractor-lint.json +4 -0
- package/api-extractor.json +2 -2
- package/api-report/container-runtime.api.md +863 -0
- package/dist/{batchTracker.js → batchTracker.cjs} +9 -8
- package/dist/batchTracker.cjs.map +1 -0
- package/dist/batchTracker.d.ts +6 -5
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/blobManager.cjs +709 -0
- package/dist/blobManager.cjs.map +1 -0
- package/dist/blobManager.d.ts +140 -39
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/connectionTelemetry.cjs +230 -0
- package/dist/connectionTelemetry.cjs.map +1 -0
- package/dist/connectionTelemetry.d.ts +2 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1690 -0
- package/dist/container-runtime-beta.d.ts +250 -0
- package/dist/container-runtime-public.d.ts +250 -0
- package/dist/container-runtime-untrimmed.d.ts +1805 -0
- package/dist/{containerHandleContext.js → containerHandleContext.cjs} +4 -2
- package/dist/containerHandleContext.cjs.map +1 -0
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerRuntime.cjs +2535 -0
- package/dist/containerRuntime.cjs.map +1 -0
- package/dist/containerRuntime.d.ts +458 -256
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/{dataStore.js → dataStore.cjs} +54 -45
- package/dist/dataStore.cjs.map +1 -0
- package/dist/dataStore.d.ts +2 -2
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/{dataStoreContext.js → dataStoreContext.cjs} +343 -247
- package/dist/dataStoreContext.cjs.map +1 -0
- package/dist/dataStoreContext.d.ts +73 -41
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/{dataStoreContexts.js → dataStoreContexts.cjs} +19 -15
- package/dist/dataStoreContexts.cjs.map +1 -0
- package/dist/dataStoreContexts.d.ts +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/{dataStoreRegistry.js → dataStoreRegistry.cjs} +9 -4
- package/dist/dataStoreRegistry.cjs.map +1 -0
- package/dist/dataStoreRegistry.d.ts +3 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/{dataStores.js → dataStores.cjs} +276 -124
- package/dist/dataStores.cjs.map +1 -0
- package/dist/dataStores.d.ts +56 -23
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/deltaManagerProxyBase.cjs +77 -0
- package/dist/deltaManagerProxyBase.cjs.map +1 -0
- package/dist/deltaManagerProxyBase.d.ts +35 -0
- package/dist/deltaManagerProxyBase.d.ts.map +1 -0
- package/dist/deltaManagerSummarizerProxy.cjs +42 -0
- package/dist/deltaManagerSummarizerProxy.cjs.map +1 -0
- package/dist/deltaManagerSummarizerProxy.d.ts +19 -0
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/dist/{deltaScheduler.js → deltaScheduler.cjs} +25 -18
- package/dist/deltaScheduler.cjs.map +1 -0
- package/dist/deltaScheduler.d.ts +8 -6
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/error.cjs +21 -0
- package/dist/error.cjs.map +1 -0
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/gc/garbageCollection.cjs +865 -0
- package/dist/gc/garbageCollection.cjs.map +1 -0
- package/dist/gc/garbageCollection.d.ts +224 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -0
- package/dist/gc/gcConfigs.cjs +160 -0
- package/dist/gc/gcConfigs.cjs.map +1 -0
- package/dist/gc/gcConfigs.d.ts +23 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -0
- package/dist/gc/gcDefinitions.cjs +96 -0
- package/dist/gc/gcDefinitions.cjs.map +1 -0
- package/dist/gc/gcDefinitions.d.ts +458 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -0
- package/dist/gc/gcHelpers.cjs +235 -0
- package/dist/gc/gcHelpers.cjs.map +1 -0
- package/dist/gc/gcHelpers.d.ts +71 -0
- package/dist/gc/gcHelpers.d.ts.map +1 -0
- package/dist/gc/gcReferenceGraphAlgorithm.cjs +49 -0
- package/dist/gc/gcReferenceGraphAlgorithm.cjs.map +1 -0
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/dist/{summarizerTypes.js → gc/gcSummaryDefinitions.cjs} +1 -6
- package/dist/gc/gcSummaryDefinitions.cjs.map +1 -0
- package/dist/gc/gcSummaryDefinitions.d.ts +52 -0
- package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/dist/gc/gcSummaryStateTracker.cjs +213 -0
- package/dist/gc/gcSummaryStateTracker.cjs.map +1 -0
- package/dist/gc/gcSummaryStateTracker.d.ts +94 -0
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/dist/gc/gcTelemetry.cjs +307 -0
- package/dist/gc/gcTelemetry.cjs.map +1 -0
- package/dist/gc/gcTelemetry.d.ts +99 -0
- package/dist/gc/gcTelemetry.d.ts.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.cjs +118 -0
- package/dist/gc/gcUnreferencedStateTracker.cjs.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts +40 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/dist/gc/index.cjs +44 -0
- package/dist/gc/index.cjs.map +1 -0
- package/dist/gc/index.d.ts +13 -0
- package/dist/gc/index.d.ts.map +1 -0
- package/dist/index.cjs +47 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +19 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/messageTypes.cjs +37 -0
- package/dist/messageTypes.cjs.map +1 -0
- package/dist/messageTypes.d.ts +142 -0
- package/dist/messageTypes.d.ts.map +1 -0
- package/dist/metadata.cjs +7 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.ts +24 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/opLifecycle/batchManager.cjs +139 -0
- package/dist/opLifecycle/batchManager.cjs.map +1 -0
- package/dist/opLifecycle/batchManager.d.ts +48 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -0
- package/dist/opLifecycle/definitions.cjs +7 -0
- package/dist/opLifecycle/definitions.cjs.map +1 -0
- package/dist/opLifecycle/definitions.d.ts +83 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -0
- package/dist/opLifecycle/index.cjs +26 -0
- package/dist/opLifecycle/index.cjs.map +1 -0
- package/dist/opLifecycle/index.d.ts +13 -0
- package/dist/opLifecycle/index.d.ts.map +1 -0
- package/dist/opLifecycle/opCompressor.cjs +84 -0
- package/dist/opLifecycle/opCompressor.cjs.map +1 -0
- package/dist/opLifecycle/opCompressor.d.ts +18 -0
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -0
- package/dist/opLifecycle/opDecompressor.cjs +132 -0
- package/dist/opLifecycle/opDecompressor.cjs.map +1 -0
- package/dist/opLifecycle/opDecompressor.d.ts +25 -0
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -0
- package/dist/opLifecycle/opGroupingManager.cjs +95 -0
- package/dist/opLifecycle/opGroupingManager.cjs.map +1 -0
- package/dist/opLifecycle/opGroupingManager.d.ts +22 -0
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -0
- package/dist/opLifecycle/opSplitter.cjs +202 -0
- package/dist/opLifecycle/opSplitter.cjs.map +1 -0
- package/dist/opLifecycle/opSplitter.d.ts +61 -0
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -0
- package/dist/opLifecycle/outbox.cjs +326 -0
- package/dist/opLifecycle/outbox.cjs.map +1 -0
- package/dist/opLifecycle/outbox.d.ts +104 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -0
- package/dist/opLifecycle/remoteMessageProcessor.cjs +136 -0
- package/dist/opLifecycle/remoteMessageProcessor.cjs.map +1 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +47 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -0
- package/dist/opProperties.cjs +17 -0
- package/dist/opProperties.cjs.map +1 -0
- package/dist/opProperties.d.ts +7 -0
- package/dist/opProperties.d.ts.map +1 -0
- package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
- package/dist/packageVersion.cjs.map +1 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.d.ts.map +1 -1
- package/dist/pendingStateManager.cjs +282 -0
- package/dist/pendingStateManager.cjs.map +1 -0
- package/dist/pendingStateManager.d.ts +32 -69
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/scheduleManager.cjs +258 -0
- package/dist/scheduleManager.cjs.map +1 -0
- package/dist/scheduleManager.d.ts +31 -0
- package/dist/scheduleManager.d.ts.map +1 -0
- package/dist/storageServiceWithAttachBlobs.cjs +32 -0
- package/dist/storageServiceWithAttachBlobs.cjs.map +1 -0
- package/dist/storageServiceWithAttachBlobs.d.ts +17 -0
- package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/dist/summary/index.cjs +51 -0
- package/dist/summary/index.cjs.map +1 -0
- package/dist/summary/index.d.ts +17 -0
- package/dist/summary/index.d.ts.map +1 -0
- package/dist/{orderedClientElection.js → summary/orderedClientElection.cjs} +100 -84
- package/dist/summary/orderedClientElection.cjs.map +1 -0
- package/{lib → dist/summary}/orderedClientElection.d.ts +41 -18
- package/dist/summary/orderedClientElection.d.ts.map +1 -0
- package/dist/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.cjs} +12 -10
- package/dist/summary/runWhileConnectedCoordinator.cjs.map +1 -0
- package/{lib → dist/summary}/runWhileConnectedCoordinator.d.ts +8 -2
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/dist/summary/runningSummarizer.cjs +679 -0
- package/dist/summary/runningSummarizer.cjs.map +1 -0
- package/dist/summary/runningSummarizer.d.ts +128 -0
- package/dist/summary/runningSummarizer.d.ts.map +1 -0
- package/dist/summary/summarizer.cjs +263 -0
- package/dist/summary/summarizer.cjs.map +1 -0
- package/dist/{summarizer.d.ts → summary/summarizer.d.ts} +18 -33
- package/dist/summary/summarizer.d.ts.map +1 -0
- package/dist/{summarizerClientElection.js → summary/summarizerClientElection.cjs} +15 -46
- package/dist/summary/summarizerClientElection.cjs.map +1 -0
- package/{lib → dist/summary}/summarizerClientElection.d.ts +4 -4
- package/dist/summary/summarizerClientElection.d.ts.map +1 -0
- package/dist/summary/summarizerHeuristics.cjs +156 -0
- package/dist/summary/summarizerHeuristics.cjs.map +1 -0
- package/{lib → dist/summary}/summarizerHeuristics.d.ts +28 -6
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -0
- package/dist/summary/summarizerNode/index.cjs +12 -0
- package/dist/summary/summarizerNode/index.cjs.map +1 -0
- package/dist/summary/summarizerNode/index.d.ts +8 -0
- package/dist/summary/summarizerNode/index.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNode.cjs +526 -0
- package/dist/summary/summarizerNode/summarizerNode.cjs.map +1 -0
- package/dist/summary/summarizerNode/summarizerNode.d.ts +167 -0
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.cjs +130 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.cjs.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +121 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.cjs +375 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.cjs.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +153 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/dist/summary/summarizerTypes.cjs +7 -0
- package/dist/summary/summarizerTypes.cjs.map +1 -0
- package/{lib → dist/summary}/summarizerTypes.d.ts +233 -83
- package/dist/summary/summarizerTypes.d.ts.map +1 -0
- package/dist/{summaryCollection.js → summary/summaryCollection.cjs} +80 -49
- package/dist/summary/summaryCollection.cjs.map +1 -0
- package/dist/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +23 -5
- package/dist/summary/summaryCollection.d.ts.map +1 -0
- package/dist/{summaryFormat.js → summary/summaryFormat.cjs} +29 -26
- package/dist/summary/summaryFormat.cjs.map +1 -0
- package/{lib → dist/summary}/summaryFormat.d.ts +25 -30
- package/dist/summary/summaryFormat.d.ts.map +1 -0
- package/dist/{summaryGenerator.js → summary/summaryGenerator.cjs} +162 -74
- package/dist/summary/summaryGenerator.cjs.map +1 -0
- package/dist/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +53 -11
- package/dist/summary/summaryGenerator.d.ts.map +1 -0
- package/dist/{summaryManager.js → summary/summaryManager.cjs} +98 -55
- package/dist/summary/summaryManager.cjs.map +1 -0
- package/{lib → dist/summary}/summaryManager.d.ts +13 -11
- package/dist/summary/summaryManager.d.ts.map +1 -0
- package/dist/{throttler.js → throttler.cjs} +21 -21
- package/dist/throttler.cjs.map +1 -0
- package/dist/throttler.d.ts +2 -2
- package/dist/throttler.d.ts.map +1 -1
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/{batchTracker.d.ts → batchTracker.d.mts} +7 -6
- package/lib/batchTracker.d.mts.map +1 -0
- package/lib/{batchTracker.js → batchTracker.mjs} +9 -8
- package/lib/batchTracker.mjs.map +1 -0
- package/lib/blobManager.d.mts +196 -0
- package/lib/blobManager.d.mts.map +1 -0
- package/lib/blobManager.mjs +704 -0
- package/lib/blobManager.mjs.map +1 -0
- package/lib/{connectionTelemetry.d.ts → connectionTelemetry.d.mts} +3 -3
- package/lib/connectionTelemetry.d.mts.map +1 -0
- package/lib/connectionTelemetry.mjs +226 -0
- package/lib/connectionTelemetry.mjs.map +1 -0
- package/lib/container-runtime-alpha.d.mts +1690 -0
- package/lib/container-runtime-beta.d.mts +250 -0
- package/lib/container-runtime-public.d.mts +250 -0
- package/lib/container-runtime-untrimmed.d.mts +1805 -0
- package/lib/{containerHandleContext.d.ts → containerHandleContext.d.mts} +2 -2
- package/lib/containerHandleContext.d.mts.map +1 -0
- package/lib/{containerHandleContext.js → containerHandleContext.mjs} +4 -2
- package/lib/containerHandleContext.mjs.map +1 -0
- package/lib/containerRuntime.d.mts +813 -0
- package/lib/containerRuntime.d.mts.map +1 -0
- package/lib/containerRuntime.mjs +2530 -0
- package/lib/containerRuntime.mjs.map +1 -0
- package/lib/{dataStore.d.ts → dataStore.d.mts} +5 -5
- package/lib/dataStore.d.mts.map +1 -0
- package/lib/{dataStore.js → dataStore.mjs} +52 -43
- package/lib/dataStore.mjs.map +1 -0
- package/lib/{dataStoreContext.d.ts → dataStoreContext.d.mts} +75 -43
- package/lib/dataStoreContext.d.mts.map +1 -0
- package/lib/{dataStoreContext.js → dataStoreContext.mjs} +309 -213
- package/lib/dataStoreContext.mjs.map +1 -0
- package/lib/{dataStoreContexts.d.ts → dataStoreContexts.d.mts} +3 -3
- package/lib/dataStoreContexts.d.mts.map +1 -0
- package/lib/{dataStoreContexts.js → dataStoreContexts.mjs} +12 -8
- package/lib/dataStoreContexts.mjs.map +1 -0
- package/lib/{dataStoreRegistry.d.ts → dataStoreRegistry.d.mts} +4 -1
- package/lib/dataStoreRegistry.d.mts.map +1 -0
- package/lib/{dataStoreRegistry.js → dataStoreRegistry.mjs} +7 -6
- package/lib/dataStoreRegistry.mjs.map +1 -0
- package/lib/{dataStores.d.ts → dataStores.d.mts} +60 -27
- package/lib/dataStores.d.mts.map +1 -0
- package/lib/{dataStores.js → dataStores.mjs} +257 -105
- package/lib/dataStores.mjs.map +1 -0
- package/lib/deltaManagerProxyBase.d.mts +35 -0
- package/lib/deltaManagerProxyBase.d.mts.map +1 -0
- package/lib/deltaManagerProxyBase.mjs +73 -0
- package/lib/deltaManagerProxyBase.mjs.map +1 -0
- package/lib/deltaManagerSummarizerProxy.d.mts +19 -0
- package/lib/deltaManagerSummarizerProxy.d.mts.map +1 -0
- package/lib/deltaManagerSummarizerProxy.mjs +38 -0
- package/lib/deltaManagerSummarizerProxy.mjs.map +1 -0
- package/lib/{deltaScheduler.d.ts → deltaScheduler.d.mts} +9 -7
- package/lib/deltaScheduler.d.mts.map +1 -0
- package/lib/{deltaScheduler.js → deltaScheduler.mjs} +22 -15
- package/lib/deltaScheduler.mjs.map +1 -0
- package/lib/error.d.mts +14 -0
- package/lib/error.d.mts.map +1 -0
- package/lib/error.mjs +17 -0
- package/lib/error.mjs.map +1 -0
- package/lib/gc/garbageCollection.d.mts +224 -0
- package/lib/gc/garbageCollection.d.mts.map +1 -0
- package/lib/gc/garbageCollection.mjs +861 -0
- package/lib/gc/garbageCollection.mjs.map +1 -0
- package/lib/gc/gcConfigs.d.mts +23 -0
- package/lib/gc/gcConfigs.d.mts.map +1 -0
- package/lib/gc/gcConfigs.mjs +156 -0
- package/lib/gc/gcConfigs.mjs.map +1 -0
- package/lib/gc/gcDefinitions.d.mts +458 -0
- package/lib/gc/gcDefinitions.d.mts.map +1 -0
- package/lib/gc/gcDefinitions.mjs +93 -0
- package/lib/gc/gcDefinitions.mjs.map +1 -0
- package/lib/gc/gcHelpers.d.mts +71 -0
- package/lib/gc/gcHelpers.d.mts.map +1 -0
- package/lib/gc/gcHelpers.mjs +222 -0
- package/lib/gc/gcHelpers.mjs.map +1 -0
- package/lib/gc/gcReferenceGraphAlgorithm.d.mts +16 -0
- package/lib/gc/gcReferenceGraphAlgorithm.d.mts.map +1 -0
- package/lib/gc/gcReferenceGraphAlgorithm.mjs +45 -0
- package/lib/gc/gcReferenceGraphAlgorithm.mjs.map +1 -0
- package/lib/gc/gcSummaryDefinitions.d.mts +52 -0
- package/lib/gc/gcSummaryDefinitions.d.mts.map +1 -0
- package/lib/gc/gcSummaryDefinitions.mjs +6 -0
- package/lib/gc/gcSummaryDefinitions.mjs.map +1 -0
- package/lib/gc/gcSummaryStateTracker.d.mts +94 -0
- package/lib/gc/gcSummaryStateTracker.d.mts.map +1 -0
- package/lib/gc/gcSummaryStateTracker.mjs +209 -0
- package/lib/gc/gcSummaryStateTracker.mjs.map +1 -0
- package/lib/gc/gcTelemetry.d.mts +99 -0
- package/lib/gc/gcTelemetry.d.mts.map +1 -0
- package/lib/gc/gcTelemetry.mjs +302 -0
- package/lib/gc/gcTelemetry.mjs.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.d.mts +40 -0
- package/lib/gc/gcUnreferencedStateTracker.d.mts.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.mjs +114 -0
- package/lib/gc/gcUnreferencedStateTracker.mjs.map +1 -0
- package/lib/gc/index.d.mts +13 -0
- package/lib/gc/index.d.mts.map +1 -0
- package/lib/gc/index.mjs +12 -0
- package/lib/gc/index.mjs.map +1 -0
- package/lib/index.d.mts +25 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +24 -0
- package/lib/index.mjs.map +1 -0
- package/lib/messageTypes.d.mts +142 -0
- package/lib/messageTypes.d.mts.map +1 -0
- package/lib/messageTypes.mjs +34 -0
- package/lib/messageTypes.mjs.map +1 -0
- package/lib/metadata.d.mts +24 -0
- package/lib/metadata.d.mts.map +1 -0
- package/lib/metadata.mjs +6 -0
- package/lib/metadata.mjs.map +1 -0
- package/lib/opLifecycle/batchManager.d.mts +48 -0
- package/lib/opLifecycle/batchManager.d.mts.map +1 -0
- package/lib/opLifecycle/batchManager.mjs +133 -0
- package/lib/opLifecycle/batchManager.mjs.map +1 -0
- package/lib/opLifecycle/definitions.d.mts +83 -0
- package/lib/opLifecycle/definitions.d.mts.map +1 -0
- package/lib/opLifecycle/definitions.mjs +6 -0
- package/lib/opLifecycle/definitions.mjs.map +1 -0
- package/lib/opLifecycle/index.d.mts +13 -0
- package/lib/opLifecycle/index.d.mts.map +1 -0
- package/lib/opLifecycle/index.mjs +12 -0
- package/lib/opLifecycle/index.mjs.map +1 -0
- package/lib/opLifecycle/opCompressor.d.mts +18 -0
- package/lib/opLifecycle/opCompressor.d.mts.map +1 -0
- package/lib/opLifecycle/opCompressor.mjs +80 -0
- package/lib/opLifecycle/opCompressor.mjs.map +1 -0
- package/lib/opLifecycle/opDecompressor.d.mts +25 -0
- package/lib/opLifecycle/opDecompressor.d.mts.map +1 -0
- package/lib/opLifecycle/opDecompressor.mjs +128 -0
- package/lib/opLifecycle/opDecompressor.mjs.map +1 -0
- package/lib/opLifecycle/opGroupingManager.d.mts +22 -0
- package/lib/opLifecycle/opGroupingManager.d.mts.map +1 -0
- package/lib/opLifecycle/opGroupingManager.mjs +91 -0
- package/lib/opLifecycle/opGroupingManager.mjs.map +1 -0
- package/lib/opLifecycle/opSplitter.d.mts +61 -0
- package/lib/opLifecycle/opSplitter.d.mts.map +1 -0
- package/lib/opLifecycle/opSplitter.mjs +197 -0
- package/lib/opLifecycle/opSplitter.mjs.map +1 -0
- package/lib/opLifecycle/outbox.d.mts +104 -0
- package/lib/opLifecycle/outbox.d.mts.map +1 -0
- package/lib/opLifecycle/outbox.mjs +321 -0
- package/lib/opLifecycle/outbox.mjs.map +1 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.mts +47 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.mts.map +1 -0
- package/lib/opLifecycle/remoteMessageProcessor.mjs +131 -0
- package/lib/opLifecycle/remoteMessageProcessor.mjs.map +1 -0
- package/lib/opProperties.d.mts +7 -0
- package/lib/opProperties.d.mts.map +1 -0
- package/lib/opProperties.mjs +13 -0
- package/lib/opProperties.mjs.map +1 -0
- package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
- package/lib/packageVersion.d.mts.map +1 -0
- package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
- package/lib/packageVersion.mjs.map +1 -0
- package/lib/{pendingStateManager.d.ts → pendingStateManager.d.mts} +33 -70
- package/lib/pendingStateManager.d.mts.map +1 -0
- package/lib/pendingStateManager.mjs +275 -0
- package/lib/pendingStateManager.mjs.map +1 -0
- package/lib/scheduleManager.d.mts +27 -0
- package/lib/scheduleManager.d.mts.map +1 -0
- package/lib/scheduleManager.mjs +254 -0
- package/lib/scheduleManager.mjs.map +1 -0
- package/lib/storageServiceWithAttachBlobs.d.mts +17 -0
- package/lib/storageServiceWithAttachBlobs.d.mts.map +1 -0
- package/lib/storageServiceWithAttachBlobs.mjs +28 -0
- package/lib/storageServiceWithAttachBlobs.mjs.map +1 -0
- package/lib/summary/index.d.mts +17 -0
- package/lib/summary/index.d.mts.map +1 -0
- package/lib/summary/index.mjs +16 -0
- package/lib/summary/index.mjs.map +1 -0
- package/{dist/orderedClientElection.d.ts → lib/summary/orderedClientElection.d.mts} +42 -23
- package/lib/summary/orderedClientElection.d.mts.map +1 -0
- package/lib/{orderedClientElection.js → summary/orderedClientElection.mjs} +95 -79
- package/lib/summary/orderedClientElection.mjs.map +1 -0
- package/{dist/runWhileConnectedCoordinator.d.ts → lib/summary/runWhileConnectedCoordinator.d.mts} +10 -4
- package/lib/summary/runWhileConnectedCoordinator.d.mts.map +1 -0
- package/lib/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.mjs} +12 -10
- package/lib/summary/runWhileConnectedCoordinator.mjs.map +1 -0
- package/lib/summary/runningSummarizer.d.mts +128 -0
- package/lib/summary/runningSummarizer.d.mts.map +1 -0
- package/lib/summary/runningSummarizer.mjs +675 -0
- package/lib/summary/runningSummarizer.mjs.map +1 -0
- package/lib/{summarizer.d.ts → summary/summarizer.d.mts} +21 -36
- package/lib/summary/summarizer.d.mts.map +1 -0
- package/lib/summary/summarizer.mjs +257 -0
- package/lib/summary/summarizer.mjs.map +1 -0
- package/{dist/summarizerClientElection.d.ts → lib/summary/summarizerClientElection.d.mts} +7 -7
- package/lib/summary/summarizerClientElection.d.mts.map +1 -0
- package/lib/{summarizerClientElection.js → summary/summarizerClientElection.mjs} +14 -45
- package/lib/summary/summarizerClientElection.mjs.map +1 -0
- package/{dist/summarizerHeuristics.d.ts → lib/summary/summarizerHeuristics.d.mts} +30 -8
- package/lib/summary/summarizerHeuristics.d.mts.map +1 -0
- package/lib/summary/summarizerHeuristics.mjs +151 -0
- package/lib/summary/summarizerHeuristics.mjs.map +1 -0
- package/lib/summary/summarizerNode/index.d.mts +8 -0
- package/lib/summary/summarizerNode/index.d.mts.map +1 -0
- package/lib/summary/summarizerNode/index.mjs +7 -0
- package/lib/summary/summarizerNode/index.mjs.map +1 -0
- package/lib/summary/summarizerNode/summarizerNode.d.mts +167 -0
- package/lib/summary/summarizerNode/summarizerNode.d.mts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNode.mjs +521 -0
- package/lib/summary/summarizerNode/summarizerNode.mjs.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts +121 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.mjs +123 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.mjs.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts +153 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs +370 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs.map +1 -0
- package/{dist/summarizerTypes.d.ts → lib/summary/summarizerTypes.d.mts} +235 -85
- package/lib/summary/summarizerTypes.d.mts.map +1 -0
- package/lib/summary/summarizerTypes.mjs +6 -0
- package/lib/summary/summarizerTypes.mjs.map +1 -0
- package/lib/{summaryCollection.d.ts → summary/summaryCollection.d.mts} +24 -6
- package/lib/summary/summaryCollection.d.mts.map +1 -0
- package/lib/{summaryCollection.js → summary/summaryCollection.mjs} +76 -45
- package/lib/summary/summaryCollection.mjs.map +1 -0
- package/{dist/summaryFormat.d.ts → lib/summary/summaryFormat.d.mts} +26 -31
- package/lib/summary/summaryFormat.d.mts.map +1 -0
- package/lib/{summaryFormat.js → summary/summaryFormat.mjs} +30 -26
- package/lib/summary/summaryFormat.mjs.map +1 -0
- package/lib/summary/summaryGenerator.d.mts +127 -0
- package/lib/summary/summaryGenerator.d.mts.map +1 -0
- package/lib/{summaryGenerator.js → summary/summaryGenerator.mjs} +153 -67
- package/lib/summary/summaryGenerator.mjs.map +1 -0
- package/{dist/summaryManager.d.ts → lib/summary/summaryManager.d.mts} +16 -14
- package/lib/summary/summaryManager.d.mts.map +1 -0
- package/lib/{summaryManager.js → summary/summaryManager.mjs} +94 -51
- package/lib/summary/summaryManager.mjs.map +1 -0
- package/lib/{throttler.d.ts → throttler.d.mts} +3 -3
- package/lib/throttler.d.mts.map +1 -0
- package/lib/{throttler.js → throttler.mjs} +21 -21
- package/lib/throttler.mjs.map +1 -0
- package/package.json +199 -71
- package/prettier.config.cjs +8 -0
- package/src/batchTracker.ts +59 -54
- package/src/blobManager.ts +942 -294
- package/src/connectionTelemetry.ts +342 -252
- package/src/containerHandleContext.ts +27 -29
- package/src/containerRuntime.ts +3883 -3143
- package/src/dataStore.ts +170 -140
- package/src/dataStoreContext.ts +1166 -986
- package/src/dataStoreContexts.ts +176 -163
- package/src/dataStoreRegistry.ts +29 -21
- package/src/dataStores.ts +924 -678
- package/src/deltaManagerProxyBase.ts +111 -0
- package/src/deltaManagerSummarizerProxy.ts +49 -0
- package/src/deltaScheduler.ts +161 -156
- package/src/error.ts +21 -0
- package/src/gc/garbageCollection.md +106 -0
- package/src/gc/garbageCollection.ts +1157 -0
- package/src/gc/gcConfigs.ts +224 -0
- package/src/gc/gcDefinitions.ts +524 -0
- package/src/gc/gcHelpers.ts +284 -0
- package/src/gc/gcReferenceGraphAlgorithm.ts +52 -0
- package/src/gc/gcSummaryDefinitions.ts +54 -0
- package/src/gc/gcSummaryStateTracker.ts +299 -0
- package/src/gc/gcTelemetry.ts +433 -0
- package/src/gc/gcUnreferencedStateTracker.ts +153 -0
- package/src/gc/index.ts +60 -0
- package/src/index.ts +101 -74
- package/src/messageTypes.ts +238 -0
- package/src/metadata.ts +26 -0
- package/src/opLifecycle/README.md +321 -0
- package/src/opLifecycle/batchManager.ts +179 -0
- package/src/opLifecycle/definitions.ts +89 -0
- package/src/opLifecycle/index.ts +19 -0
- package/src/opLifecycle/opCompressor.ts +99 -0
- package/src/opLifecycle/opDecompressor.ts +190 -0
- package/src/opLifecycle/opGroupingManager.ts +133 -0
- package/src/opLifecycle/opSplitter.ts +279 -0
- package/src/opLifecycle/outbox.ts +474 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +175 -0
- package/src/opProperties.ts +21 -0
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +396 -465
- package/src/scheduleManager.ts +358 -0
- package/src/storageServiceWithAttachBlobs.ts +38 -0
- package/src/summary/index.ts +109 -0
- package/src/summary/orderedClientElection.ts +571 -0
- package/src/summary/runWhileConnectedCoordinator.ts +117 -0
- package/src/summary/runningSummarizer.ts +920 -0
- package/src/summary/summarizer.ts +352 -0
- package/src/summary/summarizerClientElection.ts +140 -0
- package/src/summary/summarizerHeuristics.ts +227 -0
- package/src/summary/summarizerNode/index.ts +12 -0
- package/src/summary/summarizerNode/summarizerNode.ts +725 -0
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +206 -0
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +571 -0
- package/src/summary/summarizerTypes.ts +631 -0
- package/src/summary/summaryCollection.ts +474 -0
- package/src/summary/summaryFormat.ts +249 -0
- package/src/summary/summaryGenerator.ts +539 -0
- package/src/summary/summaryManager.ts +452 -0
- package/src/throttler.ts +131 -122
- package/tsc-multi.test.json +4 -0
- package/tsconfig.json +11 -13
- package/dist/batchTracker.js.map +0 -1
- package/dist/blobManager.js +0 -249
- package/dist/blobManager.js.map +0 -1
- package/dist/connectionTelemetry.js +0 -178
- package/dist/connectionTelemetry.js.map +0 -1
- package/dist/containerHandleContext.js.map +0 -1
- package/dist/containerRuntime.js +0 -2174
- package/dist/containerRuntime.js.map +0 -1
- package/dist/dataStore.js.map +0 -1
- package/dist/dataStoreContext.js.map +0 -1
- package/dist/dataStoreContexts.js.map +0 -1
- package/dist/dataStoreRegistry.js.map +0 -1
- package/dist/dataStores.js.map +0 -1
- package/dist/deltaScheduler.js.map +0 -1
- package/dist/garbageCollection.d.ts +0 -319
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js +0 -993
- package/dist/garbageCollection.js.map +0 -1
- package/dist/index.js +0 -33
- package/dist/index.js.map +0 -1
- package/dist/opTelemetry.d.ts +0 -22
- package/dist/opTelemetry.d.ts.map +0 -1
- package/dist/opTelemetry.js +0 -60
- package/dist/opTelemetry.js.map +0 -1
- package/dist/orderedClientElection.d.ts.map +0 -1
- package/dist/orderedClientElection.js.map +0 -1
- package/dist/packageVersion.js.map +0 -1
- package/dist/pendingStateManager.js +0 -346
- package/dist/pendingStateManager.js.map +0 -1
- package/dist/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/dist/runWhileConnectedCoordinator.js.map +0 -1
- package/dist/runningSummarizer.d.ts +0 -93
- package/dist/runningSummarizer.d.ts.map +0 -1
- package/dist/runningSummarizer.js +0 -384
- package/dist/runningSummarizer.js.map +0 -1
- package/dist/serializedSnapshotStorage.d.ts +0 -58
- package/dist/serializedSnapshotStorage.d.ts.map +0 -1
- package/dist/serializedSnapshotStorage.js +0 -108
- package/dist/serializedSnapshotStorage.js.map +0 -1
- package/dist/summarizer.d.ts.map +0 -1
- package/dist/summarizer.js +0 -348
- package/dist/summarizer.js.map +0 -1
- package/dist/summarizerClientElection.d.ts.map +0 -1
- package/dist/summarizerClientElection.js.map +0 -1
- package/dist/summarizerHandle.d.ts +0 -12
- package/dist/summarizerHandle.d.ts.map +0 -1
- package/dist/summarizerHandle.js +0 -22
- package/dist/summarizerHandle.js.map +0 -1
- package/dist/summarizerHeuristics.d.ts.map +0 -1
- package/dist/summarizerHeuristics.js +0 -84
- package/dist/summarizerHeuristics.js.map +0 -1
- package/dist/summarizerTypes.d.ts.map +0 -1
- package/dist/summarizerTypes.js.map +0 -1
- package/dist/summaryCollection.d.ts.map +0 -1
- package/dist/summaryCollection.js.map +0 -1
- package/dist/summaryFormat.d.ts.map +0 -1
- package/dist/summaryFormat.js.map +0 -1
- package/dist/summaryGenerator.d.ts.map +0 -1
- package/dist/summaryGenerator.js.map +0 -1
- package/dist/summaryManager.d.ts.map +0 -1
- package/dist/summaryManager.js.map +0 -1
- package/dist/throttler.js.map +0 -1
- package/garbageCollection.md +0 -41
- package/lib/batchTracker.d.ts.map +0 -1
- package/lib/batchTracker.js.map +0 -1
- package/lib/blobManager.d.ts +0 -95
- package/lib/blobManager.d.ts.map +0 -1
- package/lib/blobManager.js +0 -244
- package/lib/blobManager.js.map +0 -1
- package/lib/connectionTelemetry.d.ts.map +0 -1
- package/lib/connectionTelemetry.js +0 -174
- package/lib/connectionTelemetry.js.map +0 -1
- package/lib/containerHandleContext.d.ts.map +0 -1
- package/lib/containerHandleContext.js.map +0 -1
- package/lib/containerRuntime.d.ts +0 -615
- package/lib/containerRuntime.d.ts.map +0 -1
- package/lib/containerRuntime.js +0 -2166
- package/lib/containerRuntime.js.map +0 -1
- package/lib/dataStore.d.ts.map +0 -1
- package/lib/dataStore.js.map +0 -1
- package/lib/dataStoreContext.d.ts.map +0 -1
- package/lib/dataStoreContext.js.map +0 -1
- package/lib/dataStoreContexts.d.ts.map +0 -1
- package/lib/dataStoreContexts.js.map +0 -1
- package/lib/dataStoreRegistry.d.ts.map +0 -1
- package/lib/dataStoreRegistry.js.map +0 -1
- package/lib/dataStores.d.ts.map +0 -1
- package/lib/dataStores.js.map +0 -1
- package/lib/deltaScheduler.d.ts.map +0 -1
- package/lib/deltaScheduler.js.map +0 -1
- package/lib/garbageCollection.d.ts +0 -319
- package/lib/garbageCollection.d.ts.map +0 -1
- package/lib/garbageCollection.js +0 -989
- package/lib/garbageCollection.js.map +0 -1
- package/lib/index.d.ts +0 -14
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/index.js.map +0 -1
- package/lib/opTelemetry.d.ts +0 -22
- package/lib/opTelemetry.d.ts.map +0 -1
- package/lib/opTelemetry.js +0 -56
- package/lib/opTelemetry.js.map +0 -1
- package/lib/orderedClientElection.d.ts.map +0 -1
- package/lib/orderedClientElection.js.map +0 -1
- package/lib/packageVersion.d.ts.map +0 -1
- package/lib/packageVersion.js.map +0 -1
- package/lib/pendingStateManager.d.ts.map +0 -1
- package/lib/pendingStateManager.js +0 -339
- package/lib/pendingStateManager.js.map +0 -1
- package/lib/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/lib/runWhileConnectedCoordinator.js.map +0 -1
- package/lib/runningSummarizer.d.ts +0 -93
- package/lib/runningSummarizer.d.ts.map +0 -1
- package/lib/runningSummarizer.js +0 -380
- package/lib/runningSummarizer.js.map +0 -1
- package/lib/serializedSnapshotStorage.d.ts +0 -58
- package/lib/serializedSnapshotStorage.d.ts.map +0 -1
- package/lib/serializedSnapshotStorage.js +0 -104
- package/lib/serializedSnapshotStorage.js.map +0 -1
- package/lib/summarizer.d.ts.map +0 -1
- package/lib/summarizer.js +0 -342
- package/lib/summarizer.js.map +0 -1
- package/lib/summarizerClientElection.d.ts.map +0 -1
- package/lib/summarizerClientElection.js.map +0 -1
- package/lib/summarizerHandle.d.ts +0 -12
- package/lib/summarizerHandle.d.ts.map +0 -1
- package/lib/summarizerHandle.js +0 -18
- package/lib/summarizerHandle.js.map +0 -1
- package/lib/summarizerHeuristics.d.ts.map +0 -1
- package/lib/summarizerHeuristics.js +0 -79
- package/lib/summarizerHeuristics.js.map +0 -1
- package/lib/summarizerTypes.d.ts.map +0 -1
- package/lib/summarizerTypes.js +0 -9
- package/lib/summarizerTypes.js.map +0 -1
- package/lib/summaryCollection.d.ts.map +0 -1
- package/lib/summaryCollection.js.map +0 -1
- package/lib/summaryFormat.d.ts.map +0 -1
- package/lib/summaryFormat.js.map +0 -1
- package/lib/summaryGenerator.d.ts +0 -85
- package/lib/summaryGenerator.d.ts.map +0 -1
- package/lib/summaryGenerator.js.map +0 -1
- package/lib/summaryManager.d.ts.map +0 -1
- package/lib/summaryManager.js.map +0 -1
- package/lib/throttler.d.ts.map +0 -1
- package/lib/throttler.js.map +0 -1
- package/src/garbageCollection.ts +0 -1434
- package/src/opTelemetry.ts +0 -71
- package/src/orderedClientElection.ts +0 -511
- package/src/runWhileConnectedCoordinator.ts +0 -106
- package/src/runningSummarizer.ts +0 -550
- package/src/serializedSnapshotStorage.ts +0 -146
- package/src/summarizer.ts +0 -438
- package/src/summarizerClientElection.ts +0 -161
- package/src/summarizerHandle.ts +0 -21
- package/src/summarizerHeuristics.ts +0 -108
- package/src/summarizerTypes.ts +0 -462
- package/src/summaryCollection.ts +0 -406
- package/src/summaryFormat.ts +0 -239
- package/src/summaryGenerator.ts +0 -427
- package/src/summaryManager.ts +0 -368
- package/tsconfig.esnext.json +0 -7
|
@@ -6,72 +6,33 @@
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
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
|
-
const
|
|
9
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
10
|
+
const core_utils_1 = require("@fluidframework/core-utils");
|
|
10
11
|
const driver_utils_1 = require("@fluidframework/driver-utils");
|
|
11
|
-
const protocol_base_1 = require("@fluidframework/protocol-base");
|
|
12
12
|
const runtime_definitions_1 = require("@fluidframework/runtime-definitions");
|
|
13
13
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
14
14
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
function createAttributes(pkg, isRootDataStore
|
|
15
|
+
const summary_1 = require("./summary/index.cjs");
|
|
16
|
+
const gc_1 = require("./gc/index.cjs");
|
|
17
|
+
function createAttributes(pkg, isRootDataStore) {
|
|
18
18
|
const stringifiedPkg = JSON.stringify(pkg);
|
|
19
|
-
return
|
|
20
|
-
pkg: stringifiedPkg,
|
|
21
|
-
snapshotFormatVersion: "0.1",
|
|
22
|
-
isRootDataStore,
|
|
23
|
-
} : {
|
|
19
|
+
return {
|
|
24
20
|
pkg: stringifiedPkg,
|
|
25
21
|
summaryFormatVersion: 2,
|
|
26
22
|
isRootDataStore,
|
|
27
23
|
};
|
|
28
24
|
}
|
|
29
|
-
function createAttributesBlob(pkg, isRootDataStore
|
|
30
|
-
const attributes = createAttributes(pkg, isRootDataStore
|
|
31
|
-
return new
|
|
25
|
+
function createAttributesBlob(pkg, isRootDataStore) {
|
|
26
|
+
const attributes = createAttributes(pkg, isRootDataStore);
|
|
27
|
+
return new driver_utils_1.BlobTreeEntry(summary_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
32
28
|
}
|
|
33
29
|
exports.createAttributesBlob = createAttributesBlob;
|
|
34
30
|
/**
|
|
35
31
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
36
32
|
*/
|
|
37
|
-
class FluidDataStoreContext extends
|
|
38
|
-
constructor(props, existing, bindState, isLocalDataStore, makeLocallyVisibleFn) {
|
|
39
|
-
super();
|
|
40
|
-
this.existing = existing;
|
|
41
|
-
this.bindState = bindState;
|
|
42
|
-
this.isLocalDataStore = isLocalDataStore;
|
|
43
|
-
this.makeLocallyVisibleFn = makeLocallyVisibleFn;
|
|
44
|
-
this._disposed = false;
|
|
45
|
-
this.detachedRuntimeCreation = false;
|
|
46
|
-
this.loaded = false;
|
|
47
|
-
this.pending = [];
|
|
48
|
-
this._isInMemoryRoot = false;
|
|
49
|
-
this._containerRuntime = props.runtime;
|
|
50
|
-
this.id = props.id;
|
|
51
|
-
this.storage = props.storage;
|
|
52
|
-
this.scope = props.scope;
|
|
53
|
-
this.writeGCDataAtRoot = props.writeGCDataAtRoot;
|
|
54
|
-
this.disableIsolatedChannels = props.disableIsolatedChannels;
|
|
55
|
-
this.pkg = props.pkg;
|
|
56
|
-
// URIs use slashes as delimiters. Handles use URIs.
|
|
57
|
-
// Thus having slashes in types almost guarantees trouble down the road!
|
|
58
|
-
(0, common_utils_1.assert)(!this.id.includes("/"), 0x13a /* Data store ID contains slash */);
|
|
59
|
-
this._attachState = this.containerRuntime.attachState !== container_definitions_1.AttachState.Detached && this.existing ?
|
|
60
|
-
this.containerRuntime.attachState : container_definitions_1.AttachState.Detached;
|
|
61
|
-
this.bindToContext = () => {
|
|
62
|
-
(0, common_utils_1.assert)(this.bindState === container_definitions_1.BindState.NotBound, 0x13b /* "datastore context is already in bound state" */);
|
|
63
|
-
this.bindState = container_definitions_1.BindState.Binding;
|
|
64
|
-
(0, common_utils_1.assert)(this.channel !== undefined, 0x13c /* "undefined channel on datastore context" */);
|
|
65
|
-
this.makeLocallyVisible();
|
|
66
|
-
this.bindState = container_definitions_1.BindState.Bound;
|
|
67
|
-
};
|
|
68
|
-
const thisSummarizeInternal = async (fullTree, trackState, telemetryContext) => this.summarizeInternal(fullTree, trackState, telemetryContext);
|
|
69
|
-
this.summarizerNode = props.createSummarizerNodeFn(thisSummarizeInternal, async (fullGC) => this.getGCDataInternal(fullGC), async () => this.getBaseGCDetails());
|
|
70
|
-
this.subLogger = telemetry_utils_1.ChildLogger.create(this.logger, "FluidDataStoreContext");
|
|
71
|
-
this.thresholdOpsCounter = new telemetry_utils_1.ThresholdCounter(FluidDataStoreContext.pendingOpsCountThreshold, this.subLogger);
|
|
72
|
-
}
|
|
33
|
+
class FluidDataStoreContext extends client_utils_1.TypedEventEmitter {
|
|
73
34
|
get packagePath() {
|
|
74
|
-
(0,
|
|
35
|
+
(0, core_utils_1.assert)(this.pkg !== undefined, 0x139 /* "Undefined package path" */);
|
|
75
36
|
return this.pkg;
|
|
76
37
|
}
|
|
77
38
|
get options() {
|
|
@@ -98,13 +59,24 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
98
59
|
get containerRuntime() {
|
|
99
60
|
return this._containerRuntime;
|
|
100
61
|
}
|
|
62
|
+
ensureNoDataModelChanges(callback) {
|
|
63
|
+
return this._containerRuntime.ensureNoDataModelChanges(callback);
|
|
64
|
+
}
|
|
101
65
|
get isLoaded() {
|
|
102
66
|
return this.loaded;
|
|
103
67
|
}
|
|
104
68
|
get baseSnapshot() {
|
|
105
69
|
return this._baseSnapshot;
|
|
106
70
|
}
|
|
107
|
-
get
|
|
71
|
+
get idCompressor() {
|
|
72
|
+
return this._containerRuntime.idCompressor;
|
|
73
|
+
}
|
|
74
|
+
get disposed() {
|
|
75
|
+
return this._disposed;
|
|
76
|
+
}
|
|
77
|
+
get tombstoned() {
|
|
78
|
+
return this._tombstoned;
|
|
79
|
+
}
|
|
108
80
|
get attachState() {
|
|
109
81
|
return this._attachState;
|
|
110
82
|
}
|
|
@@ -130,6 +102,55 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
130
102
|
isInMemoryRoot() {
|
|
131
103
|
return this._isInMemoryRoot;
|
|
132
104
|
}
|
|
105
|
+
constructor(props, existing, isLocalDataStore, makeLocallyVisibleFn) {
|
|
106
|
+
super();
|
|
107
|
+
this.existing = existing;
|
|
108
|
+
this.isLocalDataStore = isLocalDataStore;
|
|
109
|
+
this.makeLocallyVisibleFn = makeLocallyVisibleFn;
|
|
110
|
+
this._disposed = false;
|
|
111
|
+
/**
|
|
112
|
+
* A Tombstoned object has been unreferenced long enough that GC knows it won't be referenced again.
|
|
113
|
+
* Tombstoned objects are eventually deleted by GC.
|
|
114
|
+
*/
|
|
115
|
+
this._tombstoned = false;
|
|
116
|
+
/** If true, this means that this data store context and its children have been removed from the runtime */
|
|
117
|
+
this.deleted = false;
|
|
118
|
+
this.detachedRuntimeCreation = false;
|
|
119
|
+
this.loaded = false;
|
|
120
|
+
this.pending = [];
|
|
121
|
+
this._isInMemoryRoot = false;
|
|
122
|
+
this._containerRuntime = props.runtime;
|
|
123
|
+
this.id = props.id;
|
|
124
|
+
this.storage = props.storage;
|
|
125
|
+
this.scope = props.scope;
|
|
126
|
+
this.pkg = props.pkg;
|
|
127
|
+
// URIs use slashes as delimiters. Handles use URIs.
|
|
128
|
+
// Thus having slashes in types almost guarantees trouble down the road!
|
|
129
|
+
(0, core_utils_1.assert)(!this.id.includes("/"), 0x13a /* Data store ID contains slash */);
|
|
130
|
+
this._attachState =
|
|
131
|
+
this.containerRuntime.attachState !== container_definitions_1.AttachState.Detached && this.existing
|
|
132
|
+
? this.containerRuntime.attachState
|
|
133
|
+
: container_definitions_1.AttachState.Detached;
|
|
134
|
+
const thisSummarizeInternal = async (fullTree, trackState, telemetryContext) => this.summarizeInternal(fullTree, trackState, telemetryContext);
|
|
135
|
+
this.summarizerNode = props.createSummarizerNodeFn(thisSummarizeInternal, async (fullGC) => this.getGCDataInternal(fullGC));
|
|
136
|
+
this.mc = (0, telemetry_utils_1.createChildMonitoringContext)({
|
|
137
|
+
logger: this.logger,
|
|
138
|
+
namespace: "FluidDataStoreContext",
|
|
139
|
+
properties: {
|
|
140
|
+
all: (0, telemetry_utils_1.tagCodeArtifacts)({
|
|
141
|
+
fluidDataStoreId: this.id,
|
|
142
|
+
// The package name is a getter because `this.pkg` may not be initialized during construction.
|
|
143
|
+
// For data stores loaded from summary, it is initialized during data store realization.
|
|
144
|
+
fullPackageName: () => this.pkg?.join("/"),
|
|
145
|
+
}),
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
this.thresholdOpsCounter = new telemetry_utils_1.ThresholdCounter(FluidDataStoreContext.pendingOpsCountThreshold, this.mc.logger);
|
|
149
|
+
this.throwOnTombstoneUsage = this._containerRuntime.gcThrowOnTombstoneUsage;
|
|
150
|
+
// By default, a data store can log maximum 10 local changes telemetry in summarizer.
|
|
151
|
+
this.localChangesTelemetryCount =
|
|
152
|
+
this.mc.config.getNumber("Fluid.Telemetry.LocalChangesTelemetryCount") ?? 10;
|
|
153
|
+
}
|
|
133
154
|
dispose() {
|
|
134
155
|
if (this._disposed) {
|
|
135
156
|
return;
|
|
@@ -138,30 +159,51 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
138
159
|
// Dispose any pending runtime after it gets fulfilled
|
|
139
160
|
// Errors are logged where this.channelDeferred is consumed/generated (realizeCore(), bindRuntime())
|
|
140
161
|
if (this.channelDeferred) {
|
|
141
|
-
this.channelDeferred.promise
|
|
162
|
+
this.channelDeferred.promise
|
|
163
|
+
.then((runtime) => {
|
|
142
164
|
runtime.dispose();
|
|
143
|
-
})
|
|
165
|
+
})
|
|
166
|
+
.catch((error) => { });
|
|
144
167
|
}
|
|
145
168
|
}
|
|
146
|
-
|
|
147
|
-
|
|
169
|
+
/**
|
|
170
|
+
* When delete is called, that means that the data store is permanently removed from the runtime, and will not show up in future summaries
|
|
171
|
+
* This function is called to prevent ops from being generated from this data store once it has been deleted. Furthermore, this data store
|
|
172
|
+
* should not receive any ops/signals.
|
|
173
|
+
*/
|
|
174
|
+
delete() {
|
|
175
|
+
this.deleted = true;
|
|
176
|
+
}
|
|
177
|
+
setTombstone(tombstone) {
|
|
178
|
+
if (this.tombstoned === tombstone) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
this._tombstoned = tombstone;
|
|
182
|
+
}
|
|
183
|
+
rejectDeferredRealize(reason, failedPkgPath, fullPackageName) {
|
|
184
|
+
throw new telemetry_utils_1.LoggingError(reason, (0, telemetry_utils_1.tagCodeArtifacts)({
|
|
185
|
+
failedPkgPath,
|
|
186
|
+
packagePath: fullPackageName?.join("/"),
|
|
187
|
+
}));
|
|
148
188
|
}
|
|
149
189
|
async realize() {
|
|
150
|
-
(0,
|
|
190
|
+
(0, core_utils_1.assert)(!this.detachedRuntimeCreation, 0x13d /* "Detached runtime creation on realize()" */);
|
|
151
191
|
if (!this.channelDeferred) {
|
|
152
|
-
this.channelDeferred = new
|
|
192
|
+
this.channelDeferred = new core_utils_1.Deferred();
|
|
153
193
|
this.realizeCore(this.existing).catch((error) => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
194
|
+
const errorWrapped = telemetry_utils_1.DataProcessingError.wrapIfUnrecognized(error, "realizeFluidDataStoreContext");
|
|
195
|
+
errorWrapped.addTelemetryProperties((0, telemetry_utils_1.tagCodeArtifacts)({
|
|
196
|
+
fullPackageName: this.pkg?.join("/"),
|
|
197
|
+
fluidDataStoreId: this.id,
|
|
198
|
+
}));
|
|
199
|
+
this.channelDeferred?.reject(errorWrapped);
|
|
200
|
+
this.mc.logger.sendErrorEvent({ eventName: "RealizeError" }, errorWrapped);
|
|
159
201
|
});
|
|
160
202
|
}
|
|
161
203
|
return this.channelDeferred.promise;
|
|
162
204
|
}
|
|
163
205
|
async factoryFromPackagePath(packages) {
|
|
164
|
-
(0,
|
|
206
|
+
(0, core_utils_1.assert)(this.pkg === packages, 0x13e /* "Unexpected package path" */);
|
|
165
207
|
if (packages === undefined) {
|
|
166
208
|
this.rejectDeferredRealize("packages is undefined");
|
|
167
209
|
}
|
|
@@ -170,18 +212,18 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
170
212
|
let lastPkg;
|
|
171
213
|
for (const pkg of packages) {
|
|
172
214
|
if (!registry) {
|
|
173
|
-
this.rejectDeferredRealize("No registry for package", lastPkg);
|
|
215
|
+
this.rejectDeferredRealize("No registry for package", lastPkg, packages);
|
|
174
216
|
}
|
|
175
217
|
lastPkg = pkg;
|
|
176
218
|
entry = await registry.get(pkg);
|
|
177
219
|
if (!entry) {
|
|
178
|
-
this.rejectDeferredRealize("Registry does not contain entry for the package", pkg);
|
|
220
|
+
this.rejectDeferredRealize("Registry does not contain entry for the package", pkg, packages);
|
|
179
221
|
}
|
|
180
222
|
registry = entry.IFluidDataStoreRegistry;
|
|
181
223
|
}
|
|
182
|
-
const factory = entry
|
|
224
|
+
const factory = entry?.IFluidDataStoreFactory;
|
|
183
225
|
if (factory === undefined) {
|
|
184
|
-
this.rejectDeferredRealize("Can't find factory for package", lastPkg);
|
|
226
|
+
this.rejectDeferredRealize("Can't find factory for package", lastPkg, packages);
|
|
185
227
|
}
|
|
186
228
|
return { factory, registry };
|
|
187
229
|
}
|
|
@@ -193,52 +235,66 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
193
235
|
this._baseSnapshot = details.snapshot;
|
|
194
236
|
const packages = details.pkg;
|
|
195
237
|
const { factory, registry } = await this.factoryFromPackagePath(packages);
|
|
196
|
-
(0,
|
|
238
|
+
(0, core_utils_1.assert)(this.registry === undefined, 0x13f /* "datastore context registry is already set" */);
|
|
197
239
|
this.registry = registry;
|
|
198
240
|
const channel = await factory.instantiateDataStore(this, existing);
|
|
199
|
-
(0,
|
|
241
|
+
(0, core_utils_1.assert)(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
|
|
200
242
|
this.bindRuntime(channel);
|
|
243
|
+
// This data store may have been disposed before the channel is created during realization. If so,
|
|
244
|
+
// dispose the channel now.
|
|
245
|
+
if (this.disposed) {
|
|
246
|
+
channel.dispose();
|
|
247
|
+
}
|
|
201
248
|
}
|
|
202
249
|
/**
|
|
203
250
|
* Notifies this object about changes in the connection state.
|
|
204
251
|
* @param value - New connection state.
|
|
205
|
-
* @param clientId - ID of the client.
|
|
206
|
-
*
|
|
252
|
+
* @param clientId - ID of the client. Its old ID when in disconnected state and
|
|
253
|
+
* its new client ID when we are connecting or connected.
|
|
207
254
|
*/
|
|
208
255
|
setConnectionState(connected, clientId) {
|
|
209
|
-
this
|
|
256
|
+
// ConnectionState should not fail in tombstone mode as this is internally run
|
|
257
|
+
this.verifyNotClosed("setConnectionState", false /* checkTombstone */);
|
|
210
258
|
// Connection events are ignored if the store is not yet loaded
|
|
211
259
|
if (!this.loaded) {
|
|
212
260
|
return;
|
|
213
261
|
}
|
|
214
|
-
(0,
|
|
262
|
+
(0, core_utils_1.assert)(this.connected === connected, 0x141 /* "Unexpected connected state" */);
|
|
215
263
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
216
264
|
this.channel.setConnectionState(connected, clientId);
|
|
217
265
|
}
|
|
218
266
|
process(messageArg, local, localOpMetadata) {
|
|
219
|
-
|
|
220
|
-
|
|
267
|
+
const safeTelemetryProps = (0, telemetry_utils_1.extractSafePropertiesFromMessage)(messageArg);
|
|
268
|
+
// On op process, tombstone error is logged in garbage collector. So, set "checkTombstone" to false when calling
|
|
269
|
+
// "verifyNotClosed" which logs tombstone errors. Throw error if tombstoned and throwing on load is configured.
|
|
270
|
+
this.verifyNotClosed("process", false /* checkTombstone */, safeTelemetryProps);
|
|
271
|
+
if (this.tombstoned && this.throwOnTombstoneUsage) {
|
|
272
|
+
throw new telemetry_utils_1.DataCorruptionError("Context is tombstoned! Call site [process]", safeTelemetryProps);
|
|
273
|
+
}
|
|
221
274
|
const innerContents = messageArg.contents;
|
|
222
|
-
const message =
|
|
275
|
+
const message = {
|
|
276
|
+
...messageArg,
|
|
277
|
+
type: innerContents.type,
|
|
278
|
+
contents: innerContents.content,
|
|
279
|
+
};
|
|
223
280
|
this.summarizerNode.recordChange(message);
|
|
224
281
|
if (this.loaded) {
|
|
225
|
-
return
|
|
282
|
+
return this.channel?.process(message, local, localOpMetadata);
|
|
226
283
|
}
|
|
227
284
|
else {
|
|
228
|
-
(0,
|
|
229
|
-
(0,
|
|
285
|
+
(0, core_utils_1.assert)(!local, 0x142 /* "local store channel is not loaded" */);
|
|
286
|
+
(0, core_utils_1.assert)(this.pending !== undefined, 0x23d /* "pending is undefined" */);
|
|
230
287
|
this.pending.push(message);
|
|
231
288
|
this.thresholdOpsCounter.sendIfMultiple("StorePendingOps", this.pending.length);
|
|
232
289
|
}
|
|
233
290
|
}
|
|
234
291
|
processSignal(message, local) {
|
|
235
|
-
|
|
236
|
-
this.verifyNotClosed();
|
|
292
|
+
this.verifyNotClosed("processSignal");
|
|
237
293
|
// Signals are ignored if the store is not yet loaded
|
|
238
294
|
if (!this.loaded) {
|
|
239
295
|
return;
|
|
240
296
|
}
|
|
241
|
-
|
|
297
|
+
this.channel?.processSignal(message, local);
|
|
242
298
|
}
|
|
243
299
|
getQuorum() {
|
|
244
300
|
return this._containerRuntime.getQuorum();
|
|
@@ -259,28 +315,25 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
259
315
|
await this.realize();
|
|
260
316
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
261
317
|
const summarizeResult = await this.channel.summarize(fullTree, trackState, telemetryContext);
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
(0, summaryFormat_1.wrapSummaryInChannelsTree)(summarizeResult);
|
|
266
|
-
pathPartsForChildren = [runtime_definitions_1.channelsTreeName];
|
|
267
|
-
}
|
|
318
|
+
// Wrap dds summaries in .channels subtree.
|
|
319
|
+
(0, summary_1.wrapSummaryInChannelsTree)(summarizeResult);
|
|
320
|
+
const pathPartsForChildren = [runtime_definitions_1.channelsTreeName];
|
|
268
321
|
// Add data store's attributes to the summary.
|
|
269
322
|
const { pkg } = await this.getInitialSnapshotDetails();
|
|
270
323
|
const isRoot = await this.isRoot();
|
|
271
|
-
const attributes = createAttributes(pkg, isRoot
|
|
272
|
-
(0, runtime_utils_1.addBlobToSummary)(summarizeResult,
|
|
273
|
-
// Add GC data to the summary if it's not written at the root.
|
|
274
|
-
if (!this.writeGCDataAtRoot) {
|
|
275
|
-
(0, runtime_utils_1.addBlobToSummary)(summarizeResult, runtime_definitions_1.gcBlobKey, JSON.stringify(this.summarizerNode.getGCSummaryDetails()));
|
|
276
|
-
}
|
|
324
|
+
const attributes = createAttributes(pkg, isRoot);
|
|
325
|
+
(0, runtime_utils_1.addBlobToSummary)(summarizeResult, summary_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
277
326
|
// If we are not referenced, mark the summary tree as unreferenced. Also, update unreferenced blob
|
|
278
327
|
// size in the summary stats with the blobs size of this data store.
|
|
279
328
|
if (!this.summarizerNode.isReferenced()) {
|
|
280
329
|
summarizeResult.summary.unreferenced = true;
|
|
281
330
|
summarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;
|
|
282
331
|
}
|
|
283
|
-
return
|
|
332
|
+
return {
|
|
333
|
+
...summarizeResult,
|
|
334
|
+
id: this.id,
|
|
335
|
+
pathPartsForChildren,
|
|
336
|
+
};
|
|
284
337
|
}
|
|
285
338
|
/**
|
|
286
339
|
* Returns the data used for garbage collection. This includes a list of GC nodes that represent this data store
|
|
@@ -300,32 +353,34 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
300
353
|
*/
|
|
301
354
|
async getGCDataInternal(fullGC = false) {
|
|
302
355
|
await this.realize();
|
|
303
|
-
(0,
|
|
356
|
+
(0, core_utils_1.assert)(this.channel !== undefined, 0x143 /* "Channel should not be undefined when running GC" */);
|
|
304
357
|
return this.channel.getGCData(fullGC);
|
|
305
358
|
}
|
|
306
359
|
/**
|
|
307
360
|
* After GC has run, called to notify the data store of routes used in it. These are used for the following:
|
|
361
|
+
*
|
|
308
362
|
* 1. To identify if this data store is being referenced in the document or not.
|
|
363
|
+
*
|
|
309
364
|
* 2. To determine if it needs to re-summarize in case used routes changed since last summary.
|
|
365
|
+
*
|
|
310
366
|
* 3. These are added to the summary generated by the data store.
|
|
311
|
-
*
|
|
312
|
-
*
|
|
367
|
+
*
|
|
368
|
+
* 4. To notify child contexts of their used routes. This is done immediately if the data store is loaded.
|
|
369
|
+
* Else, it is done when realizing the data store.
|
|
370
|
+
*
|
|
313
371
|
* 5. To update the timestamp when this data store or any children are marked as unreferenced.
|
|
372
|
+
*
|
|
314
373
|
* @param usedRoutes - The routes that are used in this data store.
|
|
315
|
-
* @param gcTimestamp - The time when GC was run that generated these used routes. If any node becomes unreferenced
|
|
316
|
-
* as part of this GC run, this should be used to update the time when it happens.
|
|
317
374
|
*/
|
|
318
|
-
updateUsedRoutes(usedRoutes
|
|
375
|
+
updateUsedRoutes(usedRoutes) {
|
|
319
376
|
// Update the used routes in this data store's summarizer node.
|
|
320
|
-
this.summarizerNode.updateUsedRoutes(usedRoutes
|
|
377
|
+
this.summarizerNode.updateUsedRoutes(usedRoutes);
|
|
321
378
|
/**
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
* child's reference state changes, the gcTimestamp has to be used to update its unreferencedTimestamp. Since
|
|
326
|
-
* it will result in a change in this data store's used routes, it will be realized to regenerate its summary.
|
|
379
|
+
* Store the used routes to update the channel if the data store is not loaded yet. If the used routes changed
|
|
380
|
+
* since the previous run, the data store will be loaded during summarize since the used state changed. So, it's
|
|
381
|
+
* safe to only store the last used routes.
|
|
327
382
|
*/
|
|
328
|
-
this.
|
|
383
|
+
this.lastUsedRoutes = usedRoutes;
|
|
329
384
|
// If we are loaded, call the channel so it can update the used routes of the child contexts.
|
|
330
385
|
// If we are not loaded, we will update this when we are realized.
|
|
331
386
|
if (this.loaded) {
|
|
@@ -348,15 +403,17 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
348
403
|
* 2. When the data store is realized. This updates the channel's used routes as per last GC run.
|
|
349
404
|
*/
|
|
350
405
|
updateChannelUsedRoutes() {
|
|
351
|
-
(0,
|
|
352
|
-
(0,
|
|
353
|
-
// If there is no
|
|
354
|
-
if (this.
|
|
406
|
+
(0, core_utils_1.assert)(this.loaded, 0x144 /* "Channel should be loaded when updating used routes" */);
|
|
407
|
+
(0, core_utils_1.assert)(this.channel !== undefined, 0x145 /* "Channel should be present when data store is loaded" */);
|
|
408
|
+
// If there is no lastUsedRoutes, GC has not run up until this point.
|
|
409
|
+
if (this.lastUsedRoutes === undefined) {
|
|
355
410
|
return;
|
|
356
411
|
}
|
|
357
412
|
// Remove the route to this data store, if it exists.
|
|
358
|
-
const usedChannelRoutes = this.
|
|
359
|
-
|
|
413
|
+
const usedChannelRoutes = this.lastUsedRoutes.filter((id) => {
|
|
414
|
+
return id !== "/" && id !== "";
|
|
415
|
+
});
|
|
416
|
+
this.channel.updateUsedRoutes(usedChannelRoutes);
|
|
360
417
|
}
|
|
361
418
|
/**
|
|
362
419
|
* @deprecated 0.18.Should call request on the runtime directly
|
|
@@ -366,12 +423,14 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
366
423
|
return runtime.request(request);
|
|
367
424
|
}
|
|
368
425
|
submitMessage(type, content, localOpMetadata) {
|
|
369
|
-
this.verifyNotClosed();
|
|
370
|
-
(0,
|
|
426
|
+
this.verifyNotClosed("submitMessage");
|
|
427
|
+
(0, core_utils_1.assert)(!!this.channel, 0x146 /* "Channel must exist when submitting message" */);
|
|
371
428
|
const fluidDataStoreContent = {
|
|
372
429
|
content,
|
|
373
430
|
type,
|
|
374
431
|
};
|
|
432
|
+
// Summarizer clients should not submit messages.
|
|
433
|
+
this.identifyLocalChangeInSummarizer("DataStoreMessageSubmittedInSummarizer", type);
|
|
375
434
|
this._containerRuntime.submitDataStoreOp(this.id, fluidDataStoreContent, localOpMetadata);
|
|
376
435
|
}
|
|
377
436
|
/**
|
|
@@ -384,7 +443,7 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
384
443
|
*
|
|
385
444
|
*/
|
|
386
445
|
setChannelDirty(address) {
|
|
387
|
-
this.verifyNotClosed();
|
|
446
|
+
this.verifyNotClosed("setChannelDirty");
|
|
388
447
|
// Get the latest sequence number.
|
|
389
448
|
const latestSequenceNumber = this.deltaManager.lastSequenceNumber;
|
|
390
449
|
this.summarizerNode.invalidate(latestSequenceNumber);
|
|
@@ -393,28 +452,34 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
393
452
|
channelSummarizerNode.invalidate(latestSequenceNumber); // TODO: lazy load problem?
|
|
394
453
|
}
|
|
395
454
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
455
|
+
/**
|
|
456
|
+
* Submits the signal to be sent to other clients.
|
|
457
|
+
* @param type - Type of the signal.
|
|
458
|
+
* @param content - Content of the signal.
|
|
459
|
+
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
460
|
+
*/
|
|
461
|
+
submitSignal(type, content, targetClientId) {
|
|
462
|
+
this.verifyNotClosed("submitSignal");
|
|
463
|
+
(0, core_utils_1.assert)(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
|
|
464
|
+
return this._containerRuntime.submitDataStoreSignal(this.id, type, content, targetClientId);
|
|
400
465
|
}
|
|
401
466
|
/**
|
|
402
467
|
* This is called by the data store channel when it becomes locally visible indicating that it is ready to become
|
|
403
468
|
* globally visible now.
|
|
404
469
|
*/
|
|
405
470
|
makeLocallyVisible() {
|
|
406
|
-
(0,
|
|
471
|
+
(0, core_utils_1.assert)(this.channel !== undefined, 0x2cf /* "undefined channel on datastore context" */);
|
|
472
|
+
(0, core_utils_1.assert)(this.channel.visibilityState === runtime_definitions_1.VisibilityState.LocallyVisible, 0x590 /* Channel must be locally visible */);
|
|
407
473
|
this.makeLocallyVisibleFn();
|
|
408
474
|
}
|
|
409
475
|
bindRuntime(channel) {
|
|
410
|
-
var _a;
|
|
411
476
|
if (this.channel) {
|
|
412
477
|
throw new Error("Runtime already bound");
|
|
413
478
|
}
|
|
414
479
|
try {
|
|
415
|
-
(0,
|
|
416
|
-
(0,
|
|
417
|
-
(0,
|
|
480
|
+
(0, core_utils_1.assert)(!this.detachedRuntimeCreation, 0x148 /* "Detached runtime creation on runtime bind" */);
|
|
481
|
+
(0, core_utils_1.assert)(this.channelDeferred !== undefined, 0x149 /* "Undefined channel deferral" */);
|
|
482
|
+
(0, core_utils_1.assert)(this.pkg !== undefined, 0x14a /* "Undefined package path" */);
|
|
418
483
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
419
484
|
const pending = this.pending;
|
|
420
485
|
// Apply all pending ops
|
|
@@ -441,8 +506,10 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
441
506
|
this.channelDeferred.resolve(this.channel);
|
|
442
507
|
}
|
|
443
508
|
catch (error) {
|
|
444
|
-
|
|
445
|
-
this.logger.sendErrorEvent({
|
|
509
|
+
this.channelDeferred?.reject(error);
|
|
510
|
+
this.mc.logger.sendErrorEvent({
|
|
511
|
+
eventName: "BindRuntimeError",
|
|
512
|
+
}, error);
|
|
446
513
|
}
|
|
447
514
|
}
|
|
448
515
|
async getAbsoluteUrl(relativeUrl) {
|
|
@@ -452,15 +519,21 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
452
519
|
return this._containerRuntime.getAbsoluteUrl(relativeUrl);
|
|
453
520
|
}
|
|
454
521
|
/**
|
|
455
|
-
* @deprecated
|
|
522
|
+
* @deprecated Sets the datastore as root, for aliasing purposes: #7948
|
|
456
523
|
* This method should not be used outside of the aliasing context.
|
|
457
524
|
* It will be removed, as the source of truth for this flag will be the aliasing blob.
|
|
458
525
|
*/
|
|
459
526
|
setInMemoryRoot() {
|
|
460
527
|
this._isInMemoryRoot = true;
|
|
461
528
|
}
|
|
529
|
+
/**
|
|
530
|
+
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
531
|
+
*/
|
|
532
|
+
async getBaseGCDetails() {
|
|
533
|
+
return {};
|
|
534
|
+
}
|
|
462
535
|
reSubmit(contents, localOpMetadata) {
|
|
463
|
-
(0,
|
|
536
|
+
(0, core_utils_1.assert)(!!this.channel, 0x14b /* "Channel must exist when resubmitting ops" */);
|
|
464
537
|
const innerContents = contents;
|
|
465
538
|
this.channel.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
|
|
466
539
|
}
|
|
@@ -478,64 +551,88 @@ class FluidDataStoreContext extends common_utils_1.TypedEventEmitter {
|
|
|
478
551
|
if (!this.channel) {
|
|
479
552
|
await this.realize();
|
|
480
553
|
}
|
|
481
|
-
(0,
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
}
|
|
485
|
-
|
|
554
|
+
(0, core_utils_1.assert)(!!this.channel, 0x14c /* "Channel must exist when rebasing ops" */);
|
|
555
|
+
return this.channel.applyStashedOp(contents);
|
|
556
|
+
}
|
|
557
|
+
verifyNotClosed(callSite, checkTombstone = true, safeTelemetryProps = {}) {
|
|
558
|
+
if (this.deleted) {
|
|
559
|
+
const messageString = `Context is deleted! Call site [${callSite}]`;
|
|
560
|
+
const error = new telemetry_utils_1.DataCorruptionError(messageString, safeTelemetryProps);
|
|
561
|
+
this.mc.logger.sendErrorEvent({
|
|
562
|
+
eventName: "GC_Deleted_DataStore_Changed",
|
|
563
|
+
callSite,
|
|
564
|
+
}, error);
|
|
565
|
+
throw error;
|
|
566
|
+
}
|
|
486
567
|
if (this._disposed) {
|
|
487
|
-
throw new Error(
|
|
568
|
+
throw new Error(`Context is closed! Call site [${callSite}]`);
|
|
569
|
+
}
|
|
570
|
+
if (checkTombstone && this.tombstoned) {
|
|
571
|
+
const messageString = `Context is tombstoned! Call site [${callSite}]`;
|
|
572
|
+
const error = new telemetry_utils_1.DataCorruptionError(messageString, safeTelemetryProps);
|
|
573
|
+
(0, gc_1.sendGCUnexpectedUsageEvent)(this.mc, {
|
|
574
|
+
eventName: "GC_Tombstone_DataStore_Changed",
|
|
575
|
+
category: this.throwOnTombstoneUsage ? "error" : "generic",
|
|
576
|
+
gcTombstoneEnforcementAllowed: this._containerRuntime.gcTombstoneEnforcementAllowed,
|
|
577
|
+
callSite,
|
|
578
|
+
}, this.pkg, error);
|
|
579
|
+
if (this.throwOnTombstoneUsage) {
|
|
580
|
+
throw error;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
/**
|
|
585
|
+
* Summarizer client should not have local changes. These changes can become part of the summary and can break
|
|
586
|
+
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
587
|
+
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
588
|
+
*/
|
|
589
|
+
identifyLocalChangeInSummarizer(eventName, type) {
|
|
590
|
+
if (this.clientDetails.type !== summary_1.summarizerClientType ||
|
|
591
|
+
this.localChangesTelemetryCount <= 0) {
|
|
592
|
+
return;
|
|
488
593
|
}
|
|
594
|
+
// Log a telemetry if there are local changes in the summarizer. This will give us data on how often
|
|
595
|
+
// this is happening and which data stores do this. The eventual goal is to disallow local changes
|
|
596
|
+
// in the summarizer and the data will help us plan this.
|
|
597
|
+
this.mc.logger.sendTelemetryEvent({
|
|
598
|
+
eventName,
|
|
599
|
+
type,
|
|
600
|
+
isSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),
|
|
601
|
+
stack: (0, telemetry_utils_1.generateStack)(),
|
|
602
|
+
});
|
|
603
|
+
this.localChangesTelemetryCount--;
|
|
489
604
|
}
|
|
490
605
|
getCreateChildSummarizerNodeFn(id, createParam) {
|
|
491
|
-
return (summarizeInternal, getGCDataFn
|
|
606
|
+
return (summarizeInternal, getGCDataFn) => this.summarizerNode.createChild(summarizeInternal, id, createParam,
|
|
492
607
|
// DDS will not create failure summaries
|
|
493
|
-
{ throwOnFailure: true }, getGCDataFn
|
|
608
|
+
{ throwOnFailure: true }, getGCDataFn);
|
|
494
609
|
}
|
|
495
|
-
async uploadBlob(blob) {
|
|
496
|
-
return this.containerRuntime.uploadBlob(blob);
|
|
610
|
+
async uploadBlob(blob, signal) {
|
|
611
|
+
return this.containerRuntime.uploadBlob(blob, signal);
|
|
497
612
|
}
|
|
498
613
|
}
|
|
499
614
|
exports.FluidDataStoreContext = FluidDataStoreContext;
|
|
500
615
|
FluidDataStoreContext.pendingOpsCountThreshold = 1000;
|
|
501
616
|
class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
502
617
|
constructor(props) {
|
|
503
|
-
super(props, true /* existing */,
|
|
618
|
+
super(props, true /* existing */, false /* isLocalDataStore */, () => {
|
|
504
619
|
throw new Error("Already attached");
|
|
505
620
|
});
|
|
506
|
-
this.initialSnapshotDetailsP = new
|
|
507
|
-
|
|
508
|
-
let tree;
|
|
621
|
+
this.initialSnapshotDetailsP = new core_utils_1.LazyPromise(async () => {
|
|
622
|
+
let tree = this.initSnapshotValue;
|
|
509
623
|
let isRootDataStore = true;
|
|
510
|
-
if (
|
|
511
|
-
const commit = (await this.storage.getVersions(this.initSnapshotValue, 1))[0];
|
|
512
|
-
tree = (_a = await this.storage.getSnapshotTree(commit)) !== null && _a !== void 0 ? _a : undefined;
|
|
513
|
-
}
|
|
514
|
-
else {
|
|
515
|
-
tree = this.initSnapshotValue;
|
|
516
|
-
}
|
|
517
|
-
const localReadAndParse = async (id) => (0, driver_utils_1.readAndParse)(this.storage, id);
|
|
518
|
-
if (tree) {
|
|
519
|
-
const loadedSummary = await this.summarizerNode.loadBaseSummary(tree, localReadAndParse);
|
|
520
|
-
tree = loadedSummary.baseSummary;
|
|
521
|
-
// Prepend outstanding ops to pending queue of ops to process.
|
|
522
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
523
|
-
this.pending = loadedSummary.outstandingOps.concat(this.pending);
|
|
524
|
-
}
|
|
525
|
-
if (!!tree && tree.blobs[summaryFormat_1.dataStoreAttributesBlobName] !== undefined) {
|
|
624
|
+
if (!!tree && tree.blobs[summary_1.dataStoreAttributesBlobName] !== undefined) {
|
|
526
625
|
// Need to get through snapshot and use that to populate extraBlobs
|
|
527
|
-
const attributes = await
|
|
626
|
+
const attributes = await (0, driver_utils_1.readAndParse)(this.storage, tree.blobs[summary_1.dataStoreAttributesBlobName]);
|
|
528
627
|
let pkgFromSnapshot;
|
|
529
628
|
// Use the snapshotFormatVersion to determine how the pkg is encoded in the snapshot.
|
|
530
629
|
// For snapshotFormatVersion = "0.1" (1) or above, pkg is jsonified, otherwise it is just a string.
|
|
531
|
-
const formatVersion = (0,
|
|
630
|
+
const formatVersion = (0, summary_1.getAttributesFormatVersion)(attributes);
|
|
532
631
|
if (formatVersion < 1) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
pkgFromSnapshot = [attributes.pkg];
|
|
538
|
-
}
|
|
632
|
+
pkgFromSnapshot =
|
|
633
|
+
attributes.pkg.startsWith('["') && attributes.pkg.endsWith('"]')
|
|
634
|
+
? JSON.parse(attributes.pkg)
|
|
635
|
+
: [attributes.pkg];
|
|
539
636
|
}
|
|
540
637
|
else {
|
|
541
638
|
pkgFromSnapshot = JSON.parse(attributes.pkg);
|
|
@@ -546,10 +643,10 @@ class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
546
643
|
* data stores in older documents are not garbage collected incorrectly. This may lead to additional
|
|
547
644
|
* roots in the document but they won't break.
|
|
548
645
|
*/
|
|
549
|
-
isRootDataStore =
|
|
550
|
-
if ((0,
|
|
646
|
+
isRootDataStore = attributes.isRootDataStore ?? true;
|
|
647
|
+
if ((0, summary_1.hasIsolatedChannels)(attributes)) {
|
|
551
648
|
tree = tree.trees[runtime_definitions_1.channelsTreeName];
|
|
552
|
-
(0,
|
|
649
|
+
(0, core_utils_1.assert)(tree !== undefined, 0x1fe /* "isolated channels subtree should exist in remote datastore snapshot" */);
|
|
553
650
|
}
|
|
554
651
|
}
|
|
555
652
|
return {
|
|
@@ -560,23 +657,13 @@ class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
560
657
|
};
|
|
561
658
|
});
|
|
562
659
|
this.initSnapshotValue = props.snapshotTree;
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
});
|
|
660
|
+
if (props.snapshotTree !== undefined) {
|
|
661
|
+
this.summarizerNode.updateBaseSummaryState(props.snapshotTree);
|
|
662
|
+
}
|
|
567
663
|
}
|
|
568
664
|
async getInitialSnapshotDetails() {
|
|
569
665
|
return this.initialSnapshotDetailsP;
|
|
570
666
|
}
|
|
571
|
-
/**
|
|
572
|
-
* @deprecated - Renamed to getBaseGCDetails.
|
|
573
|
-
*/
|
|
574
|
-
async getInitialGCSummaryDetails() {
|
|
575
|
-
return this.getBaseGCDetails();
|
|
576
|
-
}
|
|
577
|
-
async getBaseGCDetails() {
|
|
578
|
-
return this.baseGCDetailsP;
|
|
579
|
-
}
|
|
580
667
|
generateAttachMessage() {
|
|
581
668
|
throw new Error("Cannot attach remote store");
|
|
582
669
|
}
|
|
@@ -587,7 +674,39 @@ exports.RemoteFluidDataStoreContext = RemoteFluidDataStoreContext;
|
|
|
587
674
|
*/
|
|
588
675
|
class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
589
676
|
constructor(props) {
|
|
590
|
-
super(props, props.snapshotTree !== undefined ? true : false /* existing */,
|
|
677
|
+
super(props, props.snapshotTree !== undefined ? true : false /* existing */, true /* isLocalDataStore */, props.makeLocallyVisibleFn);
|
|
678
|
+
this.initialSnapshotDetailsP = new core_utils_1.LazyPromise(async () => {
|
|
679
|
+
let snapshot = this.snapshotTree;
|
|
680
|
+
let attributes;
|
|
681
|
+
let isRootDataStore = false;
|
|
682
|
+
if (snapshot !== undefined) {
|
|
683
|
+
// Get the dataStore attributes.
|
|
684
|
+
// Note: storage can be undefined in special case while detached.
|
|
685
|
+
attributes = await (0, summary_1.getFluidDataStoreAttributes)(this.storage, snapshot);
|
|
686
|
+
if ((0, summary_1.hasIsolatedChannels)(attributes)) {
|
|
687
|
+
snapshot = snapshot.trees[runtime_definitions_1.channelsTreeName];
|
|
688
|
+
(0, core_utils_1.assert)(snapshot !== undefined, 0x1ff /* "isolated channels subtree should exist in local datastore snapshot" */);
|
|
689
|
+
}
|
|
690
|
+
if (this.pkg === undefined) {
|
|
691
|
+
this.pkg = JSON.parse(attributes.pkg);
|
|
692
|
+
// If there is no isRootDataStore in the attributes blob, set it to true. This ensures that data
|
|
693
|
+
// stores in older documents are not garbage collected incorrectly. This may lead to additional
|
|
694
|
+
// roots in the document but they won't break.
|
|
695
|
+
if (attributes.isRootDataStore ?? true) {
|
|
696
|
+
isRootDataStore = true;
|
|
697
|
+
this.setInMemoryRoot();
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
(0, core_utils_1.assert)(this.pkg !== undefined, 0x152 /* "pkg should be available in local data store" */);
|
|
702
|
+
return {
|
|
703
|
+
pkg: this.pkg,
|
|
704
|
+
isRootDataStore,
|
|
705
|
+
snapshot,
|
|
706
|
+
};
|
|
707
|
+
});
|
|
708
|
+
// Summarizer client should not create local data stores.
|
|
709
|
+
this.identifyLocalChangeInSummarizer("DataStoreCreatedInSummarizer");
|
|
591
710
|
this.snapshotTree = props.snapshotTree;
|
|
592
711
|
if (props.isRootDataStore === true) {
|
|
593
712
|
this.setInMemoryRoot();
|
|
@@ -597,25 +716,23 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
597
716
|
}
|
|
598
717
|
attachListeners() {
|
|
599
718
|
this.once("attaching", () => {
|
|
600
|
-
(0,
|
|
719
|
+
(0, core_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Detached, 0x14d /* "Should move from detached to attaching" */);
|
|
601
720
|
this._attachState = container_definitions_1.AttachState.Attaching;
|
|
602
721
|
});
|
|
603
722
|
this.once("attached", () => {
|
|
604
|
-
(0,
|
|
723
|
+
(0, core_utils_1.assert)(this.attachState === container_definitions_1.AttachState.Attaching, 0x14e /* "Should move from attaching to attached" */);
|
|
605
724
|
this._attachState = container_definitions_1.AttachState.Attached;
|
|
606
725
|
});
|
|
607
726
|
}
|
|
608
727
|
generateAttachMessage() {
|
|
609
|
-
(0,
|
|
610
|
-
(0,
|
|
728
|
+
(0, core_utils_1.assert)(this.channel !== undefined, 0x14f /* "There should be a channel when generating attach message" */);
|
|
729
|
+
(0, core_utils_1.assert)(this.pkg !== undefined, 0x150 /* "pkg should be available in local data store context" */);
|
|
611
730
|
const summarizeResult = this.channel.getAttachSummary();
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
(0, summaryFormat_1.wrapSummaryInChannelsTree)(summarizeResult);
|
|
615
|
-
}
|
|
731
|
+
// Wrap dds summaries in .channels subtree.
|
|
732
|
+
(0, summary_1.wrapSummaryInChannelsTree)(summarizeResult);
|
|
616
733
|
// Add data store's attributes to the summary.
|
|
617
|
-
const attributes = createAttributes(this.pkg, this.isInMemoryRoot()
|
|
618
|
-
(0, runtime_utils_1.addBlobToSummary)(summarizeResult,
|
|
734
|
+
const attributes = createAttributes(this.pkg, this.isInMemoryRoot());
|
|
735
|
+
(0, runtime_utils_1.addBlobToSummary)(summarizeResult, summary_1.dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
619
736
|
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
620
737
|
const snapshot = (0, runtime_utils_1.convertSummaryTreeToITree)(summarizeResult.summary);
|
|
621
738
|
const message = {
|
|
@@ -626,46 +743,24 @@ class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
626
743
|
return message;
|
|
627
744
|
}
|
|
628
745
|
async getInitialSnapshotDetails() {
|
|
629
|
-
|
|
630
|
-
let snapshot = this.snapshotTree;
|
|
631
|
-
let attributes;
|
|
632
|
-
let isRootDataStore = false;
|
|
633
|
-
if (snapshot !== undefined) {
|
|
634
|
-
// Get the dataStore attributes.
|
|
635
|
-
// Note: storage can be undefined in special case while detached.
|
|
636
|
-
attributes = await (0, summaryFormat_1.getFluidDataStoreAttributes)(this.storage, snapshot);
|
|
637
|
-
if ((0, summaryFormat_1.hasIsolatedChannels)(attributes)) {
|
|
638
|
-
snapshot = snapshot.trees[runtime_definitions_1.channelsTreeName];
|
|
639
|
-
(0, common_utils_1.assert)(snapshot !== undefined, 0x1ff /* "isolated channels subtree should exist in local datastore snapshot" */);
|
|
640
|
-
}
|
|
641
|
-
if (this.pkg === undefined) {
|
|
642
|
-
this.pkg = JSON.parse(attributes.pkg);
|
|
643
|
-
// If there is no isRootDataStore in the attributes blob, set it to true. This ensures that data
|
|
644
|
-
// stores in older documents are not garbage collected incorrectly. This may lead to additional
|
|
645
|
-
// roots in the document but they won't break.
|
|
646
|
-
if ((_a = attributes.isRootDataStore) !== null && _a !== void 0 ? _a : true) {
|
|
647
|
-
isRootDataStore = true;
|
|
648
|
-
this.setInMemoryRoot();
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
(0, common_utils_1.assert)(this.pkg !== undefined, 0x152 /* "pkg should be available in local data store" */);
|
|
653
|
-
return {
|
|
654
|
-
pkg: this.pkg,
|
|
655
|
-
isRootDataStore,
|
|
656
|
-
snapshot,
|
|
657
|
-
};
|
|
746
|
+
return this.initialSnapshotDetailsP;
|
|
658
747
|
}
|
|
659
748
|
/**
|
|
660
|
-
*
|
|
749
|
+
* A context should only be marked as deleted when its a remote context.
|
|
750
|
+
* Session Expiry at the runtime level should have closed the container creating the local data store context
|
|
751
|
+
* before delete is even possible. Session Expiry is at 30 days, and sweep is done 36+ days later from the time
|
|
752
|
+
* it was unreferenced. Thus the sweeping container should have loaded from a snapshot and thus creating a remote
|
|
753
|
+
* context.
|
|
661
754
|
*/
|
|
662
|
-
|
|
663
|
-
//
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
755
|
+
delete() {
|
|
756
|
+
// TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.
|
|
757
|
+
(0, gc_1.sendGCUnexpectedUsageEvent)(this.mc, {
|
|
758
|
+
eventName: "GC_Deleted_DataStore_Unexpected_Delete",
|
|
759
|
+
message: "Unexpected deletion of a local data store context",
|
|
760
|
+
category: "error",
|
|
761
|
+
gcTombstoneEnforcementAllowed: undefined,
|
|
762
|
+
}, this.pkg);
|
|
763
|
+
super.delete();
|
|
669
764
|
}
|
|
670
765
|
}
|
|
671
766
|
exports.LocalFluidDataStoreContextBase = LocalFluidDataStoreContextBase;
|
|
@@ -693,25 +788,26 @@ class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase
|
|
|
693
788
|
this.detachedRuntimeCreation = true;
|
|
694
789
|
}
|
|
695
790
|
async attachRuntime(registry, dataStoreChannel) {
|
|
696
|
-
(0,
|
|
697
|
-
|
|
791
|
+
(0, core_utils_1.assert)(this.detachedRuntimeCreation, 0x154 /* "runtime creation is already attached" */);
|
|
792
|
+
this.detachedRuntimeCreation = false;
|
|
793
|
+
(0, core_utils_1.assert)(this.channelDeferred === undefined, 0x155 /* "channel deferral is already set" */);
|
|
794
|
+
this.channelDeferred = new core_utils_1.Deferred();
|
|
698
795
|
const factory = registry.IFluidDataStoreFactory;
|
|
699
796
|
const entry = await this.factoryFromPackagePath(this.pkg);
|
|
700
|
-
(0,
|
|
701
|
-
(0,
|
|
797
|
+
(0, core_utils_1.assert)(entry.factory === factory, 0x156 /* "Unexpected factory for package path" */);
|
|
798
|
+
(0, core_utils_1.assert)(this.registry === undefined, 0x157 /* "datastore registry already attached" */);
|
|
702
799
|
this.registry = entry.registry;
|
|
703
|
-
this.detachedRuntimeCreation = false;
|
|
704
|
-
this.channelDeferred = new common_utils_1.Deferred();
|
|
705
800
|
super.bindRuntime(dataStoreChannel);
|
|
801
|
+
// Load the handle to the data store's entryPoint to make sure that for a detached data store, the entryPoint
|
|
802
|
+
// initialization function is called before the data store gets attached and potentially connected to the
|
|
803
|
+
// delta stream, so it gets a chance to do things while the data store is still "purely local".
|
|
804
|
+
// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method
|
|
805
|
+
// of data store factories tends to construct the data object (at least kick off an async method that returns
|
|
806
|
+
// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
|
|
807
|
+
// before the data store is attached.
|
|
808
|
+
await dataStoreChannel.entryPoint.get();
|
|
706
809
|
if (await this.isRoot()) {
|
|
707
|
-
|
|
708
|
-
// For older versions, we still have to call bindToContext.
|
|
709
|
-
if (dataStoreChannel.makeVisibleAndAttachGraph !== undefined) {
|
|
710
|
-
dataStoreChannel.makeVisibleAndAttachGraph();
|
|
711
|
-
}
|
|
712
|
-
else {
|
|
713
|
-
dataStoreChannel.bindToContext();
|
|
714
|
-
}
|
|
810
|
+
dataStoreChannel.makeVisibleAndAttachGraph();
|
|
715
811
|
}
|
|
716
812
|
}
|
|
717
813
|
async getInitialSnapshotDetails() {
|
|
@@ -722,4 +818,4 @@ class LocalDetachedFluidDataStoreContext extends LocalFluidDataStoreContextBase
|
|
|
722
818
|
}
|
|
723
819
|
}
|
|
724
820
|
exports.LocalDetachedFluidDataStoreContext = LocalDetachedFluidDataStoreContext;
|
|
725
|
-
//# sourceMappingURL=dataStoreContext.
|
|
821
|
+
//# sourceMappingURL=dataStoreContext.cjs.map
|