@fluidframework/container-runtime 2.13.0 → 2.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +71 -5
- package/CHANGELOG.md +84 -0
- package/api-report/container-runtime.legacy.alpha.api.md +38 -232
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager/blobManager.d.ts +5 -1
- package/dist/blobManager/blobManager.d.ts.map +1 -1
- package/dist/blobManager/blobManager.js +30 -13
- package/dist/blobManager/blobManager.js.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.d.ts +1 -0
- package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/dist/blobManager/blobManagerSnapSum.js +7 -5
- package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
- package/dist/channelCollection.d.ts +23 -12
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +85 -53
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +2 -2
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +10 -6
- package/dist/connectionTelemetry.js.map +1 -1
- 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 +87 -94
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +312 -226
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +7 -3
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +8 -4
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +41 -25
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +47 -29
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +6 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -2
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerProxies.d.ts +1 -17
- package/dist/deltaManagerProxies.d.ts.map +1 -1
- package/dist/deltaManagerProxies.js.map +1 -1
- package/dist/deltaScheduler.d.ts +9 -6
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +95 -89
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +21 -7
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +48 -19
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +11 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +5 -2
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +218 -70
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +40 -13
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +6 -2
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +14 -7
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +18 -6
- package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +2 -1
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +33 -11
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +35 -17
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +42 -13
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +27 -9
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -0
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/inboundBatchAggregator.d.ts +34 -0
- package/dist/inboundBatchAggregator.d.ts.map +1 -0
- package/dist/inboundBatchAggregator.js +185 -0
- package/dist/inboundBatchAggregator.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/layerCompatState.d.ts +19 -0
- package/dist/layerCompatState.d.ts.map +1 -0
- package/dist/layerCompatState.js +64 -0
- package/dist/layerCompatState.js.map +1 -0
- package/dist/legacy.d.ts +0 -4
- package/dist/messageTypes.d.ts +14 -5
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/metadata.d.ts +12 -4
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +6 -2
- package/dist/metadata.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +9 -3
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +3 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.d.ts +9 -3
- package/dist/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
- package/dist/opLifecycle/duplicateBatchDetector.js +11 -5
- package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +3 -2
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +13 -19
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +6 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +16 -8
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -2
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +9 -6
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +13 -10
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +16 -11
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +4 -4
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +17 -16
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +9 -3
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +3 -1
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/package.json +2 -1
- 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 +22 -11
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +24 -15
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +7 -0
- package/dist/summary/documentSchema.d.ts.map +1 -1
- package/dist/summary/documentSchema.js +8 -4
- package/dist/summary/documentSchema.js.map +1 -1
- package/dist/summary/index.d.ts +1 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +94 -31
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +28 -16
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -2
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +17 -6
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +48 -19
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +10 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +26 -11
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js +1 -0
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +6 -2
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js +13 -5
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +24 -8
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +45 -36
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +13 -5
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +15 -7
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +253 -135
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +3 -4
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +10 -8
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +28 -9
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +3 -2
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +9 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +22 -9
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +8 -4
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +20 -9
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.d.ts +26 -10
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +12 -4
- package/dist/throttler.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager/blobManager.d.ts +5 -1
- package/lib/blobManager/blobManager.d.ts.map +1 -1
- package/lib/blobManager/blobManager.js +30 -13
- package/lib/blobManager/blobManager.js.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.d.ts +1 -0
- package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
- package/lib/blobManager/blobManagerSnapSum.js +7 -5
- package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
- package/lib/channelCollection.d.ts +23 -12
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +88 -54
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +2 -2
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +11 -7
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +87 -94
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +319 -228
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +7 -3
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +8 -4
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +41 -25
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +47 -29
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +6 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerProxies.d.ts +1 -17
- package/lib/deltaManagerProxies.d.ts.map +1 -1
- package/lib/deltaManagerProxies.js.map +1 -1
- package/lib/deltaScheduler.d.ts +9 -6
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +96 -90
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +21 -7
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +51 -20
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +11 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +4 -2
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +218 -70
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +40 -13
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +6 -2
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +14 -7
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +18 -6
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +2 -1
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +33 -11
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +38 -18
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts +42 -13
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +27 -9
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -0
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -0
- package/lib/gc/index.js.map +1 -1
- package/lib/inboundBatchAggregator.d.ts +34 -0
- package/lib/inboundBatchAggregator.d.ts.map +1 -0
- package/lib/inboundBatchAggregator.js +181 -0
- package/lib/inboundBatchAggregator.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/layerCompatState.d.ts +19 -0
- package/lib/layerCompatState.d.ts.map +1 -0
- package/lib/layerCompatState.js +60 -0
- package/lib/layerCompatState.js.map +1 -0
- package/lib/legacy.d.ts +0 -4
- package/lib/messageTypes.d.ts +14 -5
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js.map +1 -1
- package/lib/metadata.d.ts +12 -4
- package/lib/metadata.d.ts.map +1 -1
- package/lib/metadata.js +6 -2
- package/lib/metadata.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +9 -3
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +3 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.d.ts +9 -3
- package/lib/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
- package/lib/opLifecycle/duplicateBatchDetector.js +11 -5
- package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +3 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +14 -20
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +6 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +17 -9
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -2
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +10 -7
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +13 -10
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +16 -11
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +4 -4
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +17 -16
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +9 -3
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +3 -1
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +22 -11
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +25 -16
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +7 -0
- package/lib/summary/documentSchema.d.ts.map +1 -1
- package/lib/summary/documentSchema.js +8 -4
- package/lib/summary/documentSchema.js.map +1 -1
- package/lib/summary/index.d.ts +1 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +94 -31
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +28 -16
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -2
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +17 -6
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +48 -19
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +10 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +26 -11
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +1 -0
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +6 -2
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js +13 -5
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/index.d.ts.map +1 -1
- package/lib/summary/summarizerNode/index.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +24 -8
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +45 -36
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +13 -5
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +15 -7
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +253 -135
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +3 -4
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +10 -8
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +28 -9
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +2 -2
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +9 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +22 -9
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +8 -4
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +20 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.d.ts +26 -10
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +12 -4
- package/lib/throttler.js.map +1 -1
- package/package.json +22 -31
- package/src/batchTracker.ts +34 -36
- package/src/blobManager/blobManager.ts +54 -33
- package/src/blobManager/blobManagerSnapSum.ts +10 -10
- package/src/channelCollection.ts +108 -82
- package/src/connectionTelemetry.ts +43 -19
- package/src/containerHandleContext.ts +2 -2
- package/src/containerRuntime.ts +492 -364
- package/src/dataStore.ts +17 -9
- package/src/dataStoreContext.ts +94 -73
- package/src/dataStoreContexts.ts +17 -12
- package/src/dataStoreRegistry.ts +1 -1
- package/src/deltaManagerProxies.ts +5 -5
- package/src/deltaScheduler.ts +24 -18
- package/src/gc/garbageCollection.ts +89 -40
- package/src/gc/gcConfigs.ts +13 -5
- package/src/gc/gcDefinitions.ts +224 -70
- package/src/gc/gcHelpers.ts +22 -11
- package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
- package/src/gc/gcSummaryDefinitions.ts +18 -6
- package/src/gc/gcSummaryStateTracker.ts +7 -3
- package/src/gc/gcTelemetry.ts +73 -30
- package/src/gc/gcUnreferencedStateTracker.ts +40 -16
- package/src/gc/index.ts +1 -0
- package/src/{scheduleManager.ts → inboundBatchAggregator.ts} +55 -122
- package/src/index.ts +0 -3
- package/src/layerCompatState.ts +75 -0
- package/src/messageTypes.ts +16 -5
- package/src/metadata.ts +12 -4
- package/src/opLifecycle/README.md +43 -34
- package/src/opLifecycle/batchManager.ts +12 -6
- package/src/opLifecycle/duplicateBatchDetector.ts +12 -6
- package/src/opLifecycle/opCompressor.ts +22 -25
- package/src/opLifecycle/opDecompressor.ts +23 -11
- package/src/opLifecycle/opGroupingManager.ts +16 -11
- package/src/opLifecycle/opSplitter.ts +24 -18
- package/src/opLifecycle/outbox.ts +35 -33
- package/src/opLifecycle/remoteMessageProcessor.ts +13 -5
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +49 -26
- package/src/summary/documentSchema.ts +41 -22
- package/src/summary/index.ts +0 -3
- package/src/summary/orderedClientElection.ts +114 -49
- package/src/summary/runWhileConnectedCoordinator.ts +12 -3
- package/src/summary/runningSummarizer.ts +79 -36
- package/src/summary/summarizer.ts +51 -25
- package/src/summary/summarizerClientElection.ts +4 -2
- package/src/summary/summarizerHeuristics.ts +23 -12
- package/src/summary/summarizerNode/index.ts +1 -0
- package/src/summary/summarizerNode/summarizerNode.ts +54 -43
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +48 -16
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +25 -15
- package/src/summary/summarizerTypes.ts +253 -139
- package/src/summary/summaryCollection.ts +41 -31
- package/src/summary/summaryFormat.ts +34 -13
- package/src/summary/summaryGenerator.ts +39 -18
- package/src/summary/summaryManager.ts +36 -24
- package/src/throttler.ts +23 -11
- package/container-runtime.test-files.tar +0 -0
- package/dist/scheduleManager.d.ts +0 -28
- package/dist/scheduleManager.d.ts.map +0 -1
- package/dist/scheduleManager.js +0 -233
- package/dist/scheduleManager.js.map +0 -1
- package/lib/scheduleManager.d.ts +0 -28
- package/lib/scheduleManager.d.ts.map +0 -1
- package/lib/scheduleManager.js +0 -229
- package/lib/scheduleManager.js.map +0 -1
package/src/dataStore.ts
CHANGED
|
@@ -26,9 +26,13 @@ import { ContainerMessageType } from "./messageTypes.js";
|
|
|
26
26
|
* alias to a datastore
|
|
27
27
|
*/
|
|
28
28
|
export interface IDataStoreAliasMessage {
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* The internal id of the datastore
|
|
31
|
+
*/
|
|
30
32
|
readonly internalId: string;
|
|
31
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* The alias name to be assigned to the datastore
|
|
35
|
+
*/
|
|
32
36
|
readonly alias: string;
|
|
33
37
|
}
|
|
34
38
|
|
|
@@ -39,11 +43,12 @@ export interface IDataStoreAliasMessage {
|
|
|
39
43
|
* @returns True if the {@link IDataStoreAliasMessage} is fully implemented, false otherwise
|
|
40
44
|
*/
|
|
41
45
|
export const isDataStoreAliasMessage = (
|
|
42
|
-
maybeDataStoreAliasMessage:
|
|
46
|
+
maybeDataStoreAliasMessage: unknown,
|
|
43
47
|
): maybeDataStoreAliasMessage is IDataStoreAliasMessage => {
|
|
44
48
|
return (
|
|
45
|
-
typeof maybeDataStoreAliasMessage?.internalId ===
|
|
46
|
-
|
|
49
|
+
typeof (maybeDataStoreAliasMessage as Partial<IDataStoreAliasMessage>)?.internalId ===
|
|
50
|
+
"string" &&
|
|
51
|
+
typeof (maybeDataStoreAliasMessage as Partial<IDataStoreAliasMessage>)?.alias === "string"
|
|
47
52
|
);
|
|
48
53
|
};
|
|
49
54
|
|
|
@@ -77,18 +82,20 @@ class DataStore implements IDataStore {
|
|
|
77
82
|
switch (this.aliasState) {
|
|
78
83
|
// If we're already aliasing, check if it's for the same value and return
|
|
79
84
|
// the stored promise, otherwise return 'AlreadyAliased'
|
|
80
|
-
case AliasState.Aliasing:
|
|
85
|
+
case AliasState.Aliasing: {
|
|
81
86
|
assert(
|
|
82
87
|
this.aliasResult !== undefined,
|
|
83
88
|
0x316 /* There should be a cached promise of in-progress aliasing */,
|
|
84
89
|
);
|
|
85
90
|
await this.aliasResult;
|
|
86
91
|
return this.alias === alias ? "Success" : "AlreadyAliased";
|
|
92
|
+
}
|
|
87
93
|
|
|
88
94
|
// If this datastore is already aliased, return true only if this
|
|
89
95
|
// is a repeated call for the same alias
|
|
90
|
-
case AliasState.Aliased:
|
|
96
|
+
case AliasState.Aliased: {
|
|
91
97
|
return this.alias === alias ? "Success" : "AlreadyAliased";
|
|
98
|
+
}
|
|
92
99
|
|
|
93
100
|
case AliasState.None: {
|
|
94
101
|
const existingAlias = this.pendingAliases.get(alias);
|
|
@@ -103,8 +110,9 @@ class DataStore implements IDataStore {
|
|
|
103
110
|
break;
|
|
104
111
|
}
|
|
105
112
|
|
|
106
|
-
default:
|
|
113
|
+
default: {
|
|
107
114
|
unreachableCase(this.aliasState);
|
|
115
|
+
}
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
this.aliasState = AliasState.Aliasing;
|
|
@@ -187,7 +195,7 @@ class DataStore implements IDataStore {
|
|
|
187
195
|
private async ackBasedPromise<T>(
|
|
188
196
|
executor: (
|
|
189
197
|
resolve: (value: T | PromiseLike<T>) => void,
|
|
190
|
-
reject: (reason?:
|
|
198
|
+
reject: (reason?: unknown) => void,
|
|
191
199
|
) => void,
|
|
192
200
|
): Promise<T> {
|
|
193
201
|
let rejectBecauseDispose: () => void;
|
package/src/dataStoreContext.ts
CHANGED
|
@@ -14,7 +14,11 @@ import {
|
|
|
14
14
|
ITelemetryBaseProperties,
|
|
15
15
|
type IEvent,
|
|
16
16
|
} from "@fluidframework/core-interfaces";
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
type IFluidHandleContext,
|
|
19
|
+
type IFluidHandleInternal,
|
|
20
|
+
type ITelemetryBaseLogger,
|
|
21
|
+
} from "@fluidframework/core-interfaces/internal";
|
|
18
22
|
import { assert, LazyPromise, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
19
23
|
import { IClientDetails, IQuorumClients } from "@fluidframework/driver-definitions";
|
|
20
24
|
import {
|
|
@@ -104,7 +108,9 @@ export function createAttributesBlob(
|
|
|
104
108
|
return new BlobTreeEntry(dataStoreAttributesBlobName, JSON.stringify(attributes));
|
|
105
109
|
}
|
|
106
110
|
|
|
107
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* @internal
|
|
113
|
+
*/
|
|
108
114
|
export interface ISnapshotDetails {
|
|
109
115
|
pkg: readonly string[];
|
|
110
116
|
isRootDataStore: boolean;
|
|
@@ -152,10 +158,6 @@ export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContext
|
|
|
152
158
|
readonly pkg: Readonly<string[]> | undefined;
|
|
153
159
|
readonly snapshotTree: ISnapshotTree | undefined;
|
|
154
160
|
readonly makeLocallyVisibleFn: () => void;
|
|
155
|
-
/**
|
|
156
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
157
|
-
*/
|
|
158
|
-
readonly createProps?: any;
|
|
159
161
|
}
|
|
160
162
|
|
|
161
163
|
/**
|
|
@@ -177,7 +179,9 @@ export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContex
|
|
|
177
179
|
|
|
178
180
|
// back-compat: To be removed in the future.
|
|
179
181
|
// Added in "2.0.0-rc.2.0.0" timeframe (to support older builds).
|
|
180
|
-
/**
|
|
182
|
+
/**
|
|
183
|
+
* @internal
|
|
184
|
+
*/
|
|
181
185
|
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
182
186
|
(event: "attaching" | "attached", listener: () => void);
|
|
183
187
|
}
|
|
@@ -195,7 +199,7 @@ export abstract class FluidDataStoreContext
|
|
|
195
199
|
return this.pkg;
|
|
196
200
|
}
|
|
197
201
|
|
|
198
|
-
public get options(): Record<string | number,
|
|
202
|
+
public get options(): Record<string | number, unknown> {
|
|
199
203
|
return this.parentContext.options;
|
|
200
204
|
}
|
|
201
205
|
|
|
@@ -207,7 +211,7 @@ export abstract class FluidDataStoreContext
|
|
|
207
211
|
return this.parentContext.clientDetails;
|
|
208
212
|
}
|
|
209
213
|
|
|
210
|
-
public get baseLogger() {
|
|
214
|
+
public get baseLogger(): ITelemetryBaseLogger {
|
|
211
215
|
return this.parentContext.baseLogger;
|
|
212
216
|
}
|
|
213
217
|
|
|
@@ -219,7 +223,7 @@ export abstract class FluidDataStoreContext
|
|
|
219
223
|
return this.parentContext.connected;
|
|
220
224
|
}
|
|
221
225
|
|
|
222
|
-
public get IFluidHandleContext() {
|
|
226
|
+
public get IFluidHandleContext(): IFluidHandleContext {
|
|
223
227
|
return this.parentContext.IFluidHandleContext;
|
|
224
228
|
}
|
|
225
229
|
|
|
@@ -239,7 +243,7 @@ export abstract class FluidDataStoreContext
|
|
|
239
243
|
}
|
|
240
244
|
|
|
241
245
|
private _disposed = false;
|
|
242
|
-
public get disposed() {
|
|
246
|
+
public get disposed(): boolean {
|
|
243
247
|
return this._disposed;
|
|
244
248
|
}
|
|
245
249
|
|
|
@@ -248,7 +252,7 @@ export abstract class FluidDataStoreContext
|
|
|
248
252
|
* Tombstoned objects are eventually deleted by GC.
|
|
249
253
|
*/
|
|
250
254
|
private _tombstoned = false;
|
|
251
|
-
public get tombstoned() {
|
|
255
|
+
public get tombstoned(): boolean {
|
|
252
256
|
return this._tombstoned;
|
|
253
257
|
}
|
|
254
258
|
/**
|
|
@@ -261,7 +265,9 @@ export abstract class FluidDataStoreContext
|
|
|
261
265
|
*/
|
|
262
266
|
public readonly gcTombstoneEnforcementAllowed: boolean = false;
|
|
263
267
|
|
|
264
|
-
/**
|
|
268
|
+
/**
|
|
269
|
+
* If true, this means that this data store context and its children have been removed from the runtime
|
|
270
|
+
*/
|
|
265
271
|
protected deleted: boolean = false;
|
|
266
272
|
|
|
267
273
|
public get attachState(): AttachState {
|
|
@@ -289,11 +295,13 @@ export abstract class FluidDataStoreContext
|
|
|
289
295
|
// We know that if the base snapshot is omitted, then the isRootDataStore flag is not set.
|
|
290
296
|
// That means we can skip the expensive call to getInitialSnapshotDetails for virtualized datastores,
|
|
291
297
|
// and get the information from the alias map directly.
|
|
298
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
|
|
292
299
|
if (aliasedDataStores !== undefined && (this.baseSnapshot as any)?.omitted === true) {
|
|
293
300
|
return aliasedDataStores.has(this.id);
|
|
294
301
|
}
|
|
295
302
|
|
|
296
|
-
|
|
303
|
+
const snapshotDetails = await this.getInitialSnapshotDetails();
|
|
304
|
+
return snapshotDetails.isRootDataStore;
|
|
297
305
|
}
|
|
298
306
|
|
|
299
307
|
/**
|
|
@@ -319,7 +327,9 @@ export abstract class FluidDataStoreContext
|
|
|
319
327
|
protected detachedRuntimeCreation = false;
|
|
320
328
|
protected channel: IFluidDataStoreChannel | undefined;
|
|
321
329
|
private loaded = false;
|
|
322
|
-
/**
|
|
330
|
+
/**
|
|
331
|
+
* Tracks the messages for this data store that are sent while it's not loaded
|
|
332
|
+
*/
|
|
323
333
|
private pendingMessagesState: IPendingMessagesState | undefined = {
|
|
324
334
|
messageCollections: [],
|
|
325
335
|
pendingCount: 0,
|
|
@@ -374,14 +384,9 @@ export abstract class FluidDataStoreContext
|
|
|
374
384
|
? this.parentContext.attachState
|
|
375
385
|
: AttachState.Detached;
|
|
376
386
|
|
|
377
|
-
const thisSummarizeInternal = async (
|
|
378
|
-
fullTree: boolean,
|
|
379
|
-
trackState: boolean,
|
|
380
|
-
telemetryContext?: ITelemetryContext,
|
|
381
|
-
) => this.summarizeInternal(fullTree, trackState, telemetryContext);
|
|
382
|
-
|
|
383
387
|
this.summarizerNode = props.createSummarizerNodeFn(
|
|
384
|
-
|
|
388
|
+
async (fullTree, trackState, telemetryContext) =>
|
|
389
|
+
this.summarizeInternal(fullTree, trackState, telemetryContext),
|
|
385
390
|
async (fullGC?: boolean) => this.getGCDataInternal(fullGC),
|
|
386
391
|
);
|
|
387
392
|
|
|
@@ -429,11 +434,11 @@ export abstract class FluidDataStoreContext
|
|
|
429
434
|
* This function is called to prevent ops from being generated from this data store once it has been deleted. Furthermore, this data store
|
|
430
435
|
* should not receive any ops/signals.
|
|
431
436
|
*/
|
|
432
|
-
public delete() {
|
|
437
|
+
public delete(): void {
|
|
433
438
|
this.deleted = true;
|
|
434
439
|
}
|
|
435
440
|
|
|
436
|
-
public setTombstone(tombstone: boolean) {
|
|
441
|
+
public setTombstone(tombstone: boolean): void {
|
|
437
442
|
if (this.tombstoned === tombstone) {
|
|
438
443
|
return;
|
|
439
444
|
}
|
|
@@ -483,7 +488,7 @@ export abstract class FluidDataStoreContext
|
|
|
483
488
|
return this.channelP;
|
|
484
489
|
}
|
|
485
490
|
|
|
486
|
-
protected async factoryFromPackagePath() {
|
|
491
|
+
protected async factoryFromPackagePath(): Promise<IFluidDataStoreFactory> {
|
|
487
492
|
const packages = this.pkg;
|
|
488
493
|
if (packages === undefined) {
|
|
489
494
|
this.rejectDeferredRealize("packages is undefined");
|
|
@@ -555,7 +560,7 @@ export abstract class FluidDataStoreContext
|
|
|
555
560
|
return created;
|
|
556
561
|
}
|
|
557
562
|
|
|
558
|
-
private async realizeCore(existing: boolean) {
|
|
563
|
+
private async realizeCore(existing: boolean): Promise<IFluidDataStoreChannel> {
|
|
559
564
|
const details = await this.getInitialSnapshotDetails();
|
|
560
565
|
// Base snapshot is the baseline where pending ops are applied to.
|
|
561
566
|
// It is important that this be in sync with the pending ops, and also
|
|
@@ -584,7 +589,7 @@ export abstract class FluidDataStoreContext
|
|
|
584
589
|
* @param clientId - ID of the client. Its old ID when in disconnected state and
|
|
585
590
|
* its new client ID when we are connecting or connected.
|
|
586
591
|
*/
|
|
587
|
-
public setConnectionState(connected: boolean, clientId?: string) {
|
|
592
|
+
public setConnectionState(connected: boolean, clientId?: string): void {
|
|
588
593
|
// ConnectionState should not fail in tombstone mode as this is internally run
|
|
589
594
|
this.verifyNotClosed("setConnectionState", false /* checkTombstone */);
|
|
590
595
|
|
|
@@ -608,10 +613,8 @@ export abstract class FluidDataStoreContext
|
|
|
608
613
|
private processMessagesCompat(
|
|
609
614
|
channel: IFluidDataStoreChannel,
|
|
610
615
|
messageCollection: IRuntimeMessageCollection,
|
|
611
|
-
) {
|
|
612
|
-
if (channel.processMessages
|
|
613
|
-
channel.processMessages(messageCollection);
|
|
614
|
-
} else {
|
|
616
|
+
): void {
|
|
617
|
+
if (channel.processMessages === undefined) {
|
|
615
618
|
const { envelope, messagesContent, local } = messageCollection;
|
|
616
619
|
for (const { contents, localOpMetadata, clientSequenceNumber } of messagesContent) {
|
|
617
620
|
channel.process(
|
|
@@ -620,6 +623,8 @@ export abstract class FluidDataStoreContext
|
|
|
620
623
|
localOpMetadata,
|
|
621
624
|
);
|
|
622
625
|
}
|
|
626
|
+
} else {
|
|
627
|
+
channel.processMessages(messageCollection);
|
|
623
628
|
}
|
|
624
629
|
}
|
|
625
630
|
|
|
@@ -647,7 +652,7 @@ export abstract class FluidDataStoreContext
|
|
|
647
652
|
);
|
|
648
653
|
this.pendingMessagesState.messageCollections.push({
|
|
649
654
|
...messageCollection,
|
|
650
|
-
messagesContent:
|
|
655
|
+
messagesContent: [...messagesContent],
|
|
651
656
|
});
|
|
652
657
|
this.pendingMessagesState.pendingCount += messagesContent.length;
|
|
653
658
|
this.thresholdOpsCounter.sendIfMultiple(
|
|
@@ -769,7 +774,7 @@ export abstract class FluidDataStoreContext
|
|
|
769
774
|
*
|
|
770
775
|
* @param usedRoutes - The routes that are used in this data store.
|
|
771
776
|
*/
|
|
772
|
-
public updateUsedRoutes(usedRoutes: string[]) {
|
|
777
|
+
public updateUsedRoutes(usedRoutes: string[]): void {
|
|
773
778
|
// Update the used routes in this data store's summarizer node.
|
|
774
779
|
this.summarizerNode.updateUsedRoutes(usedRoutes);
|
|
775
780
|
|
|
@@ -794,10 +799,15 @@ export abstract class FluidDataStoreContext
|
|
|
794
799
|
* @param toPath - The absolute path of the outbound node that is referenced.
|
|
795
800
|
* @param messageTimestampMs - The timestamp of the message that added the reference.
|
|
796
801
|
*/
|
|
797
|
-
public addedGCOutboundRoute(
|
|
802
|
+
public addedGCOutboundRoute(
|
|
803
|
+
fromPath: string,
|
|
804
|
+
toPath: string,
|
|
805
|
+
messageTimestampMs?: number,
|
|
806
|
+
): void {
|
|
798
807
|
this.parentContext.addedGCOutboundRoute(fromPath, toPath, messageTimestampMs);
|
|
799
808
|
}
|
|
800
809
|
|
|
810
|
+
// eslint-disable-next-line jsdoc/require-description
|
|
801
811
|
/**
|
|
802
812
|
* @deprecated 0.18.Should call request on the runtime directly
|
|
803
813
|
*/
|
|
@@ -806,7 +816,7 @@ export abstract class FluidDataStoreContext
|
|
|
806
816
|
return runtime.request(request);
|
|
807
817
|
}
|
|
808
818
|
|
|
809
|
-
public submitMessage(type: string, content:
|
|
819
|
+
public submitMessage(type: string, content: unknown, localOpMetadata: unknown): void {
|
|
810
820
|
this.verifyNotClosed("submitMessage");
|
|
811
821
|
assert(!!this.channel, 0x146 /* "Channel must exist when submitting message" */);
|
|
812
822
|
// Summarizer clients should not submit messages.
|
|
@@ -845,7 +855,7 @@ export abstract class FluidDataStoreContext
|
|
|
845
855
|
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
846
856
|
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
847
857
|
*/
|
|
848
|
-
public submitSignal(type: string, content: unknown, targetClientId?: string) {
|
|
858
|
+
public submitSignal(type: string, content: unknown, targetClientId?: string): void {
|
|
849
859
|
this.verifyNotClosed("submitSignal");
|
|
850
860
|
|
|
851
861
|
assert(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
|
|
@@ -856,12 +866,12 @@ export abstract class FluidDataStoreContext
|
|
|
856
866
|
* This is called by the data store channel when it becomes locally visible indicating that it is ready to become
|
|
857
867
|
* globally visible now.
|
|
858
868
|
*/
|
|
859
|
-
public makeLocallyVisible() {
|
|
869
|
+
public makeLocallyVisible(): void {
|
|
860
870
|
assert(this.channel !== undefined, 0x2cf /* "undefined channel on datastore context" */);
|
|
861
871
|
this.makeLocallyVisibleFn();
|
|
862
872
|
}
|
|
863
873
|
|
|
864
|
-
protected processPendingOps(channel: IFluidDataStoreChannel) {
|
|
874
|
+
protected processPendingOps(channel: IFluidDataStoreChannel): void {
|
|
865
875
|
const baseSequenceNumber = this.baseSnapshotSequenceNumber ?? -1;
|
|
866
876
|
|
|
867
877
|
assert(
|
|
@@ -879,7 +889,7 @@ export abstract class FluidDataStoreContext
|
|
|
879
889
|
this.pendingMessagesState = undefined;
|
|
880
890
|
}
|
|
881
891
|
|
|
882
|
-
protected completeBindingRuntime(channel: IFluidDataStoreChannel) {
|
|
892
|
+
protected completeBindingRuntime(channel: IFluidDataStoreChannel): void {
|
|
883
893
|
// And now mark the runtime active
|
|
884
894
|
this.loaded = true;
|
|
885
895
|
this.channel = channel;
|
|
@@ -895,7 +905,10 @@ export abstract class FluidDataStoreContext
|
|
|
895
905
|
Object.freeze(this.pkg);
|
|
896
906
|
}
|
|
897
907
|
|
|
898
|
-
protected async bindRuntime(
|
|
908
|
+
protected async bindRuntime(
|
|
909
|
+
channel: IFluidDataStoreChannel,
|
|
910
|
+
existing: boolean,
|
|
911
|
+
): Promise<void> {
|
|
899
912
|
if (this.channel) {
|
|
900
913
|
throw new Error("Runtime already bound");
|
|
901
914
|
}
|
|
@@ -946,6 +959,7 @@ export abstract class FluidDataStoreContext
|
|
|
946
959
|
|
|
947
960
|
public abstract getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
948
961
|
|
|
962
|
+
// eslint-disable-next-line jsdoc/require-description
|
|
949
963
|
/**
|
|
950
964
|
* @deprecated Sets the datastore as root, for aliasing purposes: #7948
|
|
951
965
|
* This method should not be used outside of the aliasing context.
|
|
@@ -955,6 +969,7 @@ export abstract class FluidDataStoreContext
|
|
|
955
969
|
this._isInMemoryRoot = true;
|
|
956
970
|
}
|
|
957
971
|
|
|
972
|
+
// eslint-disable-next-line jsdoc/require-description
|
|
958
973
|
/**
|
|
959
974
|
* @deprecated The functionality to get base GC details has been moved to summarizer node.
|
|
960
975
|
*/
|
|
@@ -962,12 +977,12 @@ export abstract class FluidDataStoreContext
|
|
|
962
977
|
return {};
|
|
963
978
|
}
|
|
964
979
|
|
|
965
|
-
public reSubmit(type: string, contents:
|
|
980
|
+
public reSubmit(type: string, contents: unknown, localOpMetadata: unknown): void {
|
|
966
981
|
assert(!!this.channel, 0x14b /* "Channel must exist when resubmitting ops" */);
|
|
967
982
|
this.channel.reSubmit(type, contents, localOpMetadata);
|
|
968
983
|
}
|
|
969
984
|
|
|
970
|
-
public rollback(type: string, contents:
|
|
985
|
+
public rollback(type: string, contents: unknown, localOpMetadata: unknown): void {
|
|
971
986
|
if (!this.channel) {
|
|
972
987
|
throw new Error("Channel must exist when rolling back ops");
|
|
973
988
|
}
|
|
@@ -977,7 +992,7 @@ export abstract class FluidDataStoreContext
|
|
|
977
992
|
this.channel.rollback(type, contents, localOpMetadata);
|
|
978
993
|
}
|
|
979
994
|
|
|
980
|
-
public async applyStashedOp(contents:
|
|
995
|
+
public async applyStashedOp(contents: unknown): Promise<unknown> {
|
|
981
996
|
if (!this.channel) {
|
|
982
997
|
await this.realize();
|
|
983
998
|
}
|
|
@@ -989,7 +1004,7 @@ export abstract class FluidDataStoreContext
|
|
|
989
1004
|
callSite: string,
|
|
990
1005
|
checkTombstone = true,
|
|
991
1006
|
safeTelemetryProps: ITelemetryBaseProperties = {},
|
|
992
|
-
) {
|
|
1007
|
+
): void {
|
|
993
1008
|
if (this.deleted) {
|
|
994
1009
|
const messageString = `Context is deleted! Call site [${callSite}]`;
|
|
995
1010
|
const error = DataProcessingError.create(
|
|
@@ -1038,7 +1053,7 @@ export abstract class FluidDataStoreContext
|
|
|
1038
1053
|
* eventual consistency. For example, the next summary (say at ref seq# 100) may contain these changes whereas
|
|
1039
1054
|
* other clients that are up-to-date till seq# 100 may not have them yet.
|
|
1040
1055
|
*/
|
|
1041
|
-
protected identifyLocalChangeInSummarizer(eventName: string, type?: string) {
|
|
1056
|
+
protected identifyLocalChangeInSummarizer(eventName: string, type?: string): void {
|
|
1042
1057
|
if (
|
|
1043
1058
|
this.clientDetails.type !== summarizerClientType ||
|
|
1044
1059
|
this.localChangesTelemetryCount <= 0
|
|
@@ -1065,7 +1080,7 @@ export abstract class FluidDataStoreContext
|
|
|
1065
1080
|
return (
|
|
1066
1081
|
summarizeInternal: SummarizeInternalFn,
|
|
1067
1082
|
getGCDataFn: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
|
|
1068
|
-
) =>
|
|
1083
|
+
): ISummarizerNodeWithGC =>
|
|
1069
1084
|
this.summarizerNode.createChild(
|
|
1070
1085
|
summarizeInternal,
|
|
1071
1086
|
id,
|
|
@@ -1075,7 +1090,7 @@ export abstract class FluidDataStoreContext
|
|
|
1075
1090
|
);
|
|
1076
1091
|
}
|
|
1077
1092
|
|
|
1078
|
-
public deleteChildSummarizerNode(id: string) {
|
|
1093
|
+
public deleteChildSummarizerNode(id: string): void {
|
|
1079
1094
|
this.summarizerNode.deleteChild(id);
|
|
1080
1095
|
}
|
|
1081
1096
|
|
|
@@ -1087,7 +1102,9 @@ export abstract class FluidDataStoreContext
|
|
|
1087
1102
|
}
|
|
1088
1103
|
}
|
|
1089
1104
|
|
|
1090
|
-
/**
|
|
1105
|
+
/**
|
|
1106
|
+
* @internal
|
|
1107
|
+
*/
|
|
1091
1108
|
export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
1092
1109
|
// Tells whether we need to fetch the snapshot before use. This is to support Data Virtualization.
|
|
1093
1110
|
private snapshotFetchRequired: boolean | undefined;
|
|
@@ -1111,18 +1128,23 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
1111
1128
|
}
|
|
1112
1129
|
}
|
|
1113
1130
|
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1131
|
+
/**
|
|
1132
|
+
* This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:
|
|
1133
|
+
* The scenario (hit by stashedOps.spec.ts, "resends attach op" UT is the following (as far as I understand):
|
|
1134
|
+
*
|
|
1135
|
+
* 1. data store is being attached in attached container
|
|
1136
|
+
*
|
|
1137
|
+
* 2. container state is serialized (stashed ops feature)
|
|
1138
|
+
*
|
|
1139
|
+
* 3. new container instance is rehydrated (from stashed ops) -
|
|
1140
|
+
* As result, we create RemoteFluidDataStoreContext for this data store that is actually in "attaching" state * (as of # 2).
|
|
1141
|
+
* But its state is set to attached when loading container from stashed ops.
|
|
1142
|
+
*
|
|
1143
|
+
* 4. attach op for this data store is processed - setAttachState() is called.
|
|
1144
|
+
*/
|
|
1145
|
+
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {}
|
|
1125
1146
|
|
|
1147
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
1126
1148
|
private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
|
|
1127
1149
|
// Sequence number of the snapshot.
|
|
1128
1150
|
let sequenceNumber: number | undefined;
|
|
@@ -1218,14 +1240,14 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
1218
1240
|
}
|
|
1219
1241
|
|
|
1220
1242
|
/**
|
|
1221
|
-
* @
|
|
1243
|
+
* {@inheritDoc FluidDataStoreContext.getAttachSummary}
|
|
1222
1244
|
*/
|
|
1223
1245
|
public getAttachSummary(): ISummaryTreeWithStats {
|
|
1224
1246
|
throw new Error("Cannot attach remote store");
|
|
1225
1247
|
}
|
|
1226
1248
|
|
|
1227
1249
|
/**
|
|
1228
|
-
* @
|
|
1250
|
+
* {@inheritDoc FluidDataStoreContext.getAttachGCData}
|
|
1229
1251
|
*/
|
|
1230
1252
|
public getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {
|
|
1231
1253
|
throw new Error("Cannot attach remote store");
|
|
@@ -1238,10 +1260,6 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
1238
1260
|
*/
|
|
1239
1261
|
export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
1240
1262
|
private readonly snapshotTree: ISnapshotTree | undefined;
|
|
1241
|
-
/**
|
|
1242
|
-
* @deprecated 0.16 Issue #1635, #3631
|
|
1243
|
-
*/
|
|
1244
|
-
public readonly createProps?: any;
|
|
1245
1263
|
|
|
1246
1264
|
constructor(props: ILocalFluidDataStoreContextProps) {
|
|
1247
1265
|
super(
|
|
@@ -1255,12 +1273,11 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1255
1273
|
this.identifyLocalChangeInSummarizer("DataStoreCreatedInSummarizer");
|
|
1256
1274
|
|
|
1257
1275
|
this.snapshotTree = props.snapshotTree;
|
|
1258
|
-
this.createProps = props.createProps;
|
|
1259
1276
|
}
|
|
1260
1277
|
|
|
1261
1278
|
public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
|
|
1262
1279
|
switch (attachState) {
|
|
1263
|
-
case AttachState.Attaching:
|
|
1280
|
+
case AttachState.Attaching: {
|
|
1264
1281
|
assert(
|
|
1265
1282
|
this.attachState === AttachState.Detached,
|
|
1266
1283
|
0x14d /* "Should move from detached to attaching" */,
|
|
@@ -1274,7 +1291,8 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1274
1291
|
this.emit("attaching");
|
|
1275
1292
|
}
|
|
1276
1293
|
break;
|
|
1277
|
-
|
|
1294
|
+
}
|
|
1295
|
+
case AttachState.Attached: {
|
|
1278
1296
|
// We can get called into here twice, as result of both container and data store being attached, if
|
|
1279
1297
|
// those processes overlapped, for example, in a flow like that one:
|
|
1280
1298
|
// 1. Container attach started
|
|
@@ -1297,13 +1315,15 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1297
1315
|
}
|
|
1298
1316
|
}
|
|
1299
1317
|
break;
|
|
1300
|
-
|
|
1318
|
+
}
|
|
1319
|
+
default: {
|
|
1301
1320
|
unreachableCase(attachState, "unreached");
|
|
1321
|
+
}
|
|
1302
1322
|
}
|
|
1303
1323
|
}
|
|
1304
1324
|
|
|
1305
1325
|
/**
|
|
1306
|
-
* @
|
|
1326
|
+
* {@inheritDoc FluidDataStoreContext.getAttachSummary}
|
|
1307
1327
|
*/
|
|
1308
1328
|
public getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {
|
|
1309
1329
|
assert(
|
|
@@ -1333,7 +1353,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1333
1353
|
}
|
|
1334
1354
|
|
|
1335
1355
|
/**
|
|
1336
|
-
* @
|
|
1356
|
+
* {@inheritDoc FluidDataStoreContext.getAttachGCData}
|
|
1337
1357
|
*/
|
|
1338
1358
|
public getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData {
|
|
1339
1359
|
assert(
|
|
@@ -1343,6 +1363,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1343
1363
|
return this.channel.getAttachGCData(telemetryContext);
|
|
1344
1364
|
}
|
|
1345
1365
|
|
|
1366
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
1346
1367
|
private readonly initialSnapshotDetailsP = new LazyPromise<ISnapshotDetails>(async () => {
|
|
1347
1368
|
let snapshot = this.snapshotTree;
|
|
1348
1369
|
// eslint-disable-next-line import/no-deprecated
|
|
@@ -1390,7 +1411,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
1390
1411
|
* it was unreferenced. Thus the sweeping container should have loaded from a snapshot and thus creating a remote
|
|
1391
1412
|
* context.
|
|
1392
1413
|
*/
|
|
1393
|
-
public delete() {
|
|
1414
|
+
public delete(): void {
|
|
1394
1415
|
// TODO: GC:Validation - potentially prevent this from happening or asserting. Maybe throw here.
|
|
1395
1416
|
this.mc.logger.sendErrorEvent({
|
|
1396
1417
|
eventName: "GC_Deleted_DataStore_Unexpected_Delete",
|
|
@@ -1477,7 +1498,7 @@ export class LocalDetachedFluidDataStoreContext
|
|
|
1477
1498
|
*
|
|
1478
1499
|
* If used incorrectly, this function can result in permanent data corruption.
|
|
1479
1500
|
*/
|
|
1480
|
-
public unsafe_AttachRuntimeSync(channel: IFluidDataStoreChannel) {
|
|
1501
|
+
public unsafe_AttachRuntimeSync(channel: IFluidDataStoreChannel): IDataStore {
|
|
1481
1502
|
this.channelP = Promise.resolve(channel);
|
|
1482
1503
|
this.processPendingOps(channel);
|
|
1483
1504
|
this.completeBindingRuntime(channel);
|
package/src/dataStoreContexts.ts
CHANGED
|
@@ -12,13 +12,17 @@ import {
|
|
|
12
12
|
|
|
13
13
|
import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext.js";
|
|
14
14
|
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
16
18
|
export class DataStoreContexts
|
|
17
19
|
implements Iterable<[string, FluidDataStoreContext]>, IDisposable
|
|
18
20
|
{
|
|
19
21
|
private readonly notBoundContexts = new Set<string>();
|
|
20
22
|
|
|
21
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Attached and loaded context proxies
|
|
25
|
+
*/
|
|
22
26
|
private readonly _contexts = new Map<string, FluidDataStoreContext>();
|
|
23
27
|
|
|
24
28
|
/**
|
|
@@ -30,6 +34,7 @@ export class DataStoreContexts
|
|
|
30
34
|
*/
|
|
31
35
|
private readonly deferredContexts = new Map<string, Deferred<FluidDataStoreContext>>();
|
|
32
36
|
|
|
37
|
+
// eslint-disable-next-line unicorn/consistent-function-scoping -- Property is defined once; no need to extract inner lambda
|
|
33
38
|
private readonly disposeOnce = new Lazy<void>(() => {
|
|
34
39
|
// close/stop all store contexts
|
|
35
40
|
for (const [fluidDataStoreId, contextD] of this.deferredContexts) {
|
|
@@ -63,20 +68,20 @@ export class DataStoreContexts
|
|
|
63
68
|
return this._contexts.size;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
public get disposed() {
|
|
71
|
+
public get disposed(): boolean {
|
|
67
72
|
return this.disposeOnce.evaluated;
|
|
68
73
|
}
|
|
69
|
-
public readonly dispose = () => this.disposeOnce.value;
|
|
74
|
+
public readonly dispose = (): void => this.disposeOnce.value;
|
|
70
75
|
|
|
71
|
-
public notBoundLength() {
|
|
76
|
+
public notBoundLength(): number {
|
|
72
77
|
return this.notBoundContexts.size;
|
|
73
78
|
}
|
|
74
79
|
|
|
75
|
-
public isNotBound(id: string) {
|
|
80
|
+
public isNotBound(id: string): boolean {
|
|
76
81
|
return this.notBoundContexts.has(id);
|
|
77
82
|
}
|
|
78
83
|
|
|
79
|
-
public has(id: string) {
|
|
84
|
+
public has(id: string): boolean {
|
|
80
85
|
return this._contexts.has(id);
|
|
81
86
|
}
|
|
82
87
|
|
|
@@ -98,7 +103,7 @@ export class DataStoreContexts
|
|
|
98
103
|
private readonly _recentlyDeletedContexts: Map<string, FluidDataStoreContext | undefined> =
|
|
99
104
|
new Map();
|
|
100
105
|
|
|
101
|
-
public getRecentlyDeletedContext(id: string) {
|
|
106
|
+
public getRecentlyDeletedContext(id: string): FluidDataStoreContext | undefined {
|
|
102
107
|
return this._recentlyDeletedContexts.get(id);
|
|
103
108
|
}
|
|
104
109
|
|
|
@@ -118,7 +123,7 @@ export class DataStoreContexts
|
|
|
118
123
|
/**
|
|
119
124
|
* Add the given context, marking it as to-be-bound
|
|
120
125
|
*/
|
|
121
|
-
public addUnbound(context: LocalFluidDataStoreContext) {
|
|
126
|
+
public addUnbound(context: LocalFluidDataStoreContext): void {
|
|
122
127
|
const id = context.id;
|
|
123
128
|
assert(!this._contexts.has(id), 0x158 /* "Creating store with existing ID" */);
|
|
124
129
|
|
|
@@ -161,7 +166,7 @@ export class DataStoreContexts
|
|
|
161
166
|
/**
|
|
162
167
|
* Update this context as bound
|
|
163
168
|
*/
|
|
164
|
-
public bind(id: string) {
|
|
169
|
+
public bind(id: string): void {
|
|
165
170
|
const removed: boolean = this.notBoundContexts.delete(id);
|
|
166
171
|
assert(removed, 0x159 /* "The given id was not found in notBoundContexts to delete" */);
|
|
167
172
|
|
|
@@ -172,7 +177,7 @@ export class DataStoreContexts
|
|
|
172
177
|
* Triggers the deferred to resolve, indicating the context is not local-only
|
|
173
178
|
* @param id - The id of the context to resolve to
|
|
174
179
|
*/
|
|
175
|
-
private resolveDeferred(id: string) {
|
|
180
|
+
private resolveDeferred(id: string): void {
|
|
176
181
|
const context = this._contexts.get(id);
|
|
177
182
|
assert(!!context, 0x15a /* "Cannot find context to resolve to" */);
|
|
178
183
|
assert(
|
|
@@ -190,7 +195,7 @@ export class DataStoreContexts
|
|
|
190
195
|
* This could be because it's a local context that's been bound, or because it's a remote context.
|
|
191
196
|
* @param context - The context to add
|
|
192
197
|
*/
|
|
193
|
-
public addBoundOrRemoted(context: FluidDataStoreContext) {
|
|
198
|
+
public addBoundOrRemoted(context: FluidDataStoreContext): void {
|
|
194
199
|
const id = context.id;
|
|
195
200
|
assert(!this._contexts.has(id), 0x15d /* "Creating store with existing ID" */);
|
|
196
201
|
|