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