@fluidframework/container-runtime 2.0.0-dev-rc.1.0.0.228517 → 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.js → .eslintrc.cjs} +5 -5
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +54 -0
- package/README.md +46 -1
- 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 +435 -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} +449 -143
- 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 +138 -49
- package/dist/container-runtime-beta.d.ts +75 -9
- package/dist/container-runtime-public.d.ts +75 -9
- package/dist/container-runtime-untrimmed.d.ts +717 -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 +84 -64
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +550 -427
- 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 -38
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +249 -161
- 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 +29 -7
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +179 -98
- 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 +40 -15
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +11 -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 +7 -7
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +20 -20
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +6 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +22 -11
- 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 -38
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +11 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +36 -40
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +4 -4
- 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 +11 -10
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +114 -81
- 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 +17 -7
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +45 -57
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +10 -19
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +1 -21
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +5 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +16 -16
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +10 -21
- 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} +436 -133
- 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} +138 -49
- package/lib/{container-runtime-beta.d.mts → container-runtime-beta.d.ts} +75 -9
- package/lib/{container-runtime-public.d.mts → container-runtime-public.d.ts} +75 -9
- package/lib/{container-runtime-untrimmed.d.mts → container-runtime-untrimmed.d.ts} +717 -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} +89 -65
- package/lib/containerRuntime.d.ts.map +1 -0
- package/lib/{containerRuntime.mjs → containerRuntime.js} +469 -348
- 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 -39
- package/lib/dataStoreContext.d.ts.map +1 -0
- package/lib/{dataStoreContext.mjs → dataStoreContext.js} +241 -153
- 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} +30 -8
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/gc/{garbageCollection.mjs → garbageCollection.js} +149 -68
- 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} +41 -16
- package/lib/gc/gcDefinitions.d.ts.map +1 -0
- package/lib/gc/{gcDefinitions.mjs → gcDefinitions.js} +11 -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} +8 -8
- package/lib/gc/gcTelemetry.d.ts.map +1 -0
- package/lib/gc/{gcTelemetry.mjs → gcTelemetry.js} +5 -5
- package/lib/gc/gcTelemetry.js.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.d.mts → gcUnreferencedStateTracker.d.ts} +7 -2
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.mjs → gcUnreferencedStateTracker.js} +12 -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 -21
- 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} +5 -5
- 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} +12 -11
- package/lib/summary/runningSummarizer.d.ts.map +1 -0
- package/lib/summary/{runningSummarizer.mjs → runningSummarizer.js} +108 -75
- 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} +18 -8
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.mjs → summarizerNode.js} +41 -53
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.d.mts → summarizerNodeUtils.d.ts} +11 -20
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.mjs → summarizerNodeUtils.js} +1 -20
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.d.mts → summarizerNodeWithGc.d.ts} +6 -7
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.mjs → summarizerNodeWithGc.js} +12 -12
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/lib/summary/{summarizerTypes.d.mts → summarizerTypes.d.ts} +11 -22
- 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 +106 -87
- package/src/batchTracker.ts +1 -1
- package/src/blobManager.ts +1 -15
- package/src/{dataStores.ts → channelCollection.ts} +622 -170
- package/src/connectionTelemetry.ts +42 -3
- package/src/containerHandleContext.ts +1 -1
- package/src/containerRuntime.ts +683 -483
- package/src/dataStore.ts +16 -15
- package/src/dataStoreContext.ts +378 -216
- package/src/dataStoreContexts.ts +2 -1
- package/src/deltaManagerSummarizerProxy.ts +132 -7
- package/src/gc/garbageCollection.ts +167 -71
- package/src/gc/gcConfigs.ts +17 -7
- package/src/gc/gcDefinitions.ts +42 -16
- 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 +10 -9
- package/src/gc/gcUnreferencedStateTracker.ts +12 -1
- package/src/gc/index.ts +11 -9
- package/src/index.ts +29 -26
- package/src/messageTypes.ts +4 -4
- 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 +141 -93
- 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 +54 -69
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +16 -34
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -17
- package/src/summary/summarizerTypes.ts +12 -24
- 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 -149
- 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 -149
- 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 -24
- 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,16 +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
|
}),
|
|
328
|
+
loadingGroupId: value.groupId,
|
|
156
329
|
});
|
|
157
330
|
} else {
|
|
158
331
|
if (typeof value !== "object") {
|
|
@@ -162,15 +335,14 @@ export class DataStores implements IDisposable {
|
|
|
162
335
|
dataStoreContext = new LocalFluidDataStoreContext({
|
|
163
336
|
id: key,
|
|
164
337
|
pkg: undefined,
|
|
165
|
-
|
|
166
|
-
storage: this.
|
|
167
|
-
scope: this.
|
|
168
|
-
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, {
|
|
169
342
|
type: CreateSummarizerNodeSource.FromSummary,
|
|
170
343
|
}),
|
|
171
344
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),
|
|
172
345
|
snapshotTree,
|
|
173
|
-
isRootDataStore: undefined,
|
|
174
346
|
});
|
|
175
347
|
}
|
|
176
348
|
this.contexts.addBoundOrRemoted(dataStoreContext);
|
|
@@ -194,18 +366,60 @@ export class DataStores implements IDisposable {
|
|
|
194
366
|
return pendingAliasPromise ?? "Success";
|
|
195
367
|
}
|
|
196
368
|
|
|
197
|
-
|
|
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) {
|
|
198
386
|
const attachMessage = message.contents as InboundAttachMessage;
|
|
199
387
|
|
|
200
388
|
this.dataStoresSinceLastGC.push(attachMessage.id);
|
|
201
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
|
+
|
|
202
416
|
// The local object has already been attached
|
|
203
417
|
if (local) {
|
|
204
418
|
assert(
|
|
205
419
|
this.pendingAttach.has(attachMessage.id),
|
|
206
420
|
0x15e /* "Local object does not have matching attach message id" */,
|
|
207
421
|
);
|
|
208
|
-
this.contexts.get(attachMessage.id)?.
|
|
422
|
+
this.contexts.get(attachMessage.id)?.setAttachState(AttachState.Attached);
|
|
209
423
|
this.pendingAttach.delete(attachMessage.id);
|
|
210
424
|
return;
|
|
211
425
|
}
|
|
@@ -236,23 +450,27 @@ export class DataStores implements IDisposable {
|
|
|
236
450
|
const remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({
|
|
237
451
|
id: attachMessage.id,
|
|
238
452
|
snapshotTree,
|
|
239
|
-
|
|
240
|
-
storage: new StorageServiceWithAttachBlobs(this.
|
|
241
|
-
scope: this.
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
+
},
|
|
247
465
|
},
|
|
248
|
-
|
|
466
|
+
),
|
|
249
467
|
pkg,
|
|
250
468
|
});
|
|
251
469
|
|
|
252
470
|
this.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);
|
|
253
471
|
}
|
|
254
472
|
|
|
255
|
-
|
|
473
|
+
private processAliasMessage(
|
|
256
474
|
message: ISequencedDocumentMessage,
|
|
257
475
|
localOpMetadata: unknown,
|
|
258
476
|
local: boolean,
|
|
@@ -265,47 +483,43 @@ export class DataStores implements IDisposable {
|
|
|
265
483
|
}
|
|
266
484
|
|
|
267
485
|
const resolve = localOpMetadata as PendingAliasResolve;
|
|
268
|
-
const aliasResult = this.processAliasMessageCore(
|
|
486
|
+
const aliasResult = this.processAliasMessageCore(
|
|
487
|
+
aliasMessage.internalId,
|
|
488
|
+
aliasMessage.alias,
|
|
489
|
+
);
|
|
269
490
|
if (local) {
|
|
270
491
|
resolve(aliasResult);
|
|
271
492
|
}
|
|
272
493
|
}
|
|
273
494
|
|
|
274
|
-
public processAliasMessageCore(
|
|
275
|
-
if (this.alreadyProcessed(
|
|
495
|
+
public processAliasMessageCore(internalId: string, alias: string): boolean {
|
|
496
|
+
if (this.alreadyProcessed(alias)) {
|
|
276
497
|
return false;
|
|
277
498
|
}
|
|
278
499
|
|
|
279
|
-
const context = this.contexts.get(
|
|
500
|
+
const context = this.contexts.get(internalId);
|
|
280
501
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
281
502
|
// corruption in case a deleted data store accidentally submitted a signal.
|
|
282
|
-
if (
|
|
283
|
-
this.checkAndLogIfDeleted(
|
|
284
|
-
aliasMessage.internalId,
|
|
285
|
-
context,
|
|
286
|
-
"Changed",
|
|
287
|
-
"processAliasMessageCore",
|
|
288
|
-
)
|
|
289
|
-
) {
|
|
503
|
+
if (this.checkAndLogIfDeleted(internalId, context, "Changed", "processAliasMessageCore")) {
|
|
290
504
|
return false;
|
|
291
505
|
}
|
|
292
506
|
|
|
293
507
|
if (context === undefined) {
|
|
294
508
|
this.mc.logger.sendErrorEvent({
|
|
295
509
|
eventName: "AliasFluidDataStoreNotFound",
|
|
296
|
-
fluidDataStoreId:
|
|
510
|
+
fluidDataStoreId: internalId,
|
|
297
511
|
});
|
|
298
512
|
return false;
|
|
299
513
|
}
|
|
300
514
|
|
|
301
515
|
const handle = new FluidObjectHandle(
|
|
302
516
|
context,
|
|
303
|
-
|
|
304
|
-
this.
|
|
517
|
+
internalId,
|
|
518
|
+
this.parentContext.IFluidHandleContext,
|
|
305
519
|
);
|
|
306
|
-
this.
|
|
520
|
+
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
307
521
|
|
|
308
|
-
this.aliasMap.set(
|
|
522
|
+
this.aliasMap.set(alias, context.id);
|
|
309
523
|
context.setInMemoryRoot();
|
|
310
524
|
return true;
|
|
311
525
|
}
|
|
@@ -314,9 +528,24 @@ export class DataStores implements IDisposable {
|
|
|
314
528
|
return this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;
|
|
315
529
|
}
|
|
316
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
|
+
|
|
317
546
|
/**
|
|
318
|
-
* Make the data
|
|
319
|
-
* 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.
|
|
320
549
|
* @param id - The id of the data store context to make visible.
|
|
321
550
|
*/
|
|
322
551
|
private makeDataStoreLocallyVisible(id: string): void {
|
|
@@ -328,58 +557,110 @@ export class DataStores implements IDisposable {
|
|
|
328
557
|
* globally visible. Move it to attaching state and send an "attach" op for it.
|
|
329
558
|
* If the container is detached, this data store will be part of the summary that makes the container attached.
|
|
330
559
|
*/
|
|
331
|
-
if (this.
|
|
332
|
-
localContext.
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
this.pendingAttach.set(id, message);
|
|
336
|
-
this.submitAttachFn(message);
|
|
337
|
-
this.attachOpFiredForDataStore.add(id);
|
|
560
|
+
if (this.parentContext.attachState !== AttachState.Detached) {
|
|
561
|
+
localContext.setAttachState(AttachState.Attaching);
|
|
562
|
+
this.submitAttachChannelOp(localContext);
|
|
338
563
|
}
|
|
339
564
|
|
|
340
565
|
this.contexts.bind(id);
|
|
341
566
|
}
|
|
342
567
|
|
|
343
|
-
|
|
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(
|
|
344
609
|
pkg: Readonly<string[]>,
|
|
345
|
-
|
|
346
|
-
id = uuid(),
|
|
610
|
+
loadingGroupId?: string,
|
|
347
611
|
): IFluidDataStoreContextDetached {
|
|
348
|
-
|
|
612
|
+
return this.createContext(
|
|
613
|
+
this.createDataStoreId(),
|
|
614
|
+
pkg,
|
|
615
|
+
LocalDetachedFluidDataStoreContext,
|
|
616
|
+
undefined, // props
|
|
617
|
+
loadingGroupId,
|
|
618
|
+
);
|
|
619
|
+
}
|
|
349
620
|
|
|
350
|
-
|
|
351
|
-
|
|
621
|
+
public createDataStoreContext(
|
|
622
|
+
pkg: Readonly<string[]>,
|
|
623
|
+
props?: any,
|
|
624
|
+
loadingGroupId?: string,
|
|
625
|
+
): IFluidDataStoreContextInternal {
|
|
626
|
+
return this.createContext(
|
|
627
|
+
this.createDataStoreId(),
|
|
352
628
|
pkg,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
type: CreateSummarizerNodeSource.Local,
|
|
358
|
-
}),
|
|
359
|
-
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
360
|
-
snapshotTree: undefined,
|
|
361
|
-
isRootDataStore: isRoot,
|
|
362
|
-
});
|
|
363
|
-
this.contexts.addUnbound(context);
|
|
364
|
-
return context;
|
|
629
|
+
LocalFluidDataStoreContext,
|
|
630
|
+
props,
|
|
631
|
+
loadingGroupId,
|
|
632
|
+
);
|
|
365
633
|
}
|
|
366
634
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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({
|
|
370
643
|
id,
|
|
371
644
|
pkg,
|
|
372
|
-
|
|
373
|
-
storage: this.
|
|
374
|
-
scope: this.
|
|
375
|
-
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, {
|
|
376
649
|
type: CreateSummarizerNodeSource.Local,
|
|
377
650
|
}),
|
|
378
651
|
makeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),
|
|
379
652
|
snapshotTree: undefined,
|
|
380
|
-
|
|
381
|
-
|
|
653
|
+
createProps,
|
|
654
|
+
loadingGroupId,
|
|
655
|
+
channelToDataStoreFn: (channel: IFluidDataStoreChannel) =>
|
|
656
|
+
channelToDataStore(
|
|
657
|
+
channel,
|
|
658
|
+
id,
|
|
659
|
+
this,
|
|
660
|
+
createChildLogger({ logger: this.parentContext.logger }),
|
|
661
|
+
),
|
|
382
662
|
});
|
|
663
|
+
|
|
383
664
|
this.contexts.addUnbound(context);
|
|
384
665
|
return context;
|
|
385
666
|
}
|
|
@@ -389,7 +670,21 @@ export class DataStores implements IDisposable {
|
|
|
389
670
|
}
|
|
390
671
|
public readonly dispose = () => this.disposeOnce.value;
|
|
391
672
|
|
|
392
|
-
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;
|
|
393
688
|
const context = this.contexts.get(envelope.address);
|
|
394
689
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
395
690
|
// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.
|
|
@@ -402,10 +697,13 @@ export class DataStores implements IDisposable {
|
|
|
402
697
|
});
|
|
403
698
|
}
|
|
404
699
|
assert(!!context, 0x160 /* "There should be a store context for the op" */);
|
|
405
|
-
|
|
700
|
+
const innerContents = envelope.contents as FluidDataStoreMessage;
|
|
701
|
+
context.reSubmit(innerContents.type, innerContents.content, localOpMetadata);
|
|
406
702
|
}
|
|
407
703
|
|
|
408
|
-
public
|
|
704
|
+
public rollback(type: string, content: any, localOpMetadata: unknown) {
|
|
705
|
+
assert(type === ContainerMessageType.FluidDataStoreOp, 0x8e8 /* type */);
|
|
706
|
+
const envelope = content as IEnvelope;
|
|
409
707
|
const context = this.contexts.get(envelope.address);
|
|
410
708
|
// If the data store has been deleted, log an error and throw an error. If there are local changes for a
|
|
411
709
|
// deleted data store, it can otherwise lead to inconsistent state when compared to other clients.
|
|
@@ -418,10 +716,25 @@ export class DataStores implements IDisposable {
|
|
|
418
716
|
});
|
|
419
717
|
}
|
|
420
718
|
assert(!!context, 0x2e8 /* "There should be a store context for the op" */);
|
|
421
|
-
|
|
719
|
+
const innerContents = envelope.contents as FluidDataStoreMessage;
|
|
720
|
+
context.rollback(innerContents.type, innerContents.content, localOpMetadata);
|
|
422
721
|
}
|
|
423
722
|
|
|
424
|
-
public async applyStashedOp(
|
|
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
|
+
}
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
protected async applyStashedChannelChannelOp(envelope: IEnvelope) {
|
|
425
738
|
const context = this.contexts.get(envelope.address);
|
|
426
739
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
427
740
|
// corruption in case the data store that stashed the op is deleted.
|
|
@@ -432,49 +745,94 @@ export class DataStores implements IDisposable {
|
|
|
432
745
|
return context.applyStashedOp(envelope.contents);
|
|
433
746
|
}
|
|
434
747
|
|
|
435
|
-
|
|
748
|
+
private async applyStashedAttachOp(message: IAttachMessage) {
|
|
436
749
|
this.pendingAttach.set(message.id, message);
|
|
437
750
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
438
751
|
this.processAttachMessage({ contents: message } as ISequencedDocumentMessage, false);
|
|
439
752
|
}
|
|
440
753
|
|
|
441
|
-
public
|
|
754
|
+
public process(
|
|
442
755
|
message: ISequencedDocumentMessage,
|
|
443
756
|
local: boolean,
|
|
444
757
|
localMessageMetadata: unknown,
|
|
445
|
-
addedOutboundReference
|
|
758
|
+
addedOutboundReference?: (fromNodePath: string, toNodePath: string) => void,
|
|
446
759
|
) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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);
|
|
450
805
|
|
|
451
806
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
452
807
|
// corruption in case a deleted data store accidentally submitted an op.
|
|
453
|
-
if (
|
|
454
|
-
this.checkAndLogIfDeleted(
|
|
455
|
-
envelope.address,
|
|
456
|
-
context,
|
|
457
|
-
"Changed",
|
|
458
|
-
"processFluidDataStoreOp",
|
|
459
|
-
)
|
|
460
|
-
) {
|
|
808
|
+
if (this.checkAndLogIfDeleted(address, context, "Changed", "processFluidDataStoreOp")) {
|
|
461
809
|
return;
|
|
462
810
|
}
|
|
463
811
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
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
|
+
);
|
|
472
827
|
}
|
|
473
828
|
|
|
829
|
+
context.process(message, local, localMessageMetadata);
|
|
830
|
+
|
|
474
831
|
// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is
|
|
475
832
|
// being used.
|
|
476
833
|
this.gcNodeUpdated(
|
|
477
|
-
`/${
|
|
834
|
+
`/${address}`,
|
|
835
|
+
"Changed",
|
|
478
836
|
message.timestamp,
|
|
479
837
|
context.isLoaded ? context.packagePath : undefined,
|
|
480
838
|
);
|
|
@@ -483,7 +841,7 @@ export class DataStores implements IDisposable {
|
|
|
483
841
|
public async getDataStore(
|
|
484
842
|
id: string,
|
|
485
843
|
requestHeaderData: RuntimeHeaderData,
|
|
486
|
-
): Promise<
|
|
844
|
+
): Promise<IFluidDataStoreContextInternal> {
|
|
487
845
|
const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
|
|
488
846
|
if (
|
|
489
847
|
this.checkAndLogIfDeleted(
|
|
@@ -517,7 +875,7 @@ export class DataStores implements IDisposable {
|
|
|
517
875
|
public async getDataStoreIfAvailable(
|
|
518
876
|
id: string,
|
|
519
877
|
requestHeaderData: RuntimeHeaderData,
|
|
520
|
-
): Promise<
|
|
878
|
+
): Promise<IFluidDataStoreContextInternal | undefined> {
|
|
521
879
|
// If the data store has been deleted, log an error and return undefined.
|
|
522
880
|
if (
|
|
523
881
|
this.checkAndLogIfDeleted(
|
|
@@ -548,7 +906,7 @@ export class DataStores implements IDisposable {
|
|
|
548
906
|
*/
|
|
549
907
|
private checkAndLogIfDeleted(
|
|
550
908
|
id: string,
|
|
551
|
-
context:
|
|
909
|
+
context: IFluidDataStoreContext | undefined,
|
|
552
910
|
deletedLogSuffix: string,
|
|
553
911
|
callSite: string,
|
|
554
912
|
requestHeaderData?: RuntimeHeaderData,
|
|
@@ -568,7 +926,10 @@ export class DataStores implements IDisposable {
|
|
|
568
926
|
return true;
|
|
569
927
|
}
|
|
570
928
|
|
|
571
|
-
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 };
|
|
572
933
|
const context = this.contexts.get(fluidDataStoreId);
|
|
573
934
|
// If the data store has been deleted, log an error and ignore this message. This helps prevent document
|
|
574
935
|
// corruption in case a deleted data store accidentally submitted a signal.
|
|
@@ -604,7 +965,7 @@ export class DataStores implements IDisposable {
|
|
|
604
965
|
fluidDataStoreId,
|
|
605
966
|
}),
|
|
606
967
|
details: JSON.stringify({
|
|
607
|
-
runtimeConnected: this.
|
|
968
|
+
runtimeConnected: this.parentContext.connected,
|
|
608
969
|
connected,
|
|
609
970
|
}),
|
|
610
971
|
},
|
|
@@ -615,11 +976,10 @@ export class DataStores implements IDisposable {
|
|
|
615
976
|
}
|
|
616
977
|
|
|
617
978
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
|
618
|
-
const eventName = attachState === AttachState.Attaching ? "attaching" : "attached";
|
|
619
979
|
for (const [, context] of this.contexts) {
|
|
620
980
|
// Fire only for bounded stores.
|
|
621
981
|
if (!this.contexts.isNotBound(context.id)) {
|
|
622
|
-
context.
|
|
982
|
+
context.setAttachState(attachState);
|
|
623
983
|
}
|
|
624
984
|
}
|
|
625
985
|
}
|
|
@@ -665,7 +1025,10 @@ export class DataStores implements IDisposable {
|
|
|
665
1025
|
return summaryBuilder.getSummaryTree();
|
|
666
1026
|
}
|
|
667
1027
|
|
|
668
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Create a summary. Used when attaching or serializing a detached container.
|
|
1030
|
+
*/
|
|
1031
|
+
public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {
|
|
669
1032
|
const builder = new SummaryTreeBuilder();
|
|
670
1033
|
// Attaching graph of some stores can cause other stores to get bound too.
|
|
671
1034
|
// So keep taking summary until no new stores get bound.
|
|
@@ -689,8 +1052,10 @@ export class DataStores implements IDisposable {
|
|
|
689
1052
|
.map(([key, value]) => {
|
|
690
1053
|
let dataStoreSummary: ISummarizeResult;
|
|
691
1054
|
if (value.isLoaded) {
|
|
692
|
-
|
|
693
|
-
|
|
1055
|
+
dataStoreSummary = value.getAttachData(
|
|
1056
|
+
/* includeGCCData: */ false,
|
|
1057
|
+
telemetryContext,
|
|
1058
|
+
).attachSummary;
|
|
694
1059
|
} else {
|
|
695
1060
|
// If this data store is not yet loaded, then there should be no changes in the snapshot from
|
|
696
1061
|
// which it was created as it is detached container. So just use the previous snapshot.
|
|
@@ -720,8 +1085,12 @@ export class DataStores implements IDisposable {
|
|
|
720
1085
|
assert(context !== undefined, 0x2b6 /* Missing data store context */);
|
|
721
1086
|
if (await context.isRoot()) {
|
|
722
1087
|
// A root data store is basically a reference from the container runtime to the data store.
|
|
723
|
-
const handle = new FluidObjectHandle(
|
|
724
|
-
|
|
1088
|
+
const handle = new FluidObjectHandle(
|
|
1089
|
+
context,
|
|
1090
|
+
id,
|
|
1091
|
+
this.parentContext.IFluidHandleContext,
|
|
1092
|
+
);
|
|
1093
|
+
this.parentContext.addedGCOutboundReference?.(this.containerRuntimeHandle, handle);
|
|
725
1094
|
}
|
|
726
1095
|
}
|
|
727
1096
|
this.dataStoresSinceLastGC = [];
|
|
@@ -795,27 +1164,6 @@ export class DataStores implements IDisposable {
|
|
|
795
1164
|
}
|
|
796
1165
|
}
|
|
797
1166
|
|
|
798
|
-
/**
|
|
799
|
-
* This is called to update objects whose routes are unused. The unused objects are deleted.
|
|
800
|
-
* @param unusedRoutes - The routes that are unused in all data stores in this Container.
|
|
801
|
-
*/
|
|
802
|
-
public updateUnusedRoutes(unusedRoutes: readonly string[]) {
|
|
803
|
-
for (const route of unusedRoutes) {
|
|
804
|
-
const pathParts = route.split("/");
|
|
805
|
-
// Delete data store only if its route (/datastoreId) is in unusedRoutes. We don't want to delete a data
|
|
806
|
-
// store based on its DDS being unused.
|
|
807
|
-
if (pathParts.length > 2) {
|
|
808
|
-
continue;
|
|
809
|
-
}
|
|
810
|
-
const dataStoreId = pathParts[1];
|
|
811
|
-
assert(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);
|
|
812
|
-
// Delete the contexts of unused data stores.
|
|
813
|
-
this.contexts.delete(dataStoreId);
|
|
814
|
-
// Delete the summarizer node of the unused data stores.
|
|
815
|
-
this.deleteChildSummarizerNodeFn(dataStoreId);
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
|
|
819
1167
|
/**
|
|
820
1168
|
* Delete data stores and its objects that are sweep ready.
|
|
821
1169
|
* @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
|
|
@@ -823,16 +1171,13 @@ export class DataStores implements IDisposable {
|
|
|
823
1171
|
* @returns The routes of data stores and its objects that were deleted.
|
|
824
1172
|
*/
|
|
825
1173
|
public deleteSweepReadyNodes(sweepReadyDataStoreRoutes: readonly string[]): readonly string[] {
|
|
826
|
-
// If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
|
|
827
|
-
if (this.mc.config.getBoolean(disableDatastoreSweepKey) === true) {
|
|
828
|
-
return [];
|
|
829
|
-
}
|
|
830
1174
|
for (const route of sweepReadyDataStoreRoutes) {
|
|
831
1175
|
const pathParts = route.split("/");
|
|
832
1176
|
const dataStoreId = pathParts[1];
|
|
833
1177
|
|
|
834
1178
|
// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only
|
|
835
1179
|
// need to delete the data store.
|
|
1180
|
+
// These routes will still be returned below as among the deleted routes
|
|
836
1181
|
if (pathParts.length > 2) {
|
|
837
1182
|
continue;
|
|
838
1183
|
}
|
|
@@ -857,7 +1202,7 @@ export class DataStores implements IDisposable {
|
|
|
857
1202
|
// Delete the contexts of sweep ready data stores.
|
|
858
1203
|
this.contexts.delete(dataStoreId);
|
|
859
1204
|
// Delete the summarizer node of the sweep ready data stores.
|
|
860
|
-
this.
|
|
1205
|
+
this.parentContext.deleteChildSummarizerNode?.(dataStoreId);
|
|
861
1206
|
}
|
|
862
1207
|
return Array.from(sweepReadyDataStoreRoutes);
|
|
863
1208
|
}
|
|
@@ -931,6 +1276,69 @@ export class DataStores implements IDisposable {
|
|
|
931
1276
|
}
|
|
932
1277
|
return GCNodeType.SubDataStore;
|
|
933
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
|
+
}
|
|
934
1342
|
}
|
|
935
1343
|
|
|
936
1344
|
export function getSummaryForDatastores(
|
|
@@ -962,9 +1370,12 @@ export function getSummaryForDatastores(
|
|
|
962
1370
|
|
|
963
1371
|
/**
|
|
964
1372
|
* Traverse this op's contents and detect any outbound routes that were added by this op.
|
|
1373
|
+
*
|
|
1374
|
+
* @internal
|
|
965
1375
|
*/
|
|
966
1376
|
export function detectOutboundReferences(
|
|
967
|
-
|
|
1377
|
+
address: string,
|
|
1378
|
+
contents: unknown,
|
|
968
1379
|
addedOutboundReference: (fromNodePath: string, toNodePath: string) => void,
|
|
969
1380
|
): void {
|
|
970
1381
|
// These will be built up as we traverse the envelope contents
|
|
@@ -991,10 +1402,51 @@ export function detectOutboundReferences(
|
|
|
991
1402
|
}
|
|
992
1403
|
}
|
|
993
1404
|
|
|
994
|
-
recursivelyFindHandles(
|
|
1405
|
+
recursivelyFindHandles(contents);
|
|
995
1406
|
|
|
996
1407
|
// GC node paths are all absolute paths, hence the "" prefix.
|
|
997
1408
|
// e.g. this will yield "/dataStoreId/ddsId"
|
|
998
|
-
const fromPath = ["",
|
|
1409
|
+
const fromPath = ["", address, ddsAddress].join("/");
|
|
999
1410
|
outboundPaths.forEach((toPath) => addedOutboundReference(fromPath, toPath));
|
|
1000
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
|
+
}
|