@fluidframework/container-runtime 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.245554
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 +425 -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 +225 -0
- package/dist/channelCollection.d.ts.map +1 -0
- package/dist/{dataStores.js → channelCollection.js} +447 -147
- 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 +129 -48
- package/dist/container-runtime-beta.d.ts +68 -9
- package/dist/container-runtime-public.d.ts +68 -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 +503 -368
- 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/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 +20 -12
- 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 +2 -2
- 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 +5 -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.js +8 -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 +225 -0
- package/lib/channelCollection.d.ts.map +1 -0
- package/lib/{dataStores.mjs → channelCollection.js} +434 -137
- 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} +129 -48
- package/lib/{container-runtime-beta.d.mts → container-runtime-beta.d.ts} +68 -9
- package/lib/{container-runtime-public.d.mts → container-runtime-public.d.ts} +68 -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} +423 -290
- 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} +1 -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} +12 -4
- 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} +2 -2
- 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} +3 -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} +2 -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} +620 -175
- package/src/connectionTelemetry.ts +42 -3
- package/src/containerHandleContext.ts +1 -1
- package/src/containerRuntime.ts +604 -415
- package/src/dataStore.ts +16 -15
- package/src/dataStoreContext.ts +376 -216
- package/src/dataStoreContexts.ts +2 -1
- 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 +29 -9
- package/src/opLifecycle/remoteMessageProcessor.ts +4 -4
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +19 -13
- package/src/scheduleManager.ts +4 -4
- package/src/summary/index.ts +13 -12
- package/src/summary/orderedClientElection.ts +1 -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
|
@@ -8,35 +8,44 @@ import {
|
|
|
8
8
|
IDisposable,
|
|
9
9
|
IFluidHandle,
|
|
10
10
|
IRequest,
|
|
11
|
+
FluidObject,
|
|
12
|
+
IResponse,
|
|
11
13
|
} from "@fluidframework/core-interfaces";
|
|
12
14
|
import { FluidObjectHandle } from "@fluidframework/datastore";
|
|
13
15
|
import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
|
|
14
16
|
import {
|
|
15
17
|
AliasResult,
|
|
16
18
|
channelsTreeName,
|
|
17
|
-
CreateChildSummarizerNodeFn,
|
|
18
|
-
CreateChildSummarizerNodeParam,
|
|
19
19
|
CreateSummarizerNodeSource,
|
|
20
20
|
IAttachMessage,
|
|
21
21
|
IEnvelope,
|
|
22
|
+
IFluidDataStoreChannel,
|
|
22
23
|
IFluidDataStoreContextDetached,
|
|
23
24
|
IGarbageCollectionData,
|
|
24
25
|
IInboundSignalMessage,
|
|
26
|
+
IFluidParentContext,
|
|
25
27
|
InboundAttachMessage,
|
|
26
28
|
ISummarizeResult,
|
|
27
29
|
ISummaryTreeWithStats,
|
|
28
30
|
ITelemetryContext,
|
|
31
|
+
IFluidDataStoreFactory,
|
|
32
|
+
IFluidDataStoreContext,
|
|
33
|
+
NamedFluidDataStoreRegistryEntries,
|
|
34
|
+
IFluidDataStoreRegistry,
|
|
29
35
|
} from "@fluidframework/runtime-definitions";
|
|
30
36
|
import {
|
|
31
37
|
convertSnapshotTreeToSummaryTree,
|
|
32
|
-
|
|
38
|
+
convertSummaryTreeToITree,
|
|
33
39
|
create404Response,
|
|
34
40
|
createResponseError,
|
|
35
41
|
GCDataBuilder,
|
|
36
42
|
isSerializedHandle,
|
|
43
|
+
processAttachMessageGCData,
|
|
37
44
|
responseToException,
|
|
38
45
|
SummaryTreeBuilder,
|
|
39
46
|
unpackChildNodesUsedRoutes,
|
|
47
|
+
RequestParser,
|
|
48
|
+
encodeCompactIdToString,
|
|
40
49
|
} from "@fluidframework/runtime-utils";
|
|
41
50
|
import {
|
|
42
51
|
createChildMonitoringContext,
|
|
@@ -46,41 +55,199 @@ import {
|
|
|
46
55
|
LoggingError,
|
|
47
56
|
MonitoringContext,
|
|
48
57
|
tagCodeArtifacts,
|
|
58
|
+
createChildLogger,
|
|
49
59
|
} from "@fluidframework/telemetry-utils";
|
|
50
60
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
51
61
|
import { buildSnapshotTree } from "@fluidframework/driver-utils";
|
|
52
|
-
import { assert, Lazy } from "@fluidframework/core-utils";
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import { ContainerRuntime, defaultRuntimeHeaderData, RuntimeHeaderData } from "./containerRuntime";
|
|
62
|
+
import { assert, Lazy, LazyPromise } from "@fluidframework/core-utils";
|
|
63
|
+
import { DataStoreContexts } from "./dataStoreContexts.js";
|
|
64
|
+
import { defaultRuntimeHeaderData, RuntimeHeaderData } from "./containerRuntime.js";
|
|
56
65
|
import {
|
|
57
66
|
FluidDataStoreContext,
|
|
58
67
|
RemoteFluidDataStoreContext,
|
|
59
68
|
LocalFluidDataStoreContext,
|
|
60
69
|
createAttributesBlob,
|
|
61
70
|
LocalDetachedFluidDataStoreContext,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
71
|
+
IFluidDataStoreContextInternal,
|
|
72
|
+
ILocalDetachedFluidDataStoreContextProps,
|
|
73
|
+
} from "./dataStoreContext.js";
|
|
74
|
+
import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs.js";
|
|
75
|
+
import {
|
|
76
|
+
IDataStoreAliasMessage,
|
|
77
|
+
channelToDataStore,
|
|
78
|
+
isDataStoreAliasMessage,
|
|
79
|
+
} from "./dataStore.js";
|
|
80
|
+
import {
|
|
81
|
+
GCNodeType,
|
|
82
|
+
detectOutboundRoutesViaDDSKey,
|
|
83
|
+
trimLeadingAndTrailingSlashes,
|
|
84
|
+
} from "./gc/index.js";
|
|
85
|
+
import {
|
|
86
|
+
IContainerRuntimeMetadata,
|
|
87
|
+
nonDataStorePaths,
|
|
88
|
+
rootHasIsolatedChannels,
|
|
89
|
+
} from "./summary/index.js";
|
|
90
|
+
import { ContainerMessageType, LocalContainerRuntimeMessage } from "./messageTypes.js";
|
|
91
|
+
import { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Accepted header keys for requests coming to the runtime.
|
|
95
|
+
* @internal
|
|
96
|
+
*/
|
|
97
|
+
export enum RuntimeHeaders {
|
|
98
|
+
/** True to wait for a data store to be created and loaded before returning it. */
|
|
99
|
+
wait = "wait",
|
|
100
|
+
/** True if the request is coming from an IFluidHandle. */
|
|
101
|
+
viaHandle = "viaHandle",
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** True if a tombstoned object should be returned without erroring
|
|
105
|
+
* @alpha
|
|
106
|
+
*/
|
|
107
|
+
export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
|
|
108
|
+
/**
|
|
109
|
+
* [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
|
|
67
113
|
|
|
68
114
|
type PendingAliasResolve = (success: boolean) => void;
|
|
69
115
|
|
|
116
|
+
interface FluidDataStoreMessage {
|
|
117
|
+
content: any;
|
|
118
|
+
type: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Creates a shallow wrapper of {@link IFluidParentContext}. The wrapper can then have its methods overwritten as needed
|
|
123
|
+
*/
|
|
124
|
+
export function wrapContext(context: IFluidParentContext): IFluidParentContext {
|
|
125
|
+
return {
|
|
126
|
+
get IFluidDataStoreRegistry() {
|
|
127
|
+
return context.IFluidDataStoreRegistry;
|
|
128
|
+
},
|
|
129
|
+
IFluidHandleContext: context.IFluidHandleContext,
|
|
130
|
+
options: context.options,
|
|
131
|
+
get clientId() {
|
|
132
|
+
return context.clientId;
|
|
133
|
+
},
|
|
134
|
+
get connected() {
|
|
135
|
+
return context.connected;
|
|
136
|
+
},
|
|
137
|
+
deltaManager: context.deltaManager,
|
|
138
|
+
storage: context.storage,
|
|
139
|
+
logger: context.logger,
|
|
140
|
+
get clientDetails() {
|
|
141
|
+
return context.clientDetails;
|
|
142
|
+
},
|
|
143
|
+
get idCompressor() {
|
|
144
|
+
return context.idCompressor;
|
|
145
|
+
},
|
|
146
|
+
loadingGroupId: context.loadingGroupId,
|
|
147
|
+
get attachState() {
|
|
148
|
+
return context.attachState;
|
|
149
|
+
},
|
|
150
|
+
containerRuntime: context.containerRuntime,
|
|
151
|
+
scope: context.scope,
|
|
152
|
+
gcThrowOnTombstoneUsage: context.gcThrowOnTombstoneUsage,
|
|
153
|
+
gcTombstoneEnforcementAllowed: context.gcTombstoneEnforcementAllowed,
|
|
154
|
+
getAbsoluteUrl: async (...args) => {
|
|
155
|
+
return context.getAbsoluteUrl(...args);
|
|
156
|
+
},
|
|
157
|
+
getQuorum: (...args) => {
|
|
158
|
+
return context.getQuorum(...args);
|
|
159
|
+
},
|
|
160
|
+
getAudience: (...args) => {
|
|
161
|
+
return context.getAudience(...args);
|
|
162
|
+
},
|
|
163
|
+
ensureNoDataModelChanges: (...args) => {
|
|
164
|
+
return context.ensureNoDataModelChanges(...args);
|
|
165
|
+
},
|
|
166
|
+
submitMessage: (...args) => {
|
|
167
|
+
return context.submitMessage(...args);
|
|
168
|
+
},
|
|
169
|
+
submitSignal: (...args) => {
|
|
170
|
+
return context.submitSignal(...args);
|
|
171
|
+
},
|
|
172
|
+
makeLocallyVisible: (...args) => {
|
|
173
|
+
return context.makeLocallyVisible(...args);
|
|
174
|
+
},
|
|
175
|
+
uploadBlob: async (...args) => {
|
|
176
|
+
return context.uploadBlob(...args);
|
|
177
|
+
},
|
|
178
|
+
addedGCOutboundReference: (...args) => {
|
|
179
|
+
return context.addedGCOutboundReference?.(...args);
|
|
180
|
+
},
|
|
181
|
+
getCreateChildSummarizerNodeFn: (...args) => {
|
|
182
|
+
return context.getCreateChildSummarizerNodeFn?.(...args);
|
|
183
|
+
},
|
|
184
|
+
deleteChildSummarizerNode: (...args) => {
|
|
185
|
+
return context.deleteChildSummarizerNode?.(...args);
|
|
186
|
+
},
|
|
187
|
+
setChannelDirty: (address: string) => {
|
|
188
|
+
return context.setChannelDirty(address);
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Creates a wrapper of a {@link IFluidParentContext} to be provided to the inner datastore channels.
|
|
195
|
+
* The wrapper will have the submit methods overwritten with the appropriate id as the destination address.
|
|
196
|
+
*
|
|
197
|
+
* @param id - the id of the channel
|
|
198
|
+
* @param parentContext - the {@link IFluidParentContext} to wrap
|
|
199
|
+
* @returns A wrapped {@link IFluidParentContext}
|
|
200
|
+
*/
|
|
201
|
+
export function wrapContextForInnerChannel(
|
|
202
|
+
id: string,
|
|
203
|
+
parentContext: IFluidParentContext,
|
|
204
|
+
): IFluidParentContext {
|
|
205
|
+
const context = wrapContext(parentContext);
|
|
206
|
+
|
|
207
|
+
context.submitMessage = (type: string, content: any, localOpMetadata: unknown) => {
|
|
208
|
+
const fluidDataStoreContent: FluidDataStoreMessage = {
|
|
209
|
+
content,
|
|
210
|
+
type,
|
|
211
|
+
};
|
|
212
|
+
const envelope: IEnvelope = {
|
|
213
|
+
address: id,
|
|
214
|
+
contents: fluidDataStoreContent,
|
|
215
|
+
};
|
|
216
|
+
parentContext.submitMessage(
|
|
217
|
+
ContainerMessageType.FluidDataStoreOp,
|
|
218
|
+
envelope,
|
|
219
|
+
localOpMetadata,
|
|
220
|
+
);
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
context.submitSignal = (type: string, contents: any, targetClientId?: string) => {
|
|
224
|
+
const envelope: IEnvelope = {
|
|
225
|
+
address: id,
|
|
226
|
+
contents,
|
|
227
|
+
};
|
|
228
|
+
parentContext.submitSignal(type, envelope, targetClientId);
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
return context;
|
|
232
|
+
}
|
|
233
|
+
|
|
70
234
|
/**
|
|
71
235
|
* This class encapsulates data store handling. Currently it is only used by the container runtime,
|
|
72
236
|
* but eventually could be hosted on any channel once we formalize the channel api boundary.
|
|
237
|
+
* @internal
|
|
73
238
|
*/
|
|
74
|
-
export class
|
|
239
|
+
export class ChannelCollection implements IFluidDataStoreChannel, IDisposable {
|
|
75
240
|
// Stores tracked by the Domain
|
|
76
241
|
private readonly pendingAttach = new Map<string, IAttachMessage>();
|
|
77
242
|
// 0.24 back-compat attachingBeforeSummary
|
|
78
243
|
public readonly attachOpFiredForDataStore = new Set<string>();
|
|
79
244
|
|
|
80
|
-
|
|
245
|
+
protected readonly mc: MonitoringContext;
|
|
81
246
|
|
|
82
247
|
private readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());
|
|
83
248
|
|
|
249
|
+
public readonly entryPoint: IFluidHandle<FluidObject>;
|
|
250
|
+
|
|
84
251
|
public readonly containerLoadStats: {
|
|
85
252
|
// number of dataStores during loadContainer
|
|
86
253
|
readonly containerLoadDataStoreCount: number;
|
|
@@ -99,30 +266,35 @@ export class DataStores implements IDisposable {
|
|
|
99
266
|
Promise<AliasResult>
|
|
100
267
|
>();
|
|
101
268
|
|
|
269
|
+
protected readonly contexts: DataStoreContexts;
|
|
270
|
+
|
|
102
271
|
constructor(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
private readonly submitAttachFn: (attachContent: IAttachMessage) => void,
|
|
106
|
-
private readonly getCreateChildSummarizerNodeFn: (
|
|
107
|
-
id: string,
|
|
108
|
-
createParam: CreateChildSummarizerNodeParam,
|
|
109
|
-
) => CreateChildSummarizerNodeFn,
|
|
110
|
-
private readonly deleteChildSummarizerNodeFn: (id: string) => void,
|
|
272
|
+
protected readonly baseSnapshot: ISnapshotTree | undefined,
|
|
273
|
+
public readonly parentContext: IFluidParentContext,
|
|
111
274
|
baseLogger: ITelemetryBaseLogger,
|
|
112
275
|
private readonly gcNodeUpdated: (
|
|
113
276
|
nodePath: string,
|
|
114
|
-
|
|
277
|
+
reason: "Loaded" | "Changed",
|
|
278
|
+
timestampMs?: number,
|
|
115
279
|
packagePath?: readonly string[],
|
|
280
|
+
request?: IRequest,
|
|
281
|
+
headerData?: RuntimeHeaderData,
|
|
116
282
|
) => void,
|
|
117
283
|
private readonly isDataStoreDeleted: (nodePath: string) => boolean,
|
|
118
284
|
private readonly aliasMap: Map<string, string>,
|
|
119
|
-
|
|
285
|
+
provideEntryPoint: (runtime: ChannelCollection) => Promise<FluidObject>,
|
|
120
286
|
) {
|
|
121
287
|
this.mc = createChildMonitoringContext({ logger: baseLogger });
|
|
288
|
+
this.contexts = new DataStoreContexts(baseLogger);
|
|
122
289
|
this.containerRuntimeHandle = new FluidObjectHandle(
|
|
123
|
-
this.
|
|
290
|
+
this.parentContext,
|
|
124
291
|
"/",
|
|
125
|
-
this.
|
|
292
|
+
this.parentContext.IFluidHandleContext,
|
|
293
|
+
);
|
|
294
|
+
this.entryPoint = new FluidObjectHandle<FluidObject>(
|
|
295
|
+
new LazyPromise(async () => provideEntryPoint(this)),
|
|
296
|
+
"",
|
|
297
|
+
this.parentContext.IFluidHandleContext,
|
|
126
298
|
);
|
|
127
299
|
|
|
128
300
|
// Extract stores stored inside the snapshot
|
|
@@ -143,17 +315,17 @@ export class DataStores implements IDisposable {
|
|
|
143
315
|
unreferencedDataStoreCount++;
|
|
144
316
|
}
|
|
145
317
|
// If we have a detached container, then create local data store contexts.
|
|
146
|
-
if (this.
|
|
318
|
+
if (this.parentContext.attachState !== AttachState.Detached) {
|
|
147
319
|
dataStoreContext = new RemoteFluidDataStoreContext({
|
|
148
320
|
id: key,
|
|
149
321
|
snapshotTree: value,
|
|
150
|
-
|
|
151
|
-
storage: this.
|
|
152
|
-
scope: this.
|
|
153
|
-
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(key, {
|
|
322
|
+
parentContext: this.wrapContextForInnerChannel(key),
|
|
323
|
+
storage: this.parentContext.storage,
|
|
324
|
+
scope: this.parentContext.scope,
|
|
325
|
+
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
154
326
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
155
327
|
}),
|
|
156
|
-
|
|
328
|
+
loadingGroupId: value.groupId,
|
|
157
329
|
});
|
|
158
330
|
} else {
|
|
159
331
|
if (typeof value !== "object") {
|
|
@@ -163,15 +335,14 @@ export class DataStores implements IDisposable {
|
|
|
163
335
|
dataStoreContext = new LocalFluidDataStoreContext({
|
|
164
336
|
id: key,
|
|
165
337
|
pkg: undefined,
|
|
166
|
-
|
|
167
|
-
storage: this.
|
|
168
|
-
scope: this.
|
|
169
|
-
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(key, {
|
|
338
|
+
parentContext: this.wrapContextForInnerChannel(key),
|
|
339
|
+
storage: this.parentContext.storage,
|
|
340
|
+
scope: this.parentContext.scope,
|
|
341
|
+
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(key, {
|
|
170
342
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
171
343
|
}),
|
|
172
344
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
|
|
173
345
|
snapshotTree,
|
|
174
|
-
isRootDataStore: undefined,
|
|
175
346
|
});
|
|
176
347
|
}
|
|
177
348
|
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
@@ -195,18 +366,60 @@ export class DataStores implements IDisposable {
|
|
|
195
366
|
return pendingAliasPromise ?? "Success";
|
|
196
367
|
}
|
|
197
368
|
|
|
198
|
-
|
|
369
|
+
/** For sampling. Only log once per container */
|
|
370
|
+
private shouldSendAttachLog = true;
|
|
371
|
+
|
|
372
|
+
protected wrapContextForInnerChannel(id: string): IFluidParentContext {
|
|
373
|
+
return wrapContextForInnerChannel(id, this.parentContext);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* IFluidDataStoreChannel.makeVisibleAndAttachGraph implementation
|
|
378
|
+
* Not clear when it would be called and what it should do.
|
|
379
|
+
* Currently this API is called by context only for root data stores.
|
|
380
|
+
*/
|
|
381
|
+
public makeVisibleAndAttachGraph() {
|
|
382
|
+
this.parentContext.makeLocallyVisible();
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
private processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {
|
|
199
386
|
const attachMessage = message.contents as InboundAttachMessage;
|
|
200
387
|
|
|
201
388
|
this.dataStoresSinceLastGC.push(attachMessage.id);
|
|
202
389
|
|
|
390
|
+
// We need to process the GC Data for both local and remote attach messages
|
|
391
|
+
const foundGCData = processAttachMessageGCData(attachMessage.snapshot, (nodeId, toPath) => {
|
|
392
|
+
// nodeId is the relative path under the node being attached. Always starts with "/", but no trailing "/" after an id
|
|
393
|
+
const fromPath = `/${attachMessage.id}${nodeId === "/" ? "" : nodeId}`;
|
|
394
|
+
this.parentContext.addedGCOutboundReference?.(
|
|
395
|
+
{ absolutePath: fromPath },
|
|
396
|
+
{ absolutePath: toPath },
|
|
397
|
+
);
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// Only log once per container to avoid noise/cost.
|
|
401
|
+
// Allows longitudinal tracking of various state (e.g. foundGCData), and some sampled details
|
|
402
|
+
if (this.shouldSendAttachLog) {
|
|
403
|
+
this.shouldSendAttachLog = false;
|
|
404
|
+
this.mc.logger.sendTelemetryEvent({
|
|
405
|
+
eventName: "dataStoreAttachMessage_sampled",
|
|
406
|
+
...tagCodeArtifacts({ id: attachMessage.id, pkg: attachMessage.type }),
|
|
407
|
+
details: {
|
|
408
|
+
local,
|
|
409
|
+
snapshot: !!attachMessage.snapshot,
|
|
410
|
+
foundGCData,
|
|
411
|
+
},
|
|
412
|
+
...extractSafePropertiesFromMessage(message),
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
|
|
203
416
|
// The local object has already been attached
|
|
204
417
|
if (local) {
|
|
205
418
|
assert(
|
|
206
419
|
this.pendingAttach.has(attachMessage.id),
|
|
207
420
|
0x15e /* "Local object does not have matching attach message id" */,
|
|
208
421
|
);
|
|
209
|
-
this.contexts.get(attachMessage.id)?.
|
|
422
|
+
this.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);
|
|
210
423
|
this.pendingAttach.delete(attachMessage.id);
|
|
211
424
|
return;
|
|
212
425
|
}
|
|
@@ -237,24 +450,27 @@ export class DataStores implements IDisposable {
|
|
|
237
450
|
const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
|
|
238
451
|
id: attachMessage.id,
|
|
239
452
|
snapshotTree,
|
|
240
|
-
|
|
241
|
-
storage: new StorageServiceWithAttachBlobs(this.
|
|
242
|
-
scope: this.
|
|
243
|
-
|
|
244
|
-
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
453
|
+
parentContext: this.wrapContextForInnerChannel(attachMessage.id),
|
|
454
|
+
storage: new StorageServiceWithAttachBlobs(this.parentContext.storage, flatAttachBlobs),
|
|
455
|
+
scope: this.parentContext.scope,
|
|
456
|
+
loadingGroupId: attachMessage.snapshot?.groupId,
|
|
457
|
+
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(
|
|
458
|
+
attachMessage.id,
|
|
459
|
+
{
|
|
460
|
+
type: CreateSummarizerNodeSource.FromAttach,
|
|
461
|
+
sequenceNumber: message.sequenceNumber,
|
|
462
|
+
snapshot: attachMessage.snapshot ?? {
|
|
463
|
+
entries: [createAttributesBlob(pkg, true /* isRootDataStore */)],
|
|
464
|
+
},
|
|
249
465
|
},
|
|
250
|
-
|
|
466
|
+
),
|
|
251
467
|
pkg,
|
|
252
468
|
});
|
|
253
469
|
|
|
254
470
|
this.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);
|
|
255
471
|
}
|
|
256
472
|
|
|
257
|
-
|
|
473
|
+
private processAliasMessage(
|
|
258
474
|
message: ISequencedDocumentMessage,
|
|
259
475
|
localOpMetadata: unknown,
|
|
260
476
|
local: boolean,
|
|
@@ -267,47 +483,43 @@ export class DataStores implements IDisposable {
|
|
|
267
483
|
}
|
|
268
484
|
|
|
269
485
|
const resolve = localOpMetadata as PendingAliasResolve;
|
|
270
|
-
const aliasResult = this.processAliasMessageCore(
|
|
486
|
+
const aliasResult = this.processAliasMessageCore(
|
|
487
|
+
aliasMessage.internalId,
|
|
488
|
+
aliasMessage.alias,
|
|
489
|
+
);
|
|
271
490
|
if (local) {
|
|
272
491
|
resolve(aliasResult);
|
|
273
492
|
}
|
|
274
493
|
}
|
|
275
494
|
|
|
276
|
-
public processAliasMessageCore(
|
|
277
|
-
if (this.alreadyProcessed(
|
|
495
|
+
public processAliasMessageCore(internalId: string, alias: string): boolean {
|
|
496
|
+
if (this.alreadyProcessed(alias)) {
|
|
278
497
|
return false;
|
|
279
498
|
}
|
|
280
499
|
|
|
281
|
-
const context = this.contexts.get(
|
|
500
|
+
const context = this.contexts.get(internalId);
|
|
282
501
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
283
502
|
// corruption in case a deleted data store accidentally submitted a signal.
|
|
284
|
-
if (
|
|
285
|
-
this.checkAndLogIfDeleted(
|
|
286
|
-
aliasMessage.internalId,
|
|
287
|
-
context,
|
|
288
|
-
"Changed",
|
|
289
|
-
"processAliasMessageCore",
|
|
290
|
-
)
|
|
291
|
-
) {
|
|
503
|
+
if (this.checkAndLogIfDeleted(internalId, context, "Changed", "processAliasMessageCore")) {
|
|
292
504
|
return false;
|
|
293
505
|
}
|
|
294
506
|
|
|
295
507
|
if (context === undefined) {
|
|
296
508
|
this.mc.logger.sendErrorEvent({
|
|
297
509
|
eventName: "AliasFluidDataStoreNotFound",
|
|
298
|
-
fluidDataStoreId:
|
|
510
|
+
fluidDataStoreId: internalId,
|
|
299
511
|
});
|
|
300
512
|
return false;
|
|
301
513
|
}
|
|
302
514
|
|
|
303
515
|
const handle = new FluidObjectHandle(
|
|
304
516
|
context,
|
|
305
|
-
|
|
306
|
-
this.
|
|
517
|
+
internalId,
|
|
518
|
+
this.parentContext.IFluidHandleContext,
|
|
307
519
|
);
|
|
308
|
-
this.
|
|
520
|
+
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
309
521
|
|
|
310
|
-
this.aliasMap.set(
|
|
522
|
+
this.aliasMap.set(alias, context.id);
|
|
311
523
|
context.setInMemoryRoot();
|
|
312
524
|
return true;
|
|
313
525
|
}
|
|
@@ -316,9 +528,24 @@ export class DataStores implements IDisposable {
|
|
|
316
528
|
return this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;
|
|
317
529
|
}
|
|
318
530
|
|
|
531
|
+
/** Package up the context's attach summary etc into an IAttachMessage */
|
|
532
|
+
private generateAttachMessage(localContext: IFluidDataStoreContextInternal): IAttachMessage {
|
|
533
|
+
const { attachSummary } = localContext.getAttachData(/* includeGCData: */ true);
|
|
534
|
+
const type = localContext.packagePath[localContext.packagePath.length - 1];
|
|
535
|
+
|
|
536
|
+
// Attach message needs the summary in ITree format. Convert the ISummaryTree into an ITree.
|
|
537
|
+
const snapshot = convertSummaryTreeToITree(attachSummary.summary);
|
|
538
|
+
|
|
539
|
+
return {
|
|
540
|
+
id: localContext.id,
|
|
541
|
+
snapshot,
|
|
542
|
+
type,
|
|
543
|
+
} satisfies IAttachMessage;
|
|
544
|
+
}
|
|
545
|
+
|
|
319
546
|
/**
|
|
320
|
-
* Make the data
|
|
321
|
-
* bound list. This data store can now be reached from the root.
|
|
547
|
+
* Make the data store locally visible in the container graph by moving the data store context from unbound to
|
|
548
|
+
* bound list and submitting the attach message. This data store can now be reached from the root.
|
|
322
549
|
* @param id - The id of the data store context to make visible.
|
|
323
550
|
*/
|
|
324
551
|
private makeDataStoreLocallyVisible(id: string): void {
|
|
@@ -330,61 +557,110 @@ export class DataStores implements IDisposable {
|
|
|
330
557
|
* globally visible. Move it to attaching state and send an "attach" op for it.
|
|
331
558
|
* If the container is detached, this data store will be part of the summary that makes the container attached.
|
|
332
559
|
*/
|
|
333
|
-
if (this.
|
|
334
|
-
localContext.
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
this.pendingAttach.set(id, message);
|
|
338
|
-
this.submitAttachFn(message);
|
|
339
|
-
this.attachOpFiredForDataStore.add(id);
|
|
560
|
+
if (this.parentContext.attachState !== AttachState.Detached) {
|
|
561
|
+
localContext.setAttachState(AttachState.Attaching);
|
|
562
|
+
this.submitAttachChannelOp(localContext);
|
|
340
563
|
}
|
|
341
564
|
|
|
342
565
|
this.contexts.bind(id);
|
|
343
566
|
}
|
|
344
567
|
|
|
345
|
-
|
|
568
|
+
protected submitAttachChannelOp(localContext: LocalFluidDataStoreContext) {
|
|
569
|
+
const message = this.generateAttachMessage(localContext);
|
|
570
|
+
this.pendingAttach.set(localContext.id, message);
|
|
571
|
+
this.parentContext.submitMessage(ContainerMessageType.Attach, message, undefined);
|
|
572
|
+
this.attachOpFiredForDataStore.add(localContext.id);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Generate compact internal DataStore ID.
|
|
577
|
+
*
|
|
578
|
+
* A note about namespace and name collisions:
|
|
579
|
+
* This code assumes that that's the only way to generate internal IDs, and that it's Ok for this namespace to overlap with
|
|
580
|
+
* user-provided alias names namespace.
|
|
581
|
+
* There are two scenarios where it could cause trouble:
|
|
582
|
+
* 1) Old files, where (already removed) CreateRoot*DataStore*() API was used, and thus internal name of data store
|
|
583
|
+
* was provided by user. Such files may experience name collision with future data stores that receive a name generated
|
|
584
|
+
* by this function.
|
|
585
|
+
* 2) Much less likely, but if it happen that internal ID (generated by this function) is exactly the same as alias name
|
|
586
|
+
* that user might use in the future, them ContainerRuntime.getAliasedDataStoreEntryPoint() or
|
|
587
|
+
* ContainerRuntime.getDataStoreFromRequest() could return a data store with internalID matching user request, even though
|
|
588
|
+
* user expected some other data store (that would receive alias later).
|
|
589
|
+
* Please note that above mentioned functions have the implementation they have (allowing #2) due to #1.
|
|
590
|
+
*/
|
|
591
|
+
protected createDataStoreId(): string {
|
|
592
|
+
// We use three non-overlapping namespaces:
|
|
593
|
+
// - detached state: even numbers
|
|
594
|
+
// - attached state: odd numbers
|
|
595
|
+
// - uuids
|
|
596
|
+
// In first two cases we will encode result as strings in more compact form.
|
|
597
|
+
if (this.parentContext.attachState === AttachState.Detached) {
|
|
598
|
+
// container is detached, only one client observes content, no way to hit collisions with other clients.
|
|
599
|
+
return encodeCompactIdToString(2 * this.contexts.size);
|
|
600
|
+
}
|
|
601
|
+
const id = this.parentContext.containerRuntime.generateDocumentUniqueId();
|
|
602
|
+
if (typeof id === "number") {
|
|
603
|
+
return encodeCompactIdToString(2 * id + 1);
|
|
604
|
+
}
|
|
605
|
+
return id;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
public createDetachedDataStore(
|
|
346
609
|
pkg: Readonly<string[]>,
|
|
347
|
-
|
|
348
|
-
id = uuid(),
|
|
349
|
-
groupId?: string,
|
|
610
|
+
loadingGroupId?: string,
|
|
350
611
|
): IFluidDataStoreContextDetached {
|
|
351
|
-
|
|
612
|
+
return this.createContext(
|
|
613
|
+
this.createDataStoreId(),
|
|
614
|
+
pkg,
|
|
615
|
+
LocalDetachedFluidDataStoreContext,
|
|
616
|
+
undefined, // props
|
|
617
|
+
loadingGroupId,
|
|
618
|
+
);
|
|
619
|
+
}
|
|
352
620
|
|
|
353
|
-
|
|
354
|
-
|
|
621
|
+
public createDataStoreContext(
|
|
622
|
+
pkg: Readonly<string[]>,
|
|
623
|
+
props?: any,
|
|
624
|
+
loadingGroupId?: string,
|
|
625
|
+
): IFluidDataStoreContextInternal {
|
|
626
|
+
return this.createContext(
|
|
627
|
+
this.createDataStoreId(),
|
|
355
628
|
pkg,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
type: CreateSummarizerNodeSource.Local,
|
|
361
|
-
}),
|
|
362
|
-
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
363
|
-
snapshotTree: undefined,
|
|
364
|
-
isRootDataStore: isRoot,
|
|
365
|
-
groupId,
|
|
366
|
-
});
|
|
367
|
-
this.contexts.addUnbound(context);
|
|
368
|
-
return context;
|
|
629
|
+
LocalFluidDataStoreContext,
|
|
630
|
+
props,
|
|
631
|
+
loadingGroupId,
|
|
632
|
+
);
|
|
369
633
|
}
|
|
370
634
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
635
|
+
protected createContext<T extends LocalFluidDataStoreContext>(
|
|
636
|
+
id: string,
|
|
637
|
+
pkg: Readonly<string[]>,
|
|
638
|
+
contextCtor: new (props: ILocalDetachedFluidDataStoreContextProps) => T,
|
|
639
|
+
createProps?: any,
|
|
640
|
+
loadingGroupId?: string,
|
|
641
|
+
) {
|
|
642
|
+
const context = new contextCtor({
|
|
374
643
|
id,
|
|
375
644
|
pkg,
|
|
376
|
-
|
|
377
|
-
storage: this.
|
|
378
|
-
scope: this.
|
|
379
|
-
createSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(id, {
|
|
645
|
+
parentContext: this.wrapContextForInnerChannel(id),
|
|
646
|
+
storage: this.parentContext.storage,
|
|
647
|
+
scope: this.parentContext.scope,
|
|
648
|
+
createSummarizerNodeFn: this.parentContext.getCreateChildSummarizerNodeFn(id, {
|
|
380
649
|
type: CreateSummarizerNodeSource.Local,
|
|
381
650
|
}),
|
|
382
651
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
383
652
|
snapshotTree: undefined,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
653
|
+
createProps,
|
|
654
|
+
loadingGroupId,
|
|
655
|
+
channelToDataStoreFn: (channel: IFluidDataStoreChannel) =>
|
|
656
|
+
channelToDataStore(
|
|
657
|
+
channel,
|
|
658
|
+
id,
|
|
659
|
+
this,
|
|
660
|
+
createChildLogger({ logger: this.parentContext.logger }),
|
|
661
|
+
),
|
|
387
662
|
});
|
|
663
|
+
|
|
388
664
|
this.contexts.addUnbound(context);
|
|
389
665
|
return context;
|
|
390
666
|
}
|
|
@@ -394,7 +670,21 @@ export class DataStores implements IDisposable {
|
|
|
394
670
|
}
|
|
395
671
|
public readonly dispose = () => this.disposeOnce.value;
|
|
396
672
|
|
|
397
|
-
public
|
|
673
|
+
public reSubmit(type: string, content: any, localOpMetadata: unknown) {
|
|
674
|
+
switch (type) {
|
|
675
|
+
case ContainerMessageType.Attach:
|
|
676
|
+
case ContainerMessageType.Alias:
|
|
677
|
+
this.parentContext.submitMessage(type, content, localOpMetadata);
|
|
678
|
+
return;
|
|
679
|
+
case ContainerMessageType.FluidDataStoreOp:
|
|
680
|
+
return this.reSubmitChannelOp(type, content, localOpMetadata);
|
|
681
|
+
default:
|
|
682
|
+
assert(false, "unknown op type");
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
protected reSubmitChannelOp(type: string, content: any, localOpMetadata: unknown) {
|
|
687
|
+
const envelope = content as IEnvelope;
|
|
398
688
|
const context = this.contexts.get(envelope.address);
|
|
399
689
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
400
690
|
// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.
|
|
@@ -407,10 +697,13 @@ export class DataStores implements IDisposable {
|
|
|
407
697
|
});
|
|
408
698
|
}
|
|
409
699
|
assert(!!context, 0x160 /* "There should be a store context for the op" */);
|
|
410
|
-
|
|
700
|
+
const innerContents = envelope.contents as FluidDataStoreMessage;
|
|
701
|
+
context.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
|
|
411
702
|
}
|
|
412
703
|
|
|
413
|
-
public
|
|
704
|
+
public rollback(type: string, content: any, localOpMetadata: unknown) {
|
|
705
|
+
assert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);
|
|
706
|
+
const envelope = content as IEnvelope;
|
|
414
707
|
const context = this.contexts.get(envelope.address);
|
|
415
708
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
416
709
|
// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.
|
|
@@ -423,10 +716,25 @@ export class DataStores implements IDisposable {
|
|
|
423
716
|
});
|
|
424
717
|
}
|
|
425
718
|
assert(!!context, 0x2e8 /* "There should be a store context for the op" */);
|
|
426
|
-
|
|
719
|
+
const innerContents = envelope.contents as FluidDataStoreMessage;
|
|
720
|
+
context.rollback(innerContents.type, innerContents.content, localOpMetadata);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
public async applyStashedOp(content: unknown): Promise<unknown> {
|
|
724
|
+
const opContents = content as LocalContainerRuntimeMessage;
|
|
725
|
+
switch (opContents.type) {
|
|
726
|
+
case ContainerMessageType.Attach:
|
|
727
|
+
return this.applyStashedAttachOp(opContents.contents);
|
|
728
|
+
case ContainerMessageType.Alias:
|
|
729
|
+
return;
|
|
730
|
+
case ContainerMessageType.FluidDataStoreOp:
|
|
731
|
+
return this.applyStashedChannelChannelOp(opContents.contents);
|
|
732
|
+
default:
|
|
733
|
+
assert(false, "unknon type of op");
|
|
734
|
+
}
|
|
427
735
|
}
|
|
428
736
|
|
|
429
|
-
|
|
737
|
+
protected async applyStashedChannelChannelOp(envelope: IEnvelope) {
|
|
430
738
|
const context = this.contexts.get(envelope.address);
|
|
431
739
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
432
740
|
// corruption in case the data store that stashed the op is deleted.
|
|
@@ -437,49 +745,94 @@ export class DataStores implements IDisposable {
|
|
|
437
745
|
return context.applyStashedOp(envelope.contents);
|
|
438
746
|
}
|
|
439
747
|
|
|
440
|
-
|
|
748
|
+
private async applyStashedAttachOp(message: IAttachMessage) {
|
|
441
749
|
this.pendingAttach.set(message.id, message);
|
|
442
750
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
443
751
|
this.processAttachMessage({ contents: message } as ISequencedDocumentMessage, false);
|
|
444
752
|
}
|
|
445
753
|
|
|
446
|
-
public
|
|
754
|
+
public process(
|
|
447
755
|
message: ISequencedDocumentMessage,
|
|
448
756
|
local: boolean,
|
|
449
757
|
localMessageMetadata: unknown,
|
|
450
|
-
addedOutboundReference
|
|
758
|
+
addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
|
|
451
759
|
) {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
760
|
+
switch (message.type) {
|
|
761
|
+
case ContainerMessageType.Attach:
|
|
762
|
+
this.processAttachMessage(message, local);
|
|
763
|
+
return;
|
|
764
|
+
case ContainerMessageType.Alias:
|
|
765
|
+
this.processAliasMessage(message, localMessageMetadata, local);
|
|
766
|
+
return;
|
|
767
|
+
case ContainerMessageType.FluidDataStoreOp: {
|
|
768
|
+
const envelope = message.contents as IEnvelope;
|
|
769
|
+
const innerContents = envelope.contents as FluidDataStoreMessage;
|
|
770
|
+
const transformed = {
|
|
771
|
+
...message,
|
|
772
|
+
type: innerContents.type,
|
|
773
|
+
contents: innerContents.content,
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
this.processChannelOp(envelope.address, transformed, local, localMessageMetadata);
|
|
777
|
+
|
|
778
|
+
// By default, we use the new behavior of detecting outbound routes here.
|
|
779
|
+
// If this setting is true, then DataStoreContext would be notifying GC instead.
|
|
780
|
+
if (
|
|
781
|
+
this.mc.config.getBoolean(detectOutboundRoutesViaDDSKey) !== true &&
|
|
782
|
+
addedOutboundReference !== undefined
|
|
783
|
+
) {
|
|
784
|
+
// Notify GC of any outbound references that were added by this op.
|
|
785
|
+
detectOutboundReferences(
|
|
786
|
+
envelope.address,
|
|
787
|
+
transformed.contents,
|
|
788
|
+
addedOutboundReference,
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
break;
|
|
792
|
+
}
|
|
793
|
+
default:
|
|
794
|
+
assert(false, 0x8e9 /* unreached */);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
protected processChannelOp(
|
|
799
|
+
address: string,
|
|
800
|
+
message: ISequencedDocumentMessage,
|
|
801
|
+
local: boolean,
|
|
802
|
+
localMessageMetadata: unknown,
|
|
803
|
+
) {
|
|
804
|
+
const context = this.contexts.get(address);
|
|
455
805
|
|
|
456
806
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
457
807
|
// corruption in case a deleted data store accidentally submitted an op.
|
|
458
|
-
if (
|
|
459
|
-
this.checkAndLogIfDeleted(
|
|
460
|
-
envelope.address,
|
|
461
|
-
context,
|
|
462
|
-
"Changed",
|
|
463
|
-
"processFluidDataStoreOp",
|
|
464
|
-
)
|
|
465
|
-
) {
|
|
808
|
+
if (this.checkAndLogIfDeleted(address, context, "Changed", "processFluidDataStoreOp")) {
|
|
466
809
|
return;
|
|
467
810
|
}
|
|
468
811
|
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
812
|
+
if (context === undefined) {
|
|
813
|
+
// Former assert 0x162
|
|
814
|
+
throw DataProcessingError.create(
|
|
815
|
+
"No context for op",
|
|
816
|
+
"processFluidDataStoreOp",
|
|
817
|
+
message,
|
|
818
|
+
{
|
|
819
|
+
local,
|
|
820
|
+
messageDetails: JSON.stringify({
|
|
821
|
+
type: message.type,
|
|
822
|
+
contentType: typeof message.contents,
|
|
823
|
+
}),
|
|
824
|
+
...tagCodeArtifacts({ address }),
|
|
825
|
+
},
|
|
826
|
+
);
|
|
477
827
|
}
|
|
478
828
|
|
|
829
|
+
context.process(message, local, localMessageMetadata);
|
|
830
|
+
|
|
479
831
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
480
832
|
// being used.
|
|
481
833
|
this.gcNodeUpdated(
|
|
482
|
-
`/${
|
|
834
|
+
`/${address}`,
|
|
835
|
+
"Changed",
|
|
483
836
|
message.timestamp,
|
|
484
837
|
context.isLoaded ? context.packagePath : undefined,
|
|
485
838
|
);
|
|
@@ -488,7 +841,7 @@ export class DataStores implements IDisposable {
|
|
|
488
841
|
public async getDataStore(
|
|
489
842
|
id: string,
|
|
490
843
|
requestHeaderData: RuntimeHeaderData,
|
|
491
|
-
): Promise<
|
|
844
|
+
): Promise<IFluidDataStoreContextInternal> {
|
|
492
845
|
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
493
846
|
if (
|
|
494
847
|
this.checkAndLogIfDeleted(
|
|
@@ -522,7 +875,7 @@ export class DataStores implements IDisposable {
|
|
|
522
875
|
public async getDataStoreIfAvailable(
|
|
523
876
|
id: string,
|
|
524
877
|
requestHeaderData: RuntimeHeaderData,
|
|
525
|
-
): Promise<
|
|
878
|
+
): Promise<IFluidDataStoreContextInternal | undefined> {
|
|
526
879
|
// If the data store has been deleted, log an error and return undefined.
|
|
527
880
|
if (
|
|
528
881
|
this.checkAndLogIfDeleted(
|
|
@@ -553,7 +906,7 @@ export class DataStores implements IDisposable {
|
|
|
553
906
|
*/
|
|
554
907
|
private checkAndLogIfDeleted(
|
|
555
908
|
id: string,
|
|
556
|
-
context:
|
|
909
|
+
context: IFluidDataStoreContext | undefined,
|
|
557
910
|
deletedLogSuffix: string,
|
|
558
911
|
callSite: string,
|
|
559
912
|
requestHeaderData?: RuntimeHeaderData,
|
|
@@ -573,7 +926,10 @@ export class DataStores implements IDisposable {
|
|
|
573
926
|
return true;
|
|
574
927
|
}
|
|
575
928
|
|
|
576
|
-
public processSignal(
|
|
929
|
+
public processSignal(messageArg: IInboundSignalMessage, local: boolean) {
|
|
930
|
+
const envelope = messageArg.content as IEnvelope;
|
|
931
|
+
const fluidDataStoreId = envelope.address;
|
|
932
|
+
const message = { ...messageArg, content: envelope.contents };
|
|
577
933
|
const context = this.contexts.get(fluidDataStoreId);
|
|
578
934
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
579
935
|
// corruption in case a deleted data store accidentally submitted a signal.
|
|
@@ -609,7 +965,7 @@ export class DataStores implements IDisposable {
|
|
|
609
965
|
fluidDataStoreId,
|
|
610
966
|
}),
|
|
611
967
|
details: JSON.stringify({
|
|
612
|
-
runtimeConnected: this.
|
|
968
|
+
runtimeConnected: this.parentContext.connected,
|
|
613
969
|
connected,
|
|
614
970
|
}),
|
|
615
971
|
},
|
|
@@ -620,11 +976,10 @@ export class DataStores implements IDisposable {
|
|
|
620
976
|
}
|
|
621
977
|
|
|
622
978
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
|
623
|
-
const eventName = attachState === AttachState.Attaching ? "attaching" : "attached";
|
|
624
979
|
for (const [, context] of this.contexts) {
|
|
625
980
|
// Fire only for bounded stores.
|
|
626
981
|
if (!this.contexts.isNotBound(context.id)) {
|
|
627
|
-
context.
|
|
982
|
+
context.setAttachState(attachState);
|
|
628
983
|
}
|
|
629
984
|
}
|
|
630
985
|
}
|
|
@@ -670,7 +1025,10 @@ export class DataStores implements IDisposable {
|
|
|
670
1025
|
return summaryBuilder.getSummaryTree();
|
|
671
1026
|
}
|
|
672
1027
|
|
|
673
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Create a summary. Used when attaching or serializing a detached container.
|
|
1030
|
+
*/
|
|
1031
|
+
public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {
|
|
674
1032
|
const builder = new SummaryTreeBuilder();
|
|
675
1033
|
// Attaching graph of some stores can cause other stores to get bound too.
|
|
676
1034
|
// So keep taking summary until no new stores get bound.
|
|
@@ -694,8 +1052,10 @@ export class DataStores implements IDisposable {
|
|
|
694
1052
|
.map(([key, value]) => {
|
|
695
1053
|
let dataStoreSummary: ISummarizeResult;
|
|
696
1054
|
if (value.isLoaded) {
|
|
697
|
-
|
|
698
|
-
|
|
1055
|
+
dataStoreSummary = value.getAttachData(
|
|
1056
|
+
/* includeGCCData: */ false,
|
|
1057
|
+
telemetryContext,
|
|
1058
|
+
).attachSummary;
|
|
699
1059
|
} else {
|
|
700
1060
|
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
701
1061
|
// which it was created as it is detached container. So just use the previous snapshot.
|
|
@@ -725,8 +1085,12 @@ export class DataStores implements IDisposable {
|
|
|
725
1085
|
assert(context !== undefined, 0x2b6 /* Missing data store context */);
|
|
726
1086
|
if (await context.isRoot()) {
|
|
727
1087
|
// A root data store is basically a reference from the container runtime to the data store.
|
|
728
|
-
const handle = new FluidObjectHandle(
|
|
729
|
-
|
|
1088
|
+
const handle = new FluidObjectHandle(
|
|
1089
|
+
context,
|
|
1090
|
+
id,
|
|
1091
|
+
this.parentContext.IFluidHandleContext,
|
|
1092
|
+
);
|
|
1093
|
+
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
730
1094
|
}
|
|
731
1095
|
}
|
|
732
1096
|
this.dataStoresSinceLastGC = [];
|
|
@@ -800,27 +1164,6 @@ export class DataStores implements IDisposable {
|
|
|
800
1164
|
}
|
|
801
1165
|
}
|
|
802
1166
|
|
|
803
|
-
/**
|
|
804
|
-
* This is called to update objects whose routes are unused. The unused objects are deleted.
|
|
805
|
-
* @param unusedRoutes - The routes that are unused in all data stores in this Container.
|
|
806
|
-
*/
|
|
807
|
-
public updateUnusedRoutes(unusedRoutes: readonly string[]) {
|
|
808
|
-
for (const route of unusedRoutes) {
|
|
809
|
-
const pathParts = route.split("/");
|
|
810
|
-
// Delete data store only if its route (/datastoreId) is in unusedRoutes. We don't want to delete a data
|
|
811
|
-
// store based on its DDS being unused.
|
|
812
|
-
if (pathParts.length > 2) {
|
|
813
|
-
continue;
|
|
814
|
-
}
|
|
815
|
-
const dataStoreId = pathParts[1];
|
|
816
|
-
assert(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);
|
|
817
|
-
// Delete the contexts of unused data stores.
|
|
818
|
-
this.contexts.delete(dataStoreId);
|
|
819
|
-
// Delete the summarizer node of the unused data stores.
|
|
820
|
-
this.deleteChildSummarizerNodeFn(dataStoreId);
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
1167
|
/**
|
|
825
1168
|
* Delete data stores and its objects that are sweep ready.
|
|
826
1169
|
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
@@ -828,16 +1171,13 @@ export class DataStores implements IDisposable {
|
|
|
828
1171
|
* @returns The routes of data stores and its objects that were deleted.
|
|
829
1172
|
*/
|
|
830
1173
|
public deleteSweepReadyNodes(sweepReadyDataStoreRoutes: readonly string[]): readonly string[] {
|
|
831
|
-
// If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
|
|
832
|
-
if (this.mc.config.getBoolean(disableDatastoreSweepKey) === true) {
|
|
833
|
-
return [];
|
|
834
|
-
}
|
|
835
1174
|
for (const route of sweepReadyDataStoreRoutes) {
|
|
836
1175
|
const pathParts = route.split("/");
|
|
837
1176
|
const dataStoreId = pathParts[1];
|
|
838
1177
|
|
|
839
1178
|
// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only
|
|
840
1179
|
// need to delete the data store.
|
|
1180
|
+
// These routes will still be returned below as among the deleted routes
|
|
841
1181
|
if (pathParts.length > 2) {
|
|
842
1182
|
continue;
|
|
843
1183
|
}
|
|
@@ -862,7 +1202,7 @@ export class DataStores implements IDisposable {
|
|
|
862
1202
|
// Delete the contexts of sweep ready data stores.
|
|
863
1203
|
this.contexts.delete(dataStoreId);
|
|
864
1204
|
// Delete the summarizer node of the sweep ready data stores.
|
|
865
|
-
this.
|
|
1205
|
+
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
866
1206
|
}
|
|
867
1207
|
return Array.from(sweepReadyDataStoreRoutes);
|
|
868
1208
|
}
|
|
@@ -936,6 +1276,69 @@ export class DataStores implements IDisposable {
|
|
|
936
1276
|
}
|
|
937
1277
|
return GCNodeType.SubDataStore;
|
|
938
1278
|
}
|
|
1279
|
+
|
|
1280
|
+
public internalId(maybeAlias: string): string {
|
|
1281
|
+
return this.aliases.get(maybeAlias) ?? maybeAlias;
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
public async request(request: IRequest): Promise<IResponse> {
|
|
1285
|
+
const requestParser = RequestParser.create(request);
|
|
1286
|
+
const id = requestParser.pathParts[0];
|
|
1287
|
+
|
|
1288
|
+
// Differentiate between requesting the dataStore directly, or one of its children
|
|
1289
|
+
const requestForChild = !requestParser.isLeaf(1);
|
|
1290
|
+
|
|
1291
|
+
const headerData: RuntimeHeaderData = {};
|
|
1292
|
+
if (typeof request.headers?.[RuntimeHeaders.wait] === "boolean") {
|
|
1293
|
+
headerData.wait = request.headers[RuntimeHeaders.wait];
|
|
1294
|
+
}
|
|
1295
|
+
if (typeof request.headers?.[RuntimeHeaders.viaHandle] === "boolean") {
|
|
1296
|
+
headerData.viaHandle = request.headers[RuntimeHeaders.viaHandle];
|
|
1297
|
+
}
|
|
1298
|
+
if (typeof request.headers?.[AllowTombstoneRequestHeaderKey] === "boolean") {
|
|
1299
|
+
headerData.allowTombstone = request.headers[AllowTombstoneRequestHeaderKey];
|
|
1300
|
+
}
|
|
1301
|
+
if (typeof request.headers?.[AllowInactiveRequestHeaderKey] === "boolean") {
|
|
1302
|
+
headerData.allowInactive = request.headers[AllowInactiveRequestHeaderKey];
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
// We allow Tombstone requests for sub-DataStore objects
|
|
1306
|
+
if (requestForChild) {
|
|
1307
|
+
headerData.allowTombstone = true;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
await this.waitIfPendingAlias(id);
|
|
1311
|
+
const internalId = this.internalId(id);
|
|
1312
|
+
const dataStoreContext = await this.getDataStore(internalId, headerData);
|
|
1313
|
+
|
|
1314
|
+
// Remove query params, leading and trailing slashes from the url. This is done to make sure the format is
|
|
1315
|
+
// the same as GC nodes id.
|
|
1316
|
+
const urlWithoutQuery = trimLeadingAndTrailingSlashes(request.url.split("?")[0]);
|
|
1317
|
+
// Get the initial snapshot details which contain the data store package path.
|
|
1318
|
+
const details = await dataStoreContext.getInitialSnapshotDetails();
|
|
1319
|
+
|
|
1320
|
+
// Note that this will throw if the data store is inactive or tombstoned and throwing on incorrect usage
|
|
1321
|
+
// is configured.
|
|
1322
|
+
this.gcNodeUpdated(
|
|
1323
|
+
`/${urlWithoutQuery}`,
|
|
1324
|
+
"Loaded",
|
|
1325
|
+
undefined /* timestampMs */,
|
|
1326
|
+
details.pkg,
|
|
1327
|
+
request,
|
|
1328
|
+
headerData,
|
|
1329
|
+
);
|
|
1330
|
+
const dataStore = await dataStoreContext.realize();
|
|
1331
|
+
|
|
1332
|
+
const subRequest = requestParser.createSubRequest(1);
|
|
1333
|
+
// We always expect createSubRequest to include a leading slash, but asserting here to protect against
|
|
1334
|
+
// unintentionally modifying the url if that changes.
|
|
1335
|
+
assert(
|
|
1336
|
+
subRequest.url.startsWith("/"),
|
|
1337
|
+
0x126 /* "Expected createSubRequest url to include a leading slash" */,
|
|
1338
|
+
);
|
|
1339
|
+
|
|
1340
|
+
return dataStore.request(subRequest);
|
|
1341
|
+
}
|
|
939
1342
|
}
|
|
940
1343
|
|
|
941
1344
|
export function getSummaryForDatastores(
|
|
@@ -971,7 +1374,8 @@ export function getSummaryForDatastores(
|
|
|
971
1374
|
* @internal
|
|
972
1375
|
*/
|
|
973
1376
|
export function detectOutboundReferences(
|
|
974
|
-
|
|
1377
|
+
address: string,
|
|
1378
|
+
contents: unknown,
|
|
975
1379
|
addedOutboundReference: (fromNodePath: string, toNodePath: string) => void,
|
|
976
1380
|
): void {
|
|
977
1381
|
// These will be built up as we traverse the envelope contents
|
|
@@ -998,10 +1402,51 @@ export function detectOutboundReferences(
|
|
|
998
1402
|
}
|
|
999
1403
|
}
|
|
1000
1404
|
|
|
1001
|
-
recursivelyFindHandles(
|
|
1405
|
+
recursivelyFindHandles(contents);
|
|
1002
1406
|
|
|
1003
1407
|
// GC node paths are all absolute paths, hence the "" prefix.
|
|
1004
1408
|
// e.g. this will yield "/dataStoreId/ddsId"
|
|
1005
|
-
const fromPath = ["",
|
|
1409
|
+
const fromPath = ["", address, ddsAddress].join("/");
|
|
1006
1410
|
outboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));
|
|
1007
1411
|
}
|
|
1412
|
+
|
|
1413
|
+
/** @internal */
|
|
1414
|
+
export class ChannelCollectionFactory<T extends ChannelCollection = ChannelCollection>
|
|
1415
|
+
implements IFluidDataStoreFactory
|
|
1416
|
+
{
|
|
1417
|
+
public readonly type = "ChannelCollectionChannel";
|
|
1418
|
+
|
|
1419
|
+
public IFluidDataStoreRegistry: IFluidDataStoreRegistry;
|
|
1420
|
+
|
|
1421
|
+
constructor(
|
|
1422
|
+
registryEntries: NamedFluidDataStoreRegistryEntries,
|
|
1423
|
+
// ADO:7302 We need a better type here
|
|
1424
|
+
private readonly provideEntryPoint: (
|
|
1425
|
+
runtime: IFluidDataStoreChannel,
|
|
1426
|
+
) => Promise<FluidObject>,
|
|
1427
|
+
private readonly ctor: (...args: ConstructorParameters<typeof ChannelCollection>) => T,
|
|
1428
|
+
) {
|
|
1429
|
+
this.IFluidDataStoreRegistry = new FluidDataStoreRegistry(registryEntries);
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
public get IFluidDataStoreFactory() {
|
|
1433
|
+
return this;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
public async instantiateDataStore(
|
|
1437
|
+
context: IFluidDataStoreContext,
|
|
1438
|
+
_existing: boolean,
|
|
1439
|
+
): Promise<IFluidDataStoreChannel> {
|
|
1440
|
+
const runtime = this.ctor(
|
|
1441
|
+
context.baseSnapshot,
|
|
1442
|
+
context, // parentContext
|
|
1443
|
+
context.logger,
|
|
1444
|
+
() => {}, // gcNodeUpdated
|
|
1445
|
+
(_nodePath: string) => false, // isDataStoreDeleted
|
|
1446
|
+
new Map(), // aliasMap
|
|
1447
|
+
this.provideEntryPoint,
|
|
1448
|
+
);
|
|
1449
|
+
|
|
1450
|
+
return runtime;
|
|
1451
|
+
}
|
|
1452
|
+
}
|