@fluidframework/container-runtime 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488
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.cjs +5 -5
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +54 -0
- package/README.md +45 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +426 -33
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +0 -5
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +0 -12
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +226 -0
- package/dist/channelCollection.d.ts.map +1 -0
- package/dist/{dataStores.js → channelCollection.js} +455 -150
- package/dist/channelCollection.js.map +1 -0
- package/dist/connectionTelemetry.d.ts +11 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +42 -4
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +128 -48
- package/dist/container-runtime-beta.d.ts +67 -9
- package/dist/container-runtime-public.d.ts +67 -9
- package/dist/container-runtime-untrimmed.d.ts +692 -49
- package/dist/containerHandleContext.d.ts +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +81 -64
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +522 -379
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +2 -3
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +12 -11
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +118 -41
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +248 -159
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +2 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +1 -0
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +4 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +2 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +29 -4
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +91 -5
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +12 -6
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +116 -78
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +2 -2
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +30 -23
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +22 -13
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +7 -4
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +2 -2
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +12 -5
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +18 -6
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +6 -7
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +20 -18
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +10 -10
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +8 -8
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +40 -39
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +11 -21
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -42
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +3 -3
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +2 -2
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +2 -2
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +8 -8
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +18 -18
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +4 -4
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +3 -3
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +1 -10
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +5 -5
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +7 -7
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +32 -18
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +4 -4
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +7 -4
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +2 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +18 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +1 -2
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +9 -5
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +12 -12
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +43 -43
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +12 -8
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +5 -4
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +47 -32
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +4 -4
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +6 -6
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +2 -2
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +3 -3
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts +3 -3
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js +4 -4
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +16 -5
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +40 -10
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +9 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +3 -4
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +12 -12
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +9 -20
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +15 -2
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +6 -5
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +10 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +5 -6
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +4 -5
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{batchTracker.d.mts → batchTracker.d.ts} +2 -3
- package/lib/batchTracker.d.ts.map +1 -0
- package/lib/{batchTracker.mjs → batchTracker.js} +1 -1
- package/lib/batchTracker.js.map +1 -0
- package/lib/{blobManager.d.mts → blobManager.d.ts} +1 -6
- package/lib/blobManager.d.ts.map +1 -0
- package/lib/{blobManager.mjs → blobManager.js} +1 -13
- package/lib/blobManager.js.map +1 -0
- package/lib/channelCollection.d.ts +226 -0
- package/lib/channelCollection.d.ts.map +1 -0
- package/lib/{dataStores.mjs → channelCollection.js} +442 -140
- package/lib/channelCollection.js.map +1 -0
- package/lib/{connectionTelemetry.d.mts → connectionTelemetry.d.ts} +12 -2
- package/lib/connectionTelemetry.d.ts.map +1 -0
- package/lib/{connectionTelemetry.mjs → connectionTelemetry.js} +43 -5
- package/lib/connectionTelemetry.js.map +1 -0
- package/lib/{container-runtime-alpha.d.mts → container-runtime-alpha.d.ts} +128 -48
- package/lib/{container-runtime-beta.d.mts → container-runtime-beta.d.ts} +67 -9
- package/lib/{container-runtime-public.d.mts → container-runtime-public.d.ts} +67 -9
- package/lib/{container-runtime-untrimmed.d.mts → container-runtime-untrimmed.d.ts} +692 -49
- package/lib/{containerHandleContext.d.mts → containerHandleContext.d.ts} +2 -2
- package/lib/containerHandleContext.d.ts.map +1 -0
- package/lib/{containerHandleContext.mjs → containerHandleContext.js} +1 -1
- package/lib/containerHandleContext.js.map +1 -0
- package/lib/{containerRuntime.d.mts → containerRuntime.d.ts} +86 -65
- package/lib/containerRuntime.d.ts.map +1 -0
- package/lib/{containerRuntime.mjs → containerRuntime.js} +444 -303
- package/lib/containerRuntime.js.map +1 -0
- package/lib/{dataStore.d.mts → dataStore.d.ts} +3 -4
- package/lib/dataStore.d.ts.map +1 -0
- package/lib/{dataStore.mjs → dataStore.js} +13 -12
- package/lib/dataStore.js.map +1 -0
- package/lib/{dataStoreContext.d.mts → dataStoreContext.d.ts} +119 -42
- package/lib/dataStoreContext.d.ts.map +1 -0
- package/lib/{dataStoreContext.mjs → dataStoreContext.js} +240 -151
- package/lib/dataStoreContext.js.map +1 -0
- package/lib/{dataStoreContexts.d.mts → dataStoreContexts.d.ts} +3 -2
- package/lib/dataStoreContexts.d.ts.map +1 -0
- package/lib/{dataStoreContexts.mjs → dataStoreContexts.js} +2 -1
- package/lib/dataStoreContexts.js.map +1 -0
- package/lib/{dataStoreRegistry.d.mts → dataStoreRegistry.d.ts} +5 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -0
- package/lib/{dataStoreRegistry.mjs → dataStoreRegistry.js} +5 -1
- package/lib/dataStoreRegistry.js.map +1 -0
- package/{dist/deltaManagerProxyBase.d.ts → lib/deltaManagerSummarizerProxy.d.ts} +16 -7
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/lib/deltaManagerSummarizerProxy.js +124 -0
- package/lib/deltaManagerSummarizerProxy.js.map +1 -0
- package/lib/{deltaScheduler.d.mts → deltaScheduler.d.ts} +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -0
- package/lib/{deltaScheduler.mjs → deltaScheduler.js} +1 -1
- package/lib/deltaScheduler.js.map +1 -0
- package/lib/{error.d.mts → error.d.ts} +1 -1
- package/lib/error.d.ts.map +1 -0
- package/lib/{error.mjs → error.js} +1 -1
- package/lib/error.js.map +1 -0
- package/lib/gc/{garbageCollection.d.mts → garbageCollection.d.ts} +13 -7
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/gc/{garbageCollection.mjs → garbageCollection.js} +79 -41
- package/lib/gc/garbageCollection.js.map +1 -0
- package/lib/gc/{gcConfigs.d.mts → gcConfigs.d.ts} +3 -3
- package/lib/gc/gcConfigs.d.ts.map +1 -0
- package/lib/gc/{gcConfigs.mjs → gcConfigs.js} +14 -7
- package/lib/gc/gcConfigs.js.map +1 -0
- package/lib/gc/{gcDefinitions.d.mts → gcDefinitions.d.ts} +23 -14
- package/lib/gc/gcDefinitions.d.ts.map +1 -0
- package/lib/gc/{gcDefinitions.mjs → gcDefinitions.js} +7 -4
- package/lib/gc/gcDefinitions.js.map +1 -0
- package/lib/gc/{gcHelpers.d.mts → gcHelpers.d.ts} +3 -3
- package/lib/gc/{gcHelpers.d.mts.map → gcHelpers.d.ts.map} +1 -1
- package/lib/gc/{gcHelpers.mjs → gcHelpers.js} +1 -1
- package/lib/gc/gcHelpers.js.map +1 -0
- package/lib/gc/{gcReferenceGraphAlgorithm.d.mts → gcReferenceGraphAlgorithm.d.ts} +2 -2
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/lib/gc/{gcReferenceGraphAlgorithm.mjs → gcReferenceGraphAlgorithm.js} +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -0
- package/lib/gc/{gcSummaryDefinitions.d.mts → gcSummaryDefinitions.d.ts} +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/lib/gc/{gcSummaryDefinitions.mjs → gcSummaryDefinitions.js} +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -0
- package/lib/gc/{gcSummaryStateTracker.d.mts → gcSummaryStateTracker.d.ts} +13 -6
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/lib/gc/{gcSummaryStateTracker.mjs → gcSummaryStateTracker.js} +17 -5
- package/lib/gc/gcSummaryStateTracker.js.map +1 -0
- package/lib/gc/{gcTelemetry.d.mts → gcTelemetry.d.ts} +7 -8
- package/lib/gc/gcTelemetry.d.ts.map +1 -0
- package/lib/gc/{gcTelemetry.mjs → gcTelemetry.js} +5 -3
- package/lib/gc/gcTelemetry.js.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.d.mts → gcUnreferencedStateTracker.d.ts} +2 -2
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.mjs → gcUnreferencedStateTracker.js} +2 -2
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/lib/gc/index.d.ts +13 -0
- package/lib/gc/index.d.ts.map +1 -0
- package/lib/gc/{index.mjs → index.js} +8 -8
- package/lib/gc/index.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +12 -22
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +15 -0
- package/lib/index.js.map +1 -0
- package/lib/{messageTypes.d.mts → messageTypes.d.ts} +4 -4
- package/lib/messageTypes.d.ts.map +1 -0
- package/lib/{messageTypes.mjs → messageTypes.js} +1 -1
- package/lib/messageTypes.js.map +1 -0
- package/lib/{metadata.d.mts → metadata.d.ts} +1 -1
- package/lib/metadata.d.ts.map +1 -0
- package/lib/{metadata.mjs → metadata.js} +1 -1
- package/lib/metadata.js.map +1 -0
- package/lib/opLifecycle/{batchManager.d.mts → batchManager.d.ts} +3 -3
- package/lib/opLifecycle/batchManager.d.ts.map +1 -0
- package/lib/opLifecycle/{batchManager.mjs → batchManager.js} +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -0
- package/lib/opLifecycle/{definitions.d.mts → definitions.d.ts} +3 -3
- package/lib/opLifecycle/definitions.d.ts.map +1 -0
- package/lib/opLifecycle/{definitions.mjs → definitions.js} +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -0
- package/lib/opLifecycle/index.d.ts +13 -0
- package/lib/opLifecycle/index.d.ts.map +1 -0
- package/lib/opLifecycle/index.js +12 -0
- package/lib/opLifecycle/index.js.map +1 -0
- package/lib/opLifecycle/{opCompressor.d.mts → opCompressor.d.ts} +2 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -0
- package/lib/opLifecycle/{opCompressor.mjs → opCompressor.js} +3 -3
- package/lib/opLifecycle/opCompressor.js.map +1 -0
- package/lib/opLifecycle/{opDecompressor.d.mts → opDecompressor.d.ts} +2 -2
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -0
- package/lib/opLifecycle/{opDecompressor.mjs → opDecompressor.js} +2 -2
- package/lib/opLifecycle/opDecompressor.js.map +1 -0
- package/lib/opLifecycle/{opGroupingManager.d.mts → opGroupingManager.d.ts} +2 -2
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -0
- package/lib/opLifecycle/{opGroupingManager.mjs → opGroupingManager.js} +2 -11
- package/lib/opLifecycle/opGroupingManager.js.map +1 -0
- package/lib/opLifecycle/{opSplitter.d.mts → opSplitter.d.ts} +2 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -0
- package/lib/opLifecycle/{opSplitter.mjs → opSplitter.js} +3 -3
- package/lib/opLifecycle/opSplitter.js.map +1 -0
- package/lib/opLifecycle/{outbox.d.mts → outbox.d.ts} +8 -8
- package/lib/opLifecycle/outbox.d.ts.map +1 -0
- package/lib/opLifecycle/{outbox.mjs → outbox.js} +24 -10
- package/lib/opLifecycle/outbox.js.map +1 -0
- package/lib/opLifecycle/{remoteMessageProcessor.d.mts → remoteMessageProcessor.d.ts} +5 -5
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -0
- package/lib/opLifecycle/{remoteMessageProcessor.mjs → remoteMessageProcessor.js} +7 -4
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -0
- package/lib/{opProperties.d.mts → opProperties.d.ts} +1 -1
- package/lib/opProperties.d.ts.map +1 -0
- package/lib/{opProperties.mjs → opProperties.js} +1 -1
- package/lib/opProperties.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{pendingStateManager.d.mts → pendingStateManager.d.ts} +3 -2
- package/lib/pendingStateManager.d.ts.map +1 -0
- package/lib/{pendingStateManager.mjs → pendingStateManager.js} +18 -10
- package/lib/pendingStateManager.js.map +1 -0
- package/lib/{scheduleManager.d.mts → scheduleManager.d.ts} +6 -3
- package/lib/scheduleManager.d.ts.map +1 -0
- package/lib/{scheduleManager.mjs → scheduleManager.js} +7 -3
- package/lib/scheduleManager.js.map +1 -0
- package/lib/{storageServiceWithAttachBlobs.d.mts → storageServiceWithAttachBlobs.d.ts} +1 -1
- package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/lib/{storageServiceWithAttachBlobs.mjs → storageServiceWithAttachBlobs.js} +1 -1
- package/lib/storageServiceWithAttachBlobs.js.map +1 -0
- package/lib/summary/{index.d.mts → index.d.ts} +13 -13
- package/lib/summary/index.d.ts.map +1 -0
- package/lib/summary/{index.mjs → index.js} +12 -12
- package/lib/summary/index.js.map +1 -0
- package/lib/summary/{orderedClientElection.d.mts → orderedClientElection.d.ts} +5 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -0
- package/lib/summary/{orderedClientElection.mjs → orderedClientElection.js} +6 -2
- package/lib/summary/orderedClientElection.js.map +1 -0
- package/lib/summary/{runWhileConnectedCoordinator.d.mts → runWhileConnectedCoordinator.d.ts} +2 -2
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/lib/summary/{runWhileConnectedCoordinator.mjs → runWhileConnectedCoordinator.js} +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/lib/summary/{runningSummarizer.d.mts → runningSummarizer.d.ts} +6 -5
- package/lib/summary/runningSummarizer.d.ts.map +1 -0
- package/lib/summary/{runningSummarizer.mjs → runningSummarizer.js} +41 -26
- package/lib/summary/runningSummarizer.js.map +1 -0
- package/lib/summary/{summarizer.d.mts → summarizer.d.ts} +5 -5
- package/lib/summary/summarizer.d.ts.map +1 -0
- package/lib/summary/{summarizer.mjs → summarizer.js} +4 -4
- package/lib/summary/summarizer.js.map +1 -0
- package/lib/summary/{summarizerClientElection.d.mts → summarizerClientElection.d.ts} +3 -3
- package/lib/summary/summarizerClientElection.d.ts.map +1 -0
- package/lib/summary/{summarizerClientElection.mjs → summarizerClientElection.js} +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -0
- package/lib/summary/{summarizerHeuristics.d.mts → summarizerHeuristics.d.ts} +4 -4
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
- package/lib/summary/{summarizerHeuristics.mjs → summarizerHeuristics.js} +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -0
- package/lib/summary/summarizerNode/{index.d.mts → index.d.ts} +4 -4
- package/lib/summary/summarizerNode/index.d.ts.map +1 -0
- package/lib/summary/summarizerNode/index.js +7 -0
- package/lib/summary/summarizerNode/index.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.d.mts → summarizerNode.d.ts} +17 -6
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.mjs → summarizerNode.js} +34 -4
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.d.mts → summarizerNodeUtils.d.ts} +10 -2
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.mjs → summarizerNodeUtils.js} +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.d.mts → summarizerNodeWithGc.d.ts} +4 -5
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.mjs → summarizerNodeWithGc.js} +7 -7
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/lib/summary/{summarizerTypes.d.mts → summarizerTypes.d.ts} +10 -21
- package/lib/summary/summarizerTypes.d.ts.map +1 -0
- package/lib/summary/{summarizerTypes.mjs → summarizerTypes.js} +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -0
- package/lib/summary/{summaryCollection.d.mts → summaryCollection.d.ts} +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -0
- package/lib/summary/{summaryCollection.mjs → summaryCollection.js} +1 -1
- package/lib/summary/summaryCollection.js.map +1 -0
- package/lib/summary/{summaryFormat.d.mts → summaryFormat.d.ts} +16 -3
- package/lib/summary/summaryFormat.d.ts.map +1 -0
- package/lib/summary/{summaryFormat.mjs → summaryFormat.js} +1 -1
- package/lib/summary/summaryFormat.js.map +1 -0
- package/lib/summary/{summaryGenerator.d.mts → summaryGenerator.d.ts} +7 -6
- package/lib/summary/summaryGenerator.d.ts.map +1 -0
- package/lib/summary/{summaryGenerator.mjs → summaryGenerator.js} +11 -2
- package/lib/summary/summaryGenerator.js.map +1 -0
- package/lib/summary/{summaryManager.d.mts → summaryManager.d.ts} +6 -7
- package/lib/summary/summaryManager.d.ts.map +1 -0
- package/lib/summary/{summaryManager.mjs → summaryManager.js} +4 -5
- package/lib/summary/summaryManager.js.map +1 -0
- package/lib/test/batchTracker.spec.js +88 -0
- package/lib/test/batchTracker.spec.js.map +1 -0
- package/lib/test/blobManager.spec.js +835 -0
- package/lib/test/blobManager.spec.js.map +1 -0
- package/lib/test/channelCollection.spec.js +138 -0
- package/lib/test/channelCollection.spec.js.map +1 -0
- package/lib/test/containerRuntime.spec.js +1748 -0
- package/lib/test/containerRuntime.spec.js.map +1 -0
- package/lib/test/dataStoreContext.spec.js +771 -0
- package/lib/test/dataStoreContext.spec.js.map +1 -0
- package/lib/test/dataStoreCreation.spec.js +303 -0
- package/lib/test/dataStoreCreation.spec.js.map +1 -0
- package/lib/test/dataStoreRegistry.spec.js +26 -0
- package/lib/test/dataStoreRegistry.spec.js.map +1 -0
- package/lib/test/fuzz/fuzzUtils.js +66 -0
- package/lib/test/fuzz/fuzzUtils.js.map +1 -0
- package/lib/test/fuzz/summarizer.fuzz.spec.js +31 -0
- package/lib/test/fuzz/summarizer.fuzz.spec.js.map +1 -0
- package/lib/test/fuzz/summarizerFuzzMocks.js +162 -0
- package/lib/test/fuzz/summarizerFuzzMocks.js.map +1 -0
- package/lib/test/fuzz/summarizerFuzzSuite.js +106 -0
- package/lib/test/fuzz/summarizerFuzzSuite.js.map +1 -0
- package/lib/test/gc/garbageCollection.spec.js +1464 -0
- package/lib/test/gc/garbageCollection.spec.js.map +1 -0
- package/lib/test/gc/gcConfigs.spec.js +689 -0
- package/lib/test/gc/gcConfigs.spec.js.map +1 -0
- package/lib/test/gc/gcHelpers.spec.js +110 -0
- package/lib/test/gc/gcHelpers.spec.js.map +1 -0
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +68 -0
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +1 -0
- package/lib/test/gc/gcStats.spec.js +390 -0
- package/lib/test/gc/gcStats.spec.js.map +1 -0
- package/lib/test/gc/gcSummaryStateTracker.spec.js +228 -0
- package/lib/test/gc/gcSummaryStateTracker.spec.js.map +1 -0
- package/lib/test/gc/gcTelemetry.spec.js +530 -0
- package/lib/test/gc/gcTelemetry.spec.js.map +1 -0
- package/lib/test/gc/gcUnitTestHelpers.js +29 -0
- package/lib/test/gc/gcUnitTestHelpers.js.map +1 -0
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js +192 -0
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +1 -0
- package/lib/test/getPendingBlobs.spec.js +193 -0
- package/lib/test/getPendingBlobs.spec.js.map +1 -0
- package/lib/test/hardwareStats.spec.js +93 -0
- package/lib/test/hardwareStats.spec.js.map +1 -0
- package/lib/test/index.js +6 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/opLifecycle/OpGroupingManager.spec.js +225 -0
- package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +1 -0
- package/lib/test/opLifecycle/batchManager.spec.js +189 -0
- package/lib/test/opLifecycle/batchManager.spec.js.map +1 -0
- package/lib/test/opLifecycle/opCompressor.spec.js +74 -0
- package/lib/test/opLifecycle/opCompressor.spec.js.map +1 -0
- package/lib/test/opLifecycle/opDecompressor.spec.js +218 -0
- package/lib/test/opLifecycle/opDecompressor.spec.js.map +1 -0
- package/lib/test/opLifecycle/opSplitter.spec.js +272 -0
- package/lib/test/opLifecycle/opSplitter.spec.js.map +1 -0
- package/lib/test/opLifecycle/outbox.spec.js +675 -0
- package/lib/test/opLifecycle/outbox.spec.js.map +1 -0
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +196 -0
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +1 -0
- package/lib/test/pendingStateManager.spec.js +329 -0
- package/lib/test/pendingStateManager.spec.js.map +1 -0
- package/lib/test/scheduleManager.spec.js +270 -0
- package/lib/test/scheduleManager.spec.js.map +1 -0
- package/lib/test/summarizerNode.spec.js +326 -0
- package/lib/test/summarizerNode.spec.js.map +1 -0
- package/lib/test/summarizerNodeWithGc.spec.js +318 -0
- package/lib/test/summarizerNodeWithGc.spec.js.map +1 -0
- package/lib/test/summary/orderedClientElection.spec.js +535 -0
- package/lib/test/summary/orderedClientElection.spec.js.map +1 -0
- package/lib/test/summary/runningSummarizer.spec.js +1349 -0
- package/lib/test/summary/runningSummarizer.spec.js.map +1 -0
- package/lib/test/summary/summarizer.spec.js +29 -0
- package/lib/test/summary/summarizer.spec.js.map +1 -0
- package/lib/test/summary/summarizerClientElection.spec.js +436 -0
- package/lib/test/summary/summarizerClientElection.spec.js.map +1 -0
- package/lib/test/summary/summarizerHeuristics.spec.js +289 -0
- package/lib/test/summary/summarizerHeuristics.spec.js.map +1 -0
- package/lib/test/summary/summaryCollection.spec.js +200 -0
- package/lib/test/summary/summaryCollection.spec.js.map +1 -0
- package/lib/test/summary/summaryManager.spec.js +430 -0
- package/lib/test/summary/summaryManager.spec.js.map +1 -0
- package/lib/test/summary/testQuorumClients.js +34 -0
- package/lib/test/summary/testQuorumClients.js.map +1 -0
- package/lib/test/throttler.spec.js +175 -0
- package/lib/test/throttler.spec.js.map +1 -0
- package/lib/test/types/validateContainerRuntimePrevious.generated.js +180 -0
- package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +1 -0
- package/lib/{throttler.d.mts → throttler.d.ts} +1 -1
- package/lib/throttler.d.ts.map +1 -0
- package/lib/{throttler.mjs → throttler.js} +1 -1
- package/lib/throttler.js.map +1 -0
- package/package.json +101 -88
- package/src/batchTracker.ts +1 -1
- package/src/blobManager.ts +1 -15
- package/src/{dataStores.ts → channelCollection.ts} +629 -178
- package/src/connectionTelemetry.ts +42 -3
- package/src/containerHandleContext.ts +1 -1
- package/src/containerRuntime.ts +626 -430
- package/src/dataStore.ts +16 -15
- package/src/dataStoreContext.ts +376 -216
- package/src/dataStoreContexts.ts +2 -1
- package/src/dataStoreRegistry.ts +1 -0
- package/src/deltaManagerSummarizerProxy.ts +132 -7
- package/src/gc/garbageCollection.ts +84 -44
- package/src/gc/gcConfigs.ts +17 -7
- package/src/gc/gcDefinitions.ts +23 -13
- package/src/gc/gcHelpers.ts +2 -2
- package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
- package/src/gc/gcSummaryStateTracker.ts +19 -7
- package/src/gc/gcTelemetry.ts +9 -7
- package/src/gc/gcUnreferencedStateTracker.ts +1 -1
- package/src/gc/index.ts +10 -9
- package/src/index.ts +28 -27
- package/src/messageTypes.ts +3 -3
- package/src/opLifecycle/README.md +2 -4
- package/src/opLifecycle/batchManager.ts +2 -2
- package/src/opLifecycle/definitions.ts +2 -2
- package/src/opLifecycle/index.ts +8 -8
- package/src/opLifecycle/opCompressor.ts +3 -3
- package/src/opLifecycle/opDecompressor.ts +3 -3
- package/src/opLifecycle/opGroupingManager.ts +3 -12
- package/src/opLifecycle/opSplitter.ts +3 -3
- package/src/opLifecycle/outbox.ts +43 -16
- package/src/opLifecycle/remoteMessageProcessor.ts +10 -6
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +19 -13
- package/src/scheduleManager.ts +5 -4
- package/src/summary/index.ts +13 -12
- package/src/summary/orderedClientElection.ts +2 -1
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +52 -32
- package/src/summary/summarizer.ts +7 -7
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +3 -3
- package/src/summary/summarizerNode/index.ts +6 -3
- package/src/summary/summarizerNode/summarizerNode.ts +50 -5
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +14 -1
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -11
- package/src/summary/summarizerTypes.ts +11 -23
- package/src/summary/summaryFormat.ts +16 -2
- package/src/summary/summaryGenerator.ts +16 -4
- package/src/summary/summaryManager.ts +6 -7
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/dist/dataStores.d.ts +0 -151
- package/dist/dataStores.d.ts.map +0 -1
- package/dist/dataStores.js.map +0 -1
- package/dist/deltaManagerProxyBase.d.ts.map +0 -1
- package/dist/deltaManagerProxyBase.js +0 -77
- package/dist/deltaManagerProxyBase.js.map +0 -1
- package/lib/batchTracker.d.mts.map +0 -1
- package/lib/batchTracker.mjs.map +0 -1
- package/lib/blobManager.d.mts.map +0 -1
- package/lib/blobManager.mjs.map +0 -1
- package/lib/connectionTelemetry.d.mts.map +0 -1
- package/lib/connectionTelemetry.mjs.map +0 -1
- package/lib/containerHandleContext.d.mts.map +0 -1
- package/lib/containerHandleContext.mjs.map +0 -1
- package/lib/containerRuntime.d.mts.map +0 -1
- package/lib/containerRuntime.mjs.map +0 -1
- package/lib/dataStore.d.mts.map +0 -1
- package/lib/dataStore.mjs.map +0 -1
- package/lib/dataStoreContext.d.mts.map +0 -1
- package/lib/dataStoreContext.mjs.map +0 -1
- package/lib/dataStoreContexts.d.mts.map +0 -1
- package/lib/dataStoreContexts.mjs.map +0 -1
- package/lib/dataStoreRegistry.d.mts.map +0 -1
- package/lib/dataStoreRegistry.mjs.map +0 -1
- package/lib/dataStores.d.mts +0 -151
- package/lib/dataStores.d.mts.map +0 -1
- package/lib/dataStores.mjs.map +0 -1
- package/lib/deltaManagerProxyBase.d.mts +0 -35
- package/lib/deltaManagerProxyBase.d.mts.map +0 -1
- package/lib/deltaManagerProxyBase.mjs +0 -73
- package/lib/deltaManagerProxyBase.mjs.map +0 -1
- package/lib/deltaManagerSummarizerProxy.d.mts +0 -19
- package/lib/deltaManagerSummarizerProxy.d.mts.map +0 -1
- package/lib/deltaManagerSummarizerProxy.mjs +0 -38
- package/lib/deltaManagerSummarizerProxy.mjs.map +0 -1
- package/lib/deltaScheduler.d.mts.map +0 -1
- package/lib/deltaScheduler.mjs.map +0 -1
- package/lib/error.d.mts.map +0 -1
- package/lib/error.mjs.map +0 -1
- package/lib/gc/garbageCollection.d.mts.map +0 -1
- package/lib/gc/garbageCollection.mjs.map +0 -1
- package/lib/gc/gcConfigs.d.mts.map +0 -1
- package/lib/gc/gcConfigs.mjs.map +0 -1
- package/lib/gc/gcDefinitions.d.mts.map +0 -1
- package/lib/gc/gcDefinitions.mjs.map +0 -1
- package/lib/gc/gcHelpers.mjs.map +0 -1
- package/lib/gc/gcReferenceGraphAlgorithm.d.mts.map +0 -1
- package/lib/gc/gcReferenceGraphAlgorithm.mjs.map +0 -1
- package/lib/gc/gcSummaryDefinitions.d.mts.map +0 -1
- package/lib/gc/gcSummaryDefinitions.mjs.map +0 -1
- package/lib/gc/gcSummaryStateTracker.d.mts.map +0 -1
- package/lib/gc/gcSummaryStateTracker.mjs.map +0 -1
- package/lib/gc/gcTelemetry.d.mts.map +0 -1
- package/lib/gc/gcTelemetry.mjs.map +0 -1
- package/lib/gc/gcUnreferencedStateTracker.d.mts.map +0 -1
- package/lib/gc/gcUnreferencedStateTracker.mjs.map +0 -1
- package/lib/gc/index.d.mts +0 -13
- package/lib/gc/index.d.mts.map +0 -1
- package/lib/gc/index.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -25
- package/lib/index.mjs.map +0 -1
- package/lib/messageTypes.d.mts.map +0 -1
- package/lib/messageTypes.mjs.map +0 -1
- package/lib/metadata.d.mts.map +0 -1
- package/lib/metadata.mjs.map +0 -1
- package/lib/opLifecycle/batchManager.d.mts.map +0 -1
- package/lib/opLifecycle/batchManager.mjs.map +0 -1
- package/lib/opLifecycle/definitions.d.mts.map +0 -1
- package/lib/opLifecycle/definitions.mjs.map +0 -1
- package/lib/opLifecycle/index.d.mts +0 -13
- package/lib/opLifecycle/index.d.mts.map +0 -1
- package/lib/opLifecycle/index.mjs +0 -12
- package/lib/opLifecycle/index.mjs.map +0 -1
- package/lib/opLifecycle/opCompressor.d.mts.map +0 -1
- package/lib/opLifecycle/opCompressor.mjs.map +0 -1
- package/lib/opLifecycle/opDecompressor.d.mts.map +0 -1
- package/lib/opLifecycle/opDecompressor.mjs.map +0 -1
- package/lib/opLifecycle/opGroupingManager.d.mts.map +0 -1
- package/lib/opLifecycle/opGroupingManager.mjs.map +0 -1
- package/lib/opLifecycle/opSplitter.d.mts.map +0 -1
- package/lib/opLifecycle/opSplitter.mjs.map +0 -1
- package/lib/opLifecycle/outbox.d.mts.map +0 -1
- package/lib/opLifecycle/outbox.mjs.map +0 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.mts.map +0 -1
- package/lib/opLifecycle/remoteMessageProcessor.mjs.map +0 -1
- package/lib/opProperties.d.mts.map +0 -1
- package/lib/opProperties.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/pendingStateManager.d.mts.map +0 -1
- package/lib/pendingStateManager.mjs.map +0 -1
- package/lib/scheduleManager.d.mts.map +0 -1
- package/lib/scheduleManager.mjs.map +0 -1
- package/lib/storageServiceWithAttachBlobs.d.mts.map +0 -1
- package/lib/storageServiceWithAttachBlobs.mjs.map +0 -1
- package/lib/summary/index.d.mts.map +0 -1
- package/lib/summary/index.mjs.map +0 -1
- package/lib/summary/orderedClientElection.d.mts.map +0 -1
- package/lib/summary/orderedClientElection.mjs.map +0 -1
- package/lib/summary/runWhileConnectedCoordinator.d.mts.map +0 -1
- package/lib/summary/runWhileConnectedCoordinator.mjs.map +0 -1
- package/lib/summary/runningSummarizer.d.mts.map +0 -1
- package/lib/summary/runningSummarizer.mjs.map +0 -1
- package/lib/summary/summarizer.d.mts.map +0 -1
- package/lib/summary/summarizer.mjs.map +0 -1
- package/lib/summary/summarizerClientElection.d.mts.map +0 -1
- package/lib/summary/summarizerClientElection.mjs.map +0 -1
- package/lib/summary/summarizerHeuristics.d.mts.map +0 -1
- package/lib/summary/summarizerHeuristics.mjs.map +0 -1
- package/lib/summary/summarizerNode/index.d.mts.map +0 -1
- package/lib/summary/summarizerNode/index.mjs +0 -7
- package/lib/summary/summarizerNode/index.mjs.map +0 -1
- package/lib/summary/summarizerNode/summarizerNode.d.mts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNode.mjs.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.mjs.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs.map +0 -1
- package/lib/summary/summarizerTypes.d.mts.map +0 -1
- package/lib/summary/summarizerTypes.mjs.map +0 -1
- package/lib/summary/summaryCollection.d.mts.map +0 -1
- package/lib/summary/summaryCollection.mjs.map +0 -1
- package/lib/summary/summaryFormat.d.mts.map +0 -1
- package/lib/summary/summaryFormat.mjs.map +0 -1
- package/lib/summary/summaryGenerator.d.mts.map +0 -1
- package/lib/summary/summaryGenerator.mjs.map +0 -1
- package/lib/summary/summaryManager.d.mts.map +0 -1
- package/lib/summary/summaryManager.mjs.map +0 -1
- package/lib/throttler.d.mts.map +0 -1
- package/lib/throttler.mjs.map +0 -1
- package/src/deltaManagerProxyBase.ts +0 -111
package/src/dataStoreContext.ts
CHANGED
|
@@ -9,18 +9,15 @@ import {
|
|
|
9
9
|
IRequest,
|
|
10
10
|
IResponse,
|
|
11
11
|
IFluidHandle,
|
|
12
|
-
|
|
12
|
+
ITelemetryBaseProperties,
|
|
13
13
|
} from "@fluidframework/core-interfaces";
|
|
14
|
-
import {
|
|
15
|
-
IAudience,
|
|
16
|
-
IDeltaManager,
|
|
17
|
-
AttachState,
|
|
18
|
-
ILoaderOptions,
|
|
19
|
-
} from "@fluidframework/container-definitions";
|
|
14
|
+
import { IAudience, IDeltaManager, AttachState } from "@fluidframework/container-definitions";
|
|
20
15
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
21
|
-
import { assert,
|
|
16
|
+
import { assert, LazyPromise, unreachableCase } from "@fluidframework/core-utils";
|
|
22
17
|
import { IDocumentStorageService } from "@fluidframework/driver-definitions";
|
|
23
18
|
import { BlobTreeEntry, readAndParse } from "@fluidframework/driver-utils";
|
|
19
|
+
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
20
|
+
import { IEvent } from "@fluidframework/core-interfaces";
|
|
24
21
|
import {
|
|
25
22
|
IClientDetails,
|
|
26
23
|
IDocumentMessage,
|
|
@@ -29,17 +26,16 @@ import {
|
|
|
29
26
|
ISnapshotTree,
|
|
30
27
|
ITreeEntry,
|
|
31
28
|
} from "@fluidframework/protocol-definitions";
|
|
32
|
-
import { IContainerRuntime } from "@fluidframework/container-runtime-definitions";
|
|
33
29
|
import {
|
|
34
30
|
channelsTreeName,
|
|
35
31
|
CreateChildSummarizerNodeFn,
|
|
36
32
|
CreateChildSummarizerNodeParam,
|
|
37
33
|
FluidDataStoreRegistryEntry,
|
|
38
|
-
IAttachMessage,
|
|
39
34
|
IFluidDataStoreChannel,
|
|
40
35
|
IFluidDataStoreContext,
|
|
36
|
+
IFluidParentContext,
|
|
37
|
+
IContainerRuntimeBase,
|
|
41
38
|
IFluidDataStoreContextDetached,
|
|
42
|
-
IFluidDataStoreContextEvents,
|
|
43
39
|
IFluidDataStoreRegistry,
|
|
44
40
|
IGarbageCollectionData,
|
|
45
41
|
IGarbageCollectionDetailsBase,
|
|
@@ -50,22 +46,22 @@ import {
|
|
|
50
46
|
ISummarizerNodeWithGC,
|
|
51
47
|
SummarizeInternalFn,
|
|
52
48
|
ITelemetryContext,
|
|
53
|
-
|
|
49
|
+
ISummaryTreeWithStats,
|
|
50
|
+
IDataStore,
|
|
51
|
+
gcDataBlobKey,
|
|
54
52
|
} from "@fluidframework/runtime-definitions";
|
|
55
|
-
import { addBlobToSummary
|
|
53
|
+
import { addBlobToSummary } from "@fluidframework/runtime-utils";
|
|
56
54
|
import {
|
|
57
55
|
createChildMonitoringContext,
|
|
58
56
|
DataCorruptionError,
|
|
59
57
|
DataProcessingError,
|
|
60
58
|
extractSafePropertiesFromMessage,
|
|
61
59
|
generateStack,
|
|
62
|
-
ITelemetryLoggerExt,
|
|
63
60
|
LoggingError,
|
|
64
61
|
MonitoringContext,
|
|
65
62
|
tagCodeArtifacts,
|
|
66
63
|
ThresholdCounter,
|
|
67
64
|
} from "@fluidframework/telemetry-utils";
|
|
68
|
-
import { IIdCompressor, IIdCompressorCore } from "@fluidframework/id-compressor";
|
|
69
65
|
import {
|
|
70
66
|
dataStoreAttributesBlobName,
|
|
71
67
|
hasIsolatedChannels,
|
|
@@ -75,9 +71,8 @@ import {
|
|
|
75
71
|
getAttributesFormatVersion,
|
|
76
72
|
getFluidDataStoreAttributes,
|
|
77
73
|
summarizerClientType,
|
|
78
|
-
} from "./summary";
|
|
79
|
-
import {
|
|
80
|
-
import { detectOutboundRoutesViaDDSKey, sendGCUnexpectedUsageEvent } from "./gc";
|
|
74
|
+
} from "./summary/index.js";
|
|
75
|
+
import { detectOutboundRoutesViaDDSKey, sendGCUnexpectedUsageEvent } from "./gc/index.js";
|
|
81
76
|
|
|
82
77
|
function createAttributes(
|
|
83
78
|
pkg: readonly string[],
|
|
@@ -95,33 +90,57 @@ export function createAttributesBlob(pkg: readonly string[], isRootDataStore: bo
|
|
|
95
90
|
return new BlobTreeEntry(dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
96
91
|
}
|
|
97
92
|
|
|
98
|
-
|
|
93
|
+
/** @internal */
|
|
94
|
+
export interface ISnapshotDetails {
|
|
99
95
|
pkg: readonly string[];
|
|
100
96
|
isRootDataStore: boolean;
|
|
101
97
|
snapshot?: ISnapshotTree;
|
|
98
|
+
sequenceNumber?: number;
|
|
102
99
|
}
|
|
103
100
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
101
|
+
/**
|
|
102
|
+
* This is interface that every context should implement.
|
|
103
|
+
* This interface is used for context's parent - ChannelCollection.
|
|
104
|
+
* It should not be exposed to any other users of context.
|
|
105
|
+
* @internal
|
|
106
|
+
*/
|
|
107
|
+
export interface IFluidDataStoreContextInternal extends IFluidDataStoreContext {
|
|
108
|
+
getAttachData(
|
|
109
|
+
includeGCData: boolean,
|
|
110
|
+
telemetryContext?: ITelemetryContext,
|
|
111
|
+
): {
|
|
112
|
+
attachSummary: ISummaryTreeWithStats;
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
117
|
+
|
|
118
|
+
realize(): Promise<IFluidDataStoreChannel>;
|
|
119
|
+
|
|
120
|
+
isRoot(): Promise<boolean>;
|
|
107
121
|
}
|
|
108
122
|
|
|
109
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Properties necessary for creating a FluidDataStoreContext
|
|
125
|
+
* @internal
|
|
126
|
+
*/
|
|
110
127
|
export interface IFluidDataStoreContextProps {
|
|
111
128
|
readonly id: string;
|
|
112
|
-
readonly
|
|
129
|
+
readonly parentContext: IFluidParentContext;
|
|
113
130
|
readonly storage: IDocumentStorageService;
|
|
114
131
|
readonly scope: FluidObject;
|
|
115
132
|
readonly createSummarizerNodeFn: CreateChildSummarizerNodeFn;
|
|
116
133
|
readonly pkg?: Readonly<string[]>;
|
|
117
|
-
readonly
|
|
134
|
+
readonly loadingGroupId?: string;
|
|
118
135
|
}
|
|
119
136
|
|
|
120
|
-
/**
|
|
137
|
+
/**
|
|
138
|
+
* Properties necessary for creating a local FluidDataStoreContext
|
|
139
|
+
* @internal
|
|
140
|
+
*/
|
|
121
141
|
export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
122
142
|
readonly pkg: Readonly<string[]> | undefined;
|
|
123
143
|
readonly snapshotTree: ISnapshotTree | undefined;
|
|
124
|
-
readonly isRootDataStore: boolean | undefined;
|
|
125
144
|
readonly makeLocallyVisibleFn: () => void;
|
|
126
145
|
/**
|
|
127
146
|
* @deprecated 0.16 Issue #1635, #3631
|
|
@@ -129,57 +148,76 @@ export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContext
|
|
|
129
148
|
readonly createProps?: any;
|
|
130
149
|
}
|
|
131
150
|
|
|
132
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* Properties necessary for creating a local FluidDataStoreContext
|
|
153
|
+
* @internal
|
|
154
|
+
*/
|
|
155
|
+
export interface ILocalDetachedFluidDataStoreContextProps extends ILocalFluidDataStoreContextProps {
|
|
156
|
+
readonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Properties necessary for creating a remote FluidDataStoreContext
|
|
161
|
+
* @internal
|
|
162
|
+
*/
|
|
133
163
|
export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
134
164
|
readonly snapshotTree: ISnapshotTree | undefined;
|
|
135
165
|
}
|
|
136
166
|
|
|
167
|
+
// back-compat: To be removed in the future.
|
|
168
|
+
// Added in "2.0.0-rc.2.0.0" timeframe (to support older builds).
|
|
169
|
+
/** @internal */
|
|
170
|
+
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
171
|
+
(event: "attaching" | "attached", listener: () => void);
|
|
172
|
+
}
|
|
173
|
+
|
|
137
174
|
/**
|
|
138
175
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
176
|
+
* @internal
|
|
139
177
|
*/
|
|
140
178
|
export abstract class FluidDataStoreContext
|
|
141
179
|
extends TypedEventEmitter<IFluidDataStoreContextEvents>
|
|
142
|
-
implements
|
|
180
|
+
implements IFluidDataStoreContextInternal, IFluidParentContext, IDisposable
|
|
143
181
|
{
|
|
144
182
|
public get packagePath(): readonly string[] {
|
|
145
183
|
assert(this.pkg !== undefined, 0x139 /* "Undefined package path" */);
|
|
146
184
|
return this.pkg;
|
|
147
185
|
}
|
|
148
186
|
|
|
149
|
-
public get options():
|
|
150
|
-
return this.
|
|
187
|
+
public get options(): Record<string | number, any> {
|
|
188
|
+
return this.parentContext.options;
|
|
151
189
|
}
|
|
152
190
|
|
|
153
191
|
public get clientId(): string | undefined {
|
|
154
|
-
return this.
|
|
192
|
+
return this.parentContext.clientId;
|
|
155
193
|
}
|
|
156
194
|
|
|
157
195
|
public get clientDetails(): IClientDetails {
|
|
158
|
-
return this.
|
|
196
|
+
return this.parentContext.clientDetails;
|
|
159
197
|
}
|
|
160
198
|
|
|
161
|
-
public get logger()
|
|
162
|
-
return this.
|
|
199
|
+
public get logger() {
|
|
200
|
+
return this.parentContext.logger;
|
|
163
201
|
}
|
|
164
202
|
|
|
165
203
|
public get deltaManager(): IDeltaManager<ISequencedDocumentMessage, IDocumentMessage> {
|
|
166
|
-
return this.
|
|
204
|
+
return this.parentContext.deltaManager;
|
|
167
205
|
}
|
|
168
206
|
|
|
169
207
|
public get connected(): boolean {
|
|
170
|
-
return this.
|
|
208
|
+
return this.parentContext.connected;
|
|
171
209
|
}
|
|
172
210
|
|
|
173
211
|
public get IFluidHandleContext() {
|
|
174
|
-
return this.
|
|
212
|
+
return this.parentContext.IFluidHandleContext;
|
|
175
213
|
}
|
|
176
214
|
|
|
177
|
-
public get containerRuntime():
|
|
215
|
+
public get containerRuntime(): IContainerRuntimeBase {
|
|
178
216
|
return this._containerRuntime;
|
|
179
217
|
}
|
|
180
218
|
|
|
181
219
|
public ensureNoDataModelChanges<T>(callback: () => T): T {
|
|
182
|
-
return this.
|
|
220
|
+
return this.parentContext.ensureNoDataModelChanges(callback);
|
|
183
221
|
}
|
|
184
222
|
|
|
185
223
|
public get isLoaded(): boolean {
|
|
@@ -190,8 +228,8 @@ export abstract class FluidDataStoreContext
|
|
|
190
228
|
return this._baseSnapshot;
|
|
191
229
|
}
|
|
192
230
|
|
|
193
|
-
public get idCompressor():
|
|
194
|
-
return this.
|
|
231
|
+
public get idCompressor(): IIdCompressor | undefined {
|
|
232
|
+
return this.parentContext.idCompressor;
|
|
195
233
|
}
|
|
196
234
|
|
|
197
235
|
private _disposed = false;
|
|
@@ -208,10 +246,11 @@ export abstract class FluidDataStoreContext
|
|
|
208
246
|
return this._tombstoned;
|
|
209
247
|
}
|
|
210
248
|
/** If true, throw an error when a tombstone data store is used. */
|
|
211
|
-
|
|
249
|
+
public readonly gcThrowOnTombstoneUsage: boolean;
|
|
250
|
+
public readonly gcTombstoneEnforcementAllowed: boolean;
|
|
212
251
|
|
|
213
252
|
/** If true, this means that this data store context and its children have been removed from the runtime */
|
|
214
|
-
|
|
253
|
+
protected deleted: boolean = false;
|
|
215
254
|
|
|
216
255
|
public get attachState(): AttachState {
|
|
217
256
|
return this._attachState;
|
|
@@ -221,6 +260,8 @@ export abstract class FluidDataStoreContext
|
|
|
221
260
|
return this.registry;
|
|
222
261
|
}
|
|
223
262
|
|
|
263
|
+
private baseSnapshotSequenceNumber: number | undefined;
|
|
264
|
+
|
|
224
265
|
/**
|
|
225
266
|
* A datastore is considered as root if it
|
|
226
267
|
* 1. is root in memory - see isInMemoryRoot
|
|
@@ -248,8 +289,8 @@ export abstract class FluidDataStoreContext
|
|
|
248
289
|
protected channel: IFluidDataStoreChannel | undefined;
|
|
249
290
|
private loaded = false;
|
|
250
291
|
protected pending: ISequencedDocumentMessage[] | undefined = [];
|
|
251
|
-
protected
|
|
252
|
-
|
|
292
|
+
protected channelP: Promise<IFluidDataStoreChannel> | undefined;
|
|
293
|
+
protected _baseSnapshot: ISnapshotTree | undefined;
|
|
253
294
|
protected _attachState: AttachState;
|
|
254
295
|
private _isInMemoryRoot: boolean = false;
|
|
255
296
|
protected readonly summarizerNode: ISummarizerNodeWithGC;
|
|
@@ -269,11 +310,12 @@ export abstract class FluidDataStoreContext
|
|
|
269
310
|
private lastUsedRoutes: string[] | undefined;
|
|
270
311
|
|
|
271
312
|
public readonly id: string;
|
|
272
|
-
private readonly _containerRuntime:
|
|
313
|
+
private readonly _containerRuntime: IContainerRuntimeBase;
|
|
314
|
+
private readonly parentContext: IFluidParentContext;
|
|
273
315
|
public readonly storage: IDocumentStorageService;
|
|
274
316
|
public readonly scope: FluidObject;
|
|
275
317
|
// Represents the group to which the data store belongs too.
|
|
276
|
-
public readonly
|
|
318
|
+
public readonly loadingGroupId: string | undefined;
|
|
277
319
|
protected pkg?: readonly string[];
|
|
278
320
|
|
|
279
321
|
constructor(
|
|
@@ -284,20 +326,21 @@ export abstract class FluidDataStoreContext
|
|
|
284
326
|
) {
|
|
285
327
|
super();
|
|
286
328
|
|
|
287
|
-
this._containerRuntime = props.
|
|
329
|
+
this._containerRuntime = props.parentContext.containerRuntime;
|
|
330
|
+
this.parentContext = props.parentContext;
|
|
288
331
|
this.id = props.id;
|
|
289
332
|
this.storage = props.storage;
|
|
290
333
|
this.scope = props.scope;
|
|
291
334
|
this.pkg = props.pkg;
|
|
292
|
-
this.
|
|
335
|
+
this.loadingGroupId = props.loadingGroupId;
|
|
293
336
|
|
|
294
337
|
// URIs use slashes as delimiters. Handles use URIs.
|
|
295
338
|
// Thus having slashes in types almost guarantees trouble down the road!
|
|
296
339
|
assert(!this.id.includes("/"), 0x13a /* Data store ID contains slash */);
|
|
297
340
|
|
|
298
341
|
this._attachState =
|
|
299
|
-
this.
|
|
300
|
-
? this.
|
|
342
|
+
this.parentContext.attachState !== AttachState.Detached && this.existing
|
|
343
|
+
? this.parentContext.attachState
|
|
301
344
|
: AttachState.Detached;
|
|
302
345
|
|
|
303
346
|
const thisSummarizeInternal = async (
|
|
@@ -328,7 +371,8 @@ export abstract class FluidDataStoreContext
|
|
|
328
371
|
this.mc.logger,
|
|
329
372
|
);
|
|
330
373
|
|
|
331
|
-
this.
|
|
374
|
+
this.gcThrowOnTombstoneUsage = this.parentContext.gcThrowOnTombstoneUsage;
|
|
375
|
+
this.gcTombstoneEnforcementAllowed = this.parentContext.gcTombstoneEnforcementAllowed;
|
|
332
376
|
|
|
333
377
|
// By default, a data store can log maximum 10 local changes telemetry in summarizer.
|
|
334
378
|
this.localChangesTelemetryCount =
|
|
@@ -342,9 +386,9 @@ export abstract class FluidDataStoreContext
|
|
|
342
386
|
this._disposed = true;
|
|
343
387
|
|
|
344
388
|
// Dispose any pending runtime after it gets fulfilled
|
|
345
|
-
// Errors are logged where this.
|
|
346
|
-
if (this.
|
|
347
|
-
this.
|
|
389
|
+
// Errors are logged where this.channelP is consumed/generated (realizeCore(), bindRuntime())
|
|
390
|
+
if (this.channelP) {
|
|
391
|
+
this.channelP
|
|
348
392
|
.then((runtime) => {
|
|
349
393
|
runtime.dispose();
|
|
350
394
|
})
|
|
@@ -369,6 +413,8 @@ export abstract class FluidDataStoreContext
|
|
|
369
413
|
this._tombstoned = tombstone;
|
|
370
414
|
}
|
|
371
415
|
|
|
416
|
+
public abstract setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
417
|
+
|
|
372
418
|
private rejectDeferredRealize(
|
|
373
419
|
reason: string,
|
|
374
420
|
failedPkgPath?: string,
|
|
@@ -385,9 +431,8 @@ export abstract class FluidDataStoreContext
|
|
|
385
431
|
|
|
386
432
|
public async realize(): Promise<IFluidDataStoreChannel> {
|
|
387
433
|
assert(!this.detachedRuntimeCreation, 0x13d /* "Detached runtime creation on realize()" */);
|
|
388
|
-
if (!this.
|
|
389
|
-
this.
|
|
390
|
-
this.realizeCore(this.existing).catch((error) => {
|
|
434
|
+
if (!this.channelP) {
|
|
435
|
+
this.channelP = this.realizeCore(this.existing).catch((error) => {
|
|
391
436
|
const errorWrapped = DataProcessingError.wrapIfUnrecognized(
|
|
392
437
|
error,
|
|
393
438
|
"realizeFluidDataStoreContext",
|
|
@@ -398,22 +443,22 @@ export abstract class FluidDataStoreContext
|
|
|
398
443
|
fluidDataStoreId: this.id,
|
|
399
444
|
}),
|
|
400
445
|
);
|
|
401
|
-
this.channelDeferred?.reject(errorWrapped);
|
|
402
446
|
this.mc.logger.sendErrorEvent({ eventName: "RealizeError" }, errorWrapped);
|
|
447
|
+
throw errorWrapped;
|
|
403
448
|
});
|
|
404
449
|
}
|
|
405
|
-
return this.
|
|
450
|
+
return this.channelP;
|
|
406
451
|
}
|
|
407
452
|
|
|
408
|
-
protected async factoryFromPackagePath(
|
|
409
|
-
|
|
453
|
+
protected async factoryFromPackagePath() {
|
|
454
|
+
const packages = this.pkg;
|
|
410
455
|
if (packages === undefined) {
|
|
411
456
|
this.rejectDeferredRealize("packages is undefined");
|
|
412
457
|
}
|
|
413
458
|
|
|
414
459
|
let entry: FluidDataStoreRegistryEntry | undefined;
|
|
415
460
|
let registry: IFluidDataStoreRegistry | undefined =
|
|
416
|
-
this.
|
|
461
|
+
this.parentContext.IFluidDataStoreRegistry;
|
|
417
462
|
let lastPkg: string | undefined;
|
|
418
463
|
for (const pkg of packages) {
|
|
419
464
|
if (!registry) {
|
|
@@ -435,33 +480,33 @@ export abstract class FluidDataStoreContext
|
|
|
435
480
|
this.rejectDeferredRealize("Can't find factory for package", lastPkg, packages);
|
|
436
481
|
}
|
|
437
482
|
|
|
438
|
-
|
|
483
|
+
assert(this.registry === undefined, 0x157 /* "datastore registry already attached" */);
|
|
484
|
+
this.registry = registry;
|
|
485
|
+
|
|
486
|
+
return factory;
|
|
439
487
|
}
|
|
440
488
|
|
|
441
|
-
private async realizeCore(existing: boolean)
|
|
489
|
+
private async realizeCore(existing: boolean) {
|
|
442
490
|
const details = await this.getInitialSnapshotDetails();
|
|
443
491
|
// Base snapshot is the baseline where pending ops are applied to.
|
|
444
492
|
// It is important that this be in sync with the pending ops, and also
|
|
445
493
|
// that it is set here, before bindRuntime is called.
|
|
446
494
|
this._baseSnapshot = details.snapshot;
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const { factory, registry } = await this.factoryFromPackagePath(packages);
|
|
495
|
+
this.baseSnapshotSequenceNumber = details.sequenceNumber;
|
|
496
|
+
assert(this.pkg === details.pkg, 0x13e /* "Unexpected package path" */);
|
|
450
497
|
|
|
451
|
-
|
|
452
|
-
this.registry === undefined,
|
|
453
|
-
0x13f /* "datastore context registry is already set" */,
|
|
454
|
-
);
|
|
455
|
-
this.registry = registry;
|
|
498
|
+
const factory = await this.factoryFromPackagePath();
|
|
456
499
|
|
|
457
500
|
const channel = await factory.instantiateDataStore(this, existing);
|
|
458
501
|
assert(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
|
|
459
|
-
this.bindRuntime(channel);
|
|
502
|
+
await this.bindRuntime(channel, existing);
|
|
460
503
|
// This data store may have been disposed before the channel is created during realization. If so,
|
|
461
504
|
// dispose the channel now.
|
|
462
505
|
if (this.disposed) {
|
|
463
506
|
channel.dispose();
|
|
464
507
|
}
|
|
508
|
+
|
|
509
|
+
return channel;
|
|
465
510
|
}
|
|
466
511
|
|
|
467
512
|
/**
|
|
@@ -486,28 +531,21 @@ export abstract class FluidDataStoreContext
|
|
|
486
531
|
}
|
|
487
532
|
|
|
488
533
|
public process(
|
|
489
|
-
|
|
534
|
+
message: ISequencedDocumentMessage,
|
|
490
535
|
local: boolean,
|
|
491
536
|
localOpMetadata: unknown,
|
|
492
537
|
): void {
|
|
493
|
-
const safeTelemetryProps = extractSafePropertiesFromMessage(
|
|
538
|
+
const safeTelemetryProps = extractSafePropertiesFromMessage(message);
|
|
494
539
|
// On op process, tombstone error is logged in garbage collector. So, set "checkTombstone" to false when calling
|
|
495
540
|
// "verifyNotClosed" which logs tombstone errors. Throw error if tombstoned and throwing on load is configured.
|
|
496
541
|
this.verifyNotClosed("process", false /* checkTombstone */, safeTelemetryProps);
|
|
497
|
-
if (this.tombstoned && this.
|
|
542
|
+
if (this.tombstoned && this.gcThrowOnTombstoneUsage) {
|
|
498
543
|
throw new DataCorruptionError(
|
|
499
544
|
"Context is tombstoned! Call site [process]",
|
|
500
545
|
safeTelemetryProps,
|
|
501
546
|
);
|
|
502
547
|
}
|
|
503
548
|
|
|
504
|
-
const innerContents = messageArg.contents as FluidDataStoreMessage;
|
|
505
|
-
const message = {
|
|
506
|
-
...messageArg,
|
|
507
|
-
type: innerContents.type,
|
|
508
|
-
contents: innerContents.content,
|
|
509
|
-
};
|
|
510
|
-
|
|
511
549
|
this.summarizerNode.recordChange(message);
|
|
512
550
|
|
|
513
551
|
if (this.loaded) {
|
|
@@ -532,11 +570,11 @@ export abstract class FluidDataStoreContext
|
|
|
532
570
|
}
|
|
533
571
|
|
|
534
572
|
public getQuorum(): IQuorumClients {
|
|
535
|
-
return this.
|
|
573
|
+
return this.parentContext.getQuorum();
|
|
536
574
|
}
|
|
537
575
|
|
|
538
576
|
public getAudience(): IAudience {
|
|
539
|
-
return this.
|
|
577
|
+
return this.parentContext.getAudience();
|
|
540
578
|
}
|
|
541
579
|
|
|
542
580
|
/**
|
|
@@ -584,6 +622,11 @@ export abstract class FluidDataStoreContext
|
|
|
584
622
|
summarizeResult.stats.unreferencedBlobSize = summarizeResult.stats.totalBlobSize;
|
|
585
623
|
}
|
|
586
624
|
|
|
625
|
+
// Add loadingGroupId to the summary
|
|
626
|
+
if (this.loadingGroupId !== undefined) {
|
|
627
|
+
summarizeResult.summary.groupId = this.loadingGroupId;
|
|
628
|
+
}
|
|
629
|
+
|
|
587
630
|
return {
|
|
588
631
|
...summarizeResult,
|
|
589
632
|
id: this.id,
|
|
@@ -653,9 +696,11 @@ export abstract class FluidDataStoreContext
|
|
|
653
696
|
}
|
|
654
697
|
|
|
655
698
|
/**
|
|
656
|
-
* @deprecated There is no replacement for this, its functionality is no longer needed.
|
|
699
|
+
* @deprecated There is no replacement for this, its functionality is no longer needed at this layer.
|
|
657
700
|
* It will be removed in a future release, sometime after 2.0.0-internal.8.0.0
|
|
658
701
|
*
|
|
702
|
+
* Similar capability is exposed with from/to string paths instead of handles via @see addedGCOutboundRoute
|
|
703
|
+
*
|
|
659
704
|
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
660
705
|
* all references added in the system.
|
|
661
706
|
* @param srcHandle - The handle of the node that added the reference.
|
|
@@ -665,10 +710,26 @@ export abstract class FluidDataStoreContext
|
|
|
665
710
|
// By default, skip this call since the ContainerRuntime will detect the outbound route directly.
|
|
666
711
|
if (this.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) === true) {
|
|
667
712
|
// Note: The ContainerRuntime code will check this same setting to avoid double counting.
|
|
668
|
-
this.
|
|
713
|
+
this.parentContext.addedGCOutboundReference?.(srcHandle, outboundHandle);
|
|
669
714
|
}
|
|
670
715
|
}
|
|
671
716
|
|
|
717
|
+
/**
|
|
718
|
+
* (Same as @see addedGCOutboundReference, but with string paths instead of handles)
|
|
719
|
+
*
|
|
720
|
+
* Called when a new outbound reference is added to another node. This is used by garbage collection to identify
|
|
721
|
+
* all references added in the system.
|
|
722
|
+
*
|
|
723
|
+
* @param fromPath - The absolute path of the node that added the reference.
|
|
724
|
+
* @param toPath - The absolute path of the outbound node that is referenced.
|
|
725
|
+
*/
|
|
726
|
+
public addedGCOutboundRoute(fromPath: string, toPath: string) {
|
|
727
|
+
this.parentContext.addedGCOutboundReference?.(
|
|
728
|
+
{ absolutePath: fromPath },
|
|
729
|
+
{ absolutePath: toPath },
|
|
730
|
+
);
|
|
731
|
+
}
|
|
732
|
+
|
|
672
733
|
/**
|
|
673
734
|
* Updates the used routes of the channel and its child contexts. The channel must be loaded before calling this.
|
|
674
735
|
* It is called in these two scenarios:
|
|
@@ -705,15 +766,10 @@ export abstract class FluidDataStoreContext
|
|
|
705
766
|
public submitMessage(type: string, content: any, localOpMetadata: unknown): void {
|
|
706
767
|
this.verifyNotClosed("submitMessage");
|
|
707
768
|
assert(!!this.channel, 0x146 /* "Channel must exist when submitting message" */);
|
|
708
|
-
const fluidDataStoreContent: FluidDataStoreMessage = {
|
|
709
|
-
content,
|
|
710
|
-
type,
|
|
711
|
-
};
|
|
712
|
-
|
|
713
769
|
// Summarizer clients should not submit messages.
|
|
714
770
|
this.identifyLocalChangeInSummarizer("DataStoreMessageSubmittedInSummarizer", type);
|
|
715
771
|
|
|
716
|
-
this.
|
|
772
|
+
this.parentContext.submitMessage(type, content, localOpMetadata);
|
|
717
773
|
}
|
|
718
774
|
|
|
719
775
|
/**
|
|
@@ -750,7 +806,7 @@ export abstract class FluidDataStoreContext
|
|
|
750
806
|
this.verifyNotClosed("submitSignal");
|
|
751
807
|
|
|
752
808
|
assert(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
|
|
753
|
-
return this.
|
|
809
|
+
return this.parentContext.submitSignal(type, content, targetClientId);
|
|
754
810
|
}
|
|
755
811
|
|
|
756
812
|
/**
|
|
@@ -759,75 +815,97 @@ export abstract class FluidDataStoreContext
|
|
|
759
815
|
*/
|
|
760
816
|
public makeLocallyVisible() {
|
|
761
817
|
assert(this.channel !== undefined, 0x2cf /* "undefined channel on datastore context" */);
|
|
762
|
-
assert(
|
|
763
|
-
this.channel.visibilityState === VisibilityState.LocallyVisible,
|
|
764
|
-
0x590 /* Channel must be locally visible */,
|
|
765
|
-
);
|
|
766
818
|
this.makeLocallyVisibleFn();
|
|
767
819
|
}
|
|
768
820
|
|
|
769
|
-
protected
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}
|
|
773
|
-
|
|
774
|
-
try {
|
|
775
|
-
assert(
|
|
776
|
-
!this.detachedRuntimeCreation,
|
|
777
|
-
0x148 /* "Detached runtime creation on runtime bind" */,
|
|
778
|
-
);
|
|
779
|
-
assert(this.channelDeferred !== undefined, 0x149 /* "Undefined channel deferral" */);
|
|
780
|
-
assert(this.pkg !== undefined, 0x14a /* "Undefined package path" */);
|
|
781
|
-
|
|
782
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
783
|
-
const pending = this.pending!;
|
|
821
|
+
protected processPendingOps(channel: IFluidDataStoreChannel) {
|
|
822
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
823
|
+
const pending = this.pending!;
|
|
784
824
|
|
|
785
|
-
|
|
786
|
-
|
|
825
|
+
// Apply all pending ops
|
|
826
|
+
for (const op of pending) {
|
|
827
|
+
// Only process ops whose seq number is greater than snapshot sequence number from which it loaded.
|
|
828
|
+
const seqNumber = this.baseSnapshotSequenceNumber ?? -1;
|
|
829
|
+
if (op.sequenceNumber > seqNumber) {
|
|
787
830
|
channel.process(op, false, undefined /* localOpMetadata */);
|
|
788
831
|
}
|
|
832
|
+
}
|
|
833
|
+
this.pending = undefined;
|
|
789
834
|
|
|
790
|
-
|
|
791
|
-
|
|
835
|
+
this.thresholdOpsCounter.send("ProcessPendingOps", pending.length);
|
|
836
|
+
}
|
|
792
837
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
838
|
+
protected completeBindingRuntime(channel: IFluidDataStoreChannel) {
|
|
839
|
+
// And now mark the runtime active
|
|
840
|
+
this.loaded = true;
|
|
841
|
+
this.channel = channel;
|
|
796
842
|
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
843
|
+
// Channel does not know when it's "live" (as in - starts to receive events in the system)
|
|
844
|
+
// It may read current state of the system when channel was created, but it was not getting any updates
|
|
845
|
+
// through creation process and could have missed events. So update it on current state.
|
|
846
|
+
// Once this.loaded is set (above), it will stat receiving events.
|
|
847
|
+
channel.setConnectionState(this.connected, this.clientId);
|
|
800
848
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
* per the last time GC was run.
|
|
805
|
-
* Also, this data store may have been realized during summarize. In that case, the child contexts need to
|
|
806
|
-
* have their used routes updated to determine if its needs to summarize again and to add it to the summary.
|
|
807
|
-
*/
|
|
808
|
-
this.updateChannelUsedRoutes();
|
|
849
|
+
// Freeze the package path to ensure that someone doesn't modify it when it is
|
|
850
|
+
// returned in packagePath().
|
|
851
|
+
Object.freeze(this.pkg);
|
|
809
852
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
853
|
+
/**
|
|
854
|
+
* Update the used routes of the channel. If GC has run before this data store was realized, we will have
|
|
855
|
+
* the used routes saved. So, this will ensure that all the child contexts have up-to-date used routes as
|
|
856
|
+
* per the last time GC was run.
|
|
857
|
+
* Also, this data store may have been realized during summarize. In that case, the child contexts need to
|
|
858
|
+
* have their used routes updated to determine if its needs to summarize again and to add it to the summary.
|
|
859
|
+
*/
|
|
860
|
+
this.updateChannelUsedRoutes();
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
protected async bindRuntime(channel: IFluidDataStoreChannel, existing: boolean) {
|
|
864
|
+
if (this.channel) {
|
|
865
|
+
throw new Error("Runtime already bound");
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
assert(
|
|
869
|
+
!this.detachedRuntimeCreation,
|
|
870
|
+
0x148 /* "Detached runtime creation on runtime bind" */,
|
|
871
|
+
);
|
|
872
|
+
assert(this.pkg !== undefined, 0x14a /* "Undefined package path" */);
|
|
873
|
+
|
|
874
|
+
if (!existing) {
|
|
875
|
+
// Execute data store's entry point to make sure that for a local (aka detached from container) data store, the
|
|
876
|
+
// entryPoint initialization function is called before the data store gets attached and potentially connected to
|
|
877
|
+
// the delta stream, so it gets a chance to do things while the data store is still "purely local".
|
|
878
|
+
// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method
|
|
879
|
+
// of data store factories tends to construct the data object (at least kick off an async method that returns
|
|
880
|
+
// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
|
|
881
|
+
// before the data store is attached.
|
|
882
|
+
await channel.entryPoint.get();
|
|
820
883
|
}
|
|
884
|
+
|
|
885
|
+
this.processPendingOps(channel);
|
|
886
|
+
this.completeBindingRuntime(channel);
|
|
821
887
|
}
|
|
822
888
|
|
|
823
889
|
public async getAbsoluteUrl(relativeUrl: string): Promise<string | undefined> {
|
|
824
890
|
if (this.attachState !== AttachState.Attached) {
|
|
825
891
|
return undefined;
|
|
826
892
|
}
|
|
827
|
-
return this.
|
|
893
|
+
return this.parentContext.getAbsoluteUrl(relativeUrl);
|
|
828
894
|
}
|
|
829
895
|
|
|
830
|
-
|
|
896
|
+
/**
|
|
897
|
+
* Get the data required when attaching this context's DataStore.
|
|
898
|
+
* Used for both Container Attach and DataStore Attach.
|
|
899
|
+
*
|
|
900
|
+
* @returns the summary, type, and GC Data for this context's DataStore.
|
|
901
|
+
*/
|
|
902
|
+
public abstract getAttachData(
|
|
903
|
+
includeGCData: boolean,
|
|
904
|
+
telemetryContext?: ITelemetryContext,
|
|
905
|
+
): {
|
|
906
|
+
attachSummary: ISummaryTreeWithStats;
|
|
907
|
+
type: string;
|
|
908
|
+
};
|
|
831
909
|
|
|
832
910
|
public abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
833
911
|
|
|
@@ -847,21 +925,19 @@ export abstract class FluidDataStoreContext
|
|
|
847
925
|
return {};
|
|
848
926
|
}
|
|
849
927
|
|
|
850
|
-
public reSubmit(contents: any, localOpMetadata: unknown) {
|
|
928
|
+
public reSubmit(type: string, contents: any, localOpMetadata: unknown) {
|
|
851
929
|
assert(!!this.channel, 0x14b /* "Channel must exist when resubmitting ops" */);
|
|
852
|
-
|
|
853
|
-
this.channel.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
|
|
930
|
+
this.channel.reSubmit(type, contents, localOpMetadata);
|
|
854
931
|
}
|
|
855
932
|
|
|
856
|
-
public rollback(contents: any, localOpMetadata: unknown) {
|
|
933
|
+
public rollback(type: string, contents: any, localOpMetadata: unknown) {
|
|
857
934
|
if (!this.channel) {
|
|
858
935
|
throw new Error("Channel must exist when rolling back ops");
|
|
859
936
|
}
|
|
860
937
|
if (!this.channel.rollback) {
|
|
861
938
|
throw new Error("Channel doesn't support rollback");
|
|
862
939
|
}
|
|
863
|
-
|
|
864
|
-
this.channel.rollback(innerContents.type, innerContents.content, localOpMetadata);
|
|
940
|
+
this.channel.rollback(type, contents, localOpMetadata);
|
|
865
941
|
}
|
|
866
942
|
|
|
867
943
|
public async applyStashedOp(contents: any): Promise<unknown> {
|
|
@@ -875,7 +951,7 @@ export abstract class FluidDataStoreContext
|
|
|
875
951
|
private verifyNotClosed(
|
|
876
952
|
callSite: string,
|
|
877
953
|
checkTombstone = true,
|
|
878
|
-
safeTelemetryProps:
|
|
954
|
+
safeTelemetryProps: ITelemetryBaseProperties = {},
|
|
879
955
|
) {
|
|
880
956
|
if (this.deleted) {
|
|
881
957
|
const messageString = `Context is deleted! Call site [${callSite}]`;
|
|
@@ -903,15 +979,14 @@ export abstract class FluidDataStoreContext
|
|
|
903
979
|
this.mc,
|
|
904
980
|
{
|
|
905
981
|
eventName: "GC_Tombstone_DataStore_Changed",
|
|
906
|
-
category: this.
|
|
907
|
-
gcTombstoneEnforcementAllowed:
|
|
908
|
-
this._containerRuntime.gcTombstoneEnforcementAllowed,
|
|
982
|
+
category: this.gcThrowOnTombstoneUsage ? "error" : "generic",
|
|
983
|
+
gcTombstoneEnforcementAllowed: this.gcTombstoneEnforcementAllowed,
|
|
909
984
|
callSite,
|
|
910
985
|
},
|
|
911
986
|
this.pkg,
|
|
912
987
|
error,
|
|
913
988
|
);
|
|
914
|
-
if (this.
|
|
989
|
+
if (this.gcThrowOnTombstoneUsage) {
|
|
915
990
|
throw error;
|
|
916
991
|
}
|
|
917
992
|
}
|
|
@@ -956,31 +1031,66 @@ export abstract class FluidDataStoreContext
|
|
|
956
1031
|
);
|
|
957
1032
|
}
|
|
958
1033
|
|
|
1034
|
+
public deleteChildSummarizerNode(id: string) {
|
|
1035
|
+
this.summarizerNode.deleteChild(id);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
959
1038
|
public async uploadBlob(
|
|
960
1039
|
blob: ArrayBufferLike,
|
|
961
1040
|
signal?: AbortSignal,
|
|
962
1041
|
): Promise<IFluidHandle<ArrayBufferLike>> {
|
|
963
|
-
return this.
|
|
1042
|
+
return this.parentContext.uploadBlob(blob, signal);
|
|
964
1043
|
}
|
|
965
1044
|
}
|
|
966
1045
|
|
|
1046
|
+
/** @internal */
|
|
967
1047
|
export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
968
|
-
|
|
1048
|
+
// Tells whether we need to fetch the snapshot before use. This is to support Data Virtualization.
|
|
1049
|
+
private snapshotFetchRequired: boolean;
|
|
1050
|
+
private readonly runtime: IContainerRuntimeBase;
|
|
969
1051
|
|
|
970
1052
|
constructor(props: IRemoteFluidDataStoreContextProps) {
|
|
971
1053
|
super(props, true /* existing */, false /* isLocalDataStore */, () => {
|
|
972
1054
|
throw new Error("Already attached");
|
|
973
1055
|
});
|
|
974
1056
|
|
|
975
|
-
this.
|
|
976
|
-
|
|
1057
|
+
this._baseSnapshot = props.snapshotTree;
|
|
1058
|
+
this.snapshotFetchRequired = !!props.snapshotTree?.omitted;
|
|
1059
|
+
this.runtime = props.parentContext.containerRuntime;
|
|
977
1060
|
if (props.snapshotTree !== undefined) {
|
|
978
1061
|
this.summarizerNode.updateBaseSummaryState(props.snapshotTree);
|
|
979
1062
|
}
|
|
980
1063
|
}
|
|
981
1064
|
|
|
1065
|
+
/*
|
|
1066
|
+
This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:
|
|
1067
|
+
The scenario (hit by stashedOps.spec.ts, "resends attach op" UT is the following (as far as I understand):
|
|
1068
|
+
1. data store is being attached in attached container
|
|
1069
|
+
2. container state is serialized (stashed ops feature)
|
|
1070
|
+
3. new container instance is rehydrated (from stashed ops)
|
|
1071
|
+
- As result, we create RemoteFluidDataStoreContext for this data store that is actually in "attaching" state (as of # 2).
|
|
1072
|
+
But its state is set to attached when loading container from stashed ops
|
|
1073
|
+
4. attach op for this data store is processed - setAttachState() is called.
|
|
1074
|
+
*/
|
|
1075
|
+
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached) {}
|
|
1076
|
+
|
|
982
1077
|
private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
|
|
983
|
-
|
|
1078
|
+
// Sequence number of the snapshot.
|
|
1079
|
+
let sequenceNumber: number | undefined;
|
|
1080
|
+
if (this.snapshotFetchRequired) {
|
|
1081
|
+
assert(
|
|
1082
|
+
this.loadingGroupId !== undefined,
|
|
1083
|
+
0x8f5 /* groupId should be present to fetch snapshot */,
|
|
1084
|
+
);
|
|
1085
|
+
const snapshot = await this.runtime.getSnapshotForLoadingGroupId(
|
|
1086
|
+
[this.loadingGroupId],
|
|
1087
|
+
[this.id],
|
|
1088
|
+
);
|
|
1089
|
+
this._baseSnapshot = snapshot.snapshotTree;
|
|
1090
|
+
sequenceNumber = snapshot.sequenceNumber;
|
|
1091
|
+
this.snapshotFetchRequired = false;
|
|
1092
|
+
}
|
|
1093
|
+
let tree = this.baseSnapshot;
|
|
984
1094
|
let isRootDataStore = true;
|
|
985
1095
|
|
|
986
1096
|
if (!!tree && tree.blobs[dataStoreAttributesBlobName] !== undefined) {
|
|
@@ -1020,11 +1130,12 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
1020
1130
|
}
|
|
1021
1131
|
}
|
|
1022
1132
|
|
|
1133
|
+
assert(this.pkg !== undefined, 0x8f6 /* The datastore context package should be defined */);
|
|
1023
1134
|
return {
|
|
1024
|
-
|
|
1025
|
-
pkg: this.pkg!,
|
|
1135
|
+
pkg: this.pkg,
|
|
1026
1136
|
isRootDataStore,
|
|
1027
1137
|
snapshot: tree,
|
|
1138
|
+
sequenceNumber,
|
|
1028
1139
|
};
|
|
1029
1140
|
});
|
|
1030
1141
|
|
|
@@ -1032,13 +1143,20 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
1032
1143
|
return this.initialSnapshotDetailsP;
|
|
1033
1144
|
}
|
|
1034
1145
|
|
|
1035
|
-
|
|
1146
|
+
/**
|
|
1147
|
+
* @see FluidDataStoreContext.getAttachData
|
|
1148
|
+
*/
|
|
1149
|
+
public getAttachData(includeGCData: boolean): {
|
|
1150
|
+
attachSummary: ISummaryTreeWithStats;
|
|
1151
|
+
type: string;
|
|
1152
|
+
} {
|
|
1036
1153
|
throw new Error("Cannot attach remote store");
|
|
1037
1154
|
}
|
|
1038
1155
|
}
|
|
1039
1156
|
|
|
1040
1157
|
/**
|
|
1041
1158
|
* Base class for detached & attached context classes
|
|
1159
|
+
* @internal
|
|
1042
1160
|
*/
|
|
1043
1161
|
export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
1044
1162
|
private readonly snapshotTree: ISnapshotTree | undefined;
|
|
@@ -1050,7 +1168,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1050
1168
|
constructor(props: ILocalFluidDataStoreContextProps) {
|
|
1051
1169
|
super(
|
|
1052
1170
|
props,
|
|
1053
|
-
props.snapshotTree !== undefined
|
|
1171
|
+
props.snapshotTree !== undefined /* existing */,
|
|
1054
1172
|
true /* isLocalDataStore */,
|
|
1055
1173
|
props.makeLocallyVisibleFn,
|
|
1056
1174
|
);
|
|
@@ -1059,31 +1177,63 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1059
1177
|
this.identifyLocalChangeInSummarizer("DataStoreCreatedInSummarizer");
|
|
1060
1178
|
|
|
1061
1179
|
this.snapshotTree = props.snapshotTree;
|
|
1062
|
-
if (props.isRootDataStore === true) {
|
|
1063
|
-
this.setInMemoryRoot();
|
|
1064
|
-
}
|
|
1065
1180
|
this.createProps = props.createProps;
|
|
1066
|
-
this.attachListeners();
|
|
1067
1181
|
}
|
|
1068
1182
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
this.
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1183
|
+
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
|
1184
|
+
switch (attachState) {
|
|
1185
|
+
case AttachState.Attaching:
|
|
1186
|
+
assert(
|
|
1187
|
+
this.attachState === AttachState.Detached,
|
|
1188
|
+
0x14d /* "Should move from detached to attaching" */,
|
|
1189
|
+
);
|
|
1190
|
+
this._attachState = AttachState.Attaching;
|
|
1191
|
+
if (this.channel?.setAttachState) {
|
|
1192
|
+
this.channel.setAttachState(attachState);
|
|
1193
|
+
} else if (this.channel) {
|
|
1194
|
+
// back-compat! To be removed in the future
|
|
1195
|
+
// Added in "2.0.0-rc.2.0.0" timeframe.
|
|
1196
|
+
this.emit("attaching");
|
|
1197
|
+
}
|
|
1198
|
+
break;
|
|
1199
|
+
case AttachState.Attached:
|
|
1200
|
+
// We can get called into here twice, as result of both container and data store being attached, if
|
|
1201
|
+
// those processes overlapped, for example, in a flow like that one:
|
|
1202
|
+
// 1. Container attach started
|
|
1203
|
+
// 2. data store attachment started
|
|
1204
|
+
// 3. container attached
|
|
1205
|
+
// 4. data store attached.
|
|
1206
|
+
if (this.attachState !== AttachState.Attached) {
|
|
1207
|
+
assert(
|
|
1208
|
+
this.attachState === AttachState.Attaching,
|
|
1209
|
+
0x14e /* "Should move from attaching to attached" */,
|
|
1210
|
+
);
|
|
1211
|
+
this._attachState = AttachState.Attached;
|
|
1212
|
+
this.channel?.setAttachState?.(attachState);
|
|
1213
|
+
if (this.channel?.setAttachState) {
|
|
1214
|
+
this.channel.setAttachState(attachState);
|
|
1215
|
+
} else if (this.channel) {
|
|
1216
|
+
// back-compat! To be removed in the future
|
|
1217
|
+
// Added in "2.0.0-rc.2.0.0" timeframe.
|
|
1218
|
+
this.emit("attached");
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
break;
|
|
1222
|
+
default:
|
|
1223
|
+
unreachableCase(attachState, "unreached");
|
|
1224
|
+
}
|
|
1084
1225
|
}
|
|
1085
1226
|
|
|
1086
|
-
|
|
1227
|
+
/**
|
|
1228
|
+
* @see FluidDataStoreContext.getAttachData
|
|
1229
|
+
*/
|
|
1230
|
+
public getAttachData(
|
|
1231
|
+
includeGCData: boolean,
|
|
1232
|
+
telemetryContext?: ITelemetryContext,
|
|
1233
|
+
): {
|
|
1234
|
+
attachSummary: ISummaryTreeWithStats;
|
|
1235
|
+
type: string;
|
|
1236
|
+
} {
|
|
1087
1237
|
assert(
|
|
1088
1238
|
this.channel !== undefined,
|
|
1089
1239
|
0x14f /* "There should be a channel when generating attach message" */,
|
|
@@ -1093,25 +1243,30 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1093
1243
|
0x150 /* "pkg should be available in local data store context" */,
|
|
1094
1244
|
);
|
|
1095
1245
|
|
|
1096
|
-
const
|
|
1246
|
+
const attachSummary = this.channel.getAttachSummary(telemetryContext);
|
|
1097
1247
|
|
|
1098
1248
|
// Wrap dds summaries in .channels subtree.
|
|
1099
|
-
wrapSummaryInChannelsTree(
|
|
1249
|
+
wrapSummaryInChannelsTree(attachSummary);
|
|
1100
1250
|
|
|
1101
1251
|
// Add data store's attributes to the summary.
|
|
1102
1252
|
const attributes = createAttributes(this.pkg, this.isInMemoryRoot());
|
|
1103
|
-
addBlobToSummary(
|
|
1253
|
+
addBlobToSummary(attachSummary, dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
1254
|
+
if (includeGCData) {
|
|
1255
|
+
const gcData = this.channel.getAttachGCData?.(telemetryContext);
|
|
1256
|
+
if (gcData !== undefined) {
|
|
1257
|
+
addBlobToSummary(attachSummary, gcDataBlobKey, JSON.stringify(gcData));
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1104
1260
|
|
|
1105
|
-
//
|
|
1106
|
-
|
|
1261
|
+
// Add loadingGroupId to the summary
|
|
1262
|
+
if (this.loadingGroupId !== undefined) {
|
|
1263
|
+
attachSummary.summary.groupId = this.loadingGroupId;
|
|
1264
|
+
}
|
|
1107
1265
|
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
snapshot,
|
|
1266
|
+
return {
|
|
1267
|
+
attachSummary,
|
|
1111
1268
|
type: this.pkg[this.pkg.length - 1],
|
|
1112
1269
|
};
|
|
1113
|
-
|
|
1114
|
-
return message;
|
|
1115
1270
|
}
|
|
1116
1271
|
|
|
1117
1272
|
private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
|
|
@@ -1181,6 +1336,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1181
1336
|
* Various workflows (snapshot creation, requests) result in .realize() being called
|
|
1182
1337
|
* on context, resulting in instantiation and attachment of runtime.
|
|
1183
1338
|
* Runtime is created using data store factory that is associated with this context.
|
|
1339
|
+
* @internal
|
|
1184
1340
|
*/
|
|
1185
1341
|
export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
1186
1342
|
constructor(props: ILocalFluidDataStoreContextProps) {
|
|
@@ -1198,43 +1354,47 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1198
1354
|
extends LocalFluidDataStoreContextBase
|
|
1199
1355
|
implements IFluidDataStoreContextDetached
|
|
1200
1356
|
{
|
|
1201
|
-
constructor(props:
|
|
1357
|
+
constructor(props: ILocalDetachedFluidDataStoreContextProps) {
|
|
1202
1358
|
super(props);
|
|
1203
1359
|
this.detachedRuntimeCreation = true;
|
|
1360
|
+
this.channelToDataStoreFn = props.channelToDataStoreFn;
|
|
1204
1361
|
}
|
|
1362
|
+
private readonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;
|
|
1205
1363
|
|
|
1206
1364
|
public async attachRuntime(
|
|
1207
1365
|
registry: IProvideFluidDataStoreFactory,
|
|
1208
1366
|
dataStoreChannel: IFluidDataStoreChannel,
|
|
1209
|
-
) {
|
|
1367
|
+
): Promise<IDataStore> {
|
|
1210
1368
|
assert(this.detachedRuntimeCreation, 0x154 /* "runtime creation is already attached" */);
|
|
1211
1369
|
this.detachedRuntimeCreation = false;
|
|
1212
1370
|
|
|
1213
|
-
assert(this.
|
|
1214
|
-
this.channelDeferred = new Deferred<IFluidDataStoreChannel>();
|
|
1371
|
+
assert(this.channelP === undefined, 0x155 /* "channel deferral is already set" */);
|
|
1215
1372
|
|
|
1216
|
-
|
|
1373
|
+
this.channelP = Promise.resolve()
|
|
1374
|
+
.then(async () => {
|
|
1375
|
+
const factory = registry.IFluidDataStoreFactory;
|
|
1217
1376
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1377
|
+
const factory2 = await this.factoryFromPackagePath();
|
|
1378
|
+
assert(factory2 === factory, 0x156 /* "Unexpected factory for package path" */);
|
|
1220
1379
|
|
|
1221
|
-
|
|
1222
|
-
this.registry = entry.registry;
|
|
1380
|
+
await super.bindRuntime(dataStoreChannel, false /* existing */);
|
|
1223
1381
|
|
|
1224
|
-
|
|
1382
|
+
assert(
|
|
1383
|
+
!(await this.isRoot()),
|
|
1384
|
+
0x8f7 /* there are no more createRootDataStore() kind of APIs! */,
|
|
1385
|
+
);
|
|
1225
1386
|
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1387
|
+
return dataStoreChannel;
|
|
1388
|
+
})
|
|
1389
|
+
.catch((error) => {
|
|
1390
|
+
this.mc.logger.sendErrorEvent({ eventName: "AttachRuntimeError" }, error);
|
|
1391
|
+
// The following two lines result in same exception thrown.
|
|
1392
|
+
// But we need to ensure that this.channelDeferred.promise is "observed", as otherwise
|
|
1393
|
+
// out UT reports unhandled exception
|
|
1394
|
+
throw error;
|
|
1395
|
+
});
|
|
1234
1396
|
|
|
1235
|
-
|
|
1236
|
-
dataStoreChannel.makeVisibleAndAttachGraph();
|
|
1237
|
-
}
|
|
1397
|
+
return this.channelToDataStoreFn(await this.channelP);
|
|
1238
1398
|
}
|
|
1239
1399
|
|
|
1240
1400
|
public async getInitialSnapshotDetails(): Promise<ISnapshotDetails> {
|