@fluidframework/container-runtime 2.0.0-dev.5.3.2.178189 → 2.0.0-dev.6.4.0.191258
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/CHANGELOG.md +123 -0
- package/README.md +4 -3
- package/dist/batchTracker.d.ts +3 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +6 -5
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +10 -16
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +184 -172
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +25 -16
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +161 -35
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +697 -449
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +15 -7
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +3 -2
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +83 -87
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +8 -9
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +2 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +22 -6
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +123 -81
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.d.ts +35 -0
- package/dist/deltaManagerProxyBase.d.ts.map +1 -0
- package/dist/deltaManagerProxyBase.js +77 -0
- package/dist/deltaManagerProxyBase.js.map +1 -0
- package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +4 -2
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +10 -10
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +21 -0
- package/dist/error.js.map +1 -0
- package/dist/gc/garbageCollection.d.ts +10 -9
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +61 -53
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +18 -14
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +17 -4
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +14 -15
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +0 -8
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +11 -24
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +19 -58
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +45 -35
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +4 -4
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -5
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js +26 -68
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/finalSpace.d.ts +29 -0
- package/dist/id-compressor/finalSpace.d.ts.map +1 -0
- package/dist/id-compressor/finalSpace.js +62 -0
- package/dist/id-compressor/finalSpace.js.map +1 -0
- package/dist/id-compressor/idCompressor.d.ts +25 -250
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js +390 -1153
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +32 -0
- package/dist/id-compressor/identifiers.d.ts.map +1 -0
- package/dist/id-compressor/identifiers.js +15 -0
- package/dist/id-compressor/identifiers.js.map +1 -0
- package/dist/id-compressor/index.d.ts +5 -6
- package/dist/id-compressor/index.d.ts.map +1 -1
- package/dist/id-compressor/index.js +20 -26
- package/dist/id-compressor/index.js.map +1 -1
- package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
- package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/dist/id-compressor/persistanceUtilities.js +43 -0
- package/dist/id-compressor/persistanceUtilities.js.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/dist/id-compressor/sessions.d.ts +115 -0
- package/dist/id-compressor/sessions.d.ts.map +1 -0
- package/dist/id-compressor/sessions.js +305 -0
- package/dist/id-compressor/sessions.js.map +1 -0
- package/dist/id-compressor/utilities.d.ts +49 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -0
- package/dist/id-compressor/utilities.js +166 -0
- package/dist/id-compressor/utilities.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.js +10 -6
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +2 -2
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +12 -7
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +2 -2
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +23 -20
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +19 -9
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +2 -2
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +22 -19
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +7 -5
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +22 -31
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +6 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +19 -7
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.js +1 -2
- package/dist/opProperties.js.map +1 -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 +18 -8
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +73 -51
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +36 -32
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +3 -3
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +2 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +3 -3
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +26 -27
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +3 -3
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +31 -10
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +271 -139
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +8 -7
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +79 -78
- 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 +7 -11
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +10 -14
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts +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 +10 -19
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +57 -130
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +4 -14
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +15 -101
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +38 -25
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -3
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +12 -13
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +3 -0
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +6 -4
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +10 -4
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +106 -57
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +8 -8
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +38 -28
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +3 -2
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +5 -4
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +10 -16
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +159 -147
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +15 -6
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +161 -35
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +651 -402
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +13 -5
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +3 -2
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +47 -51
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +3 -4
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +22 -6
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +107 -65
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.d.ts +35 -0
- package/lib/deltaManagerProxyBase.d.ts.map +1 -0
- package/lib/deltaManagerProxyBase.js +73 -0
- package/lib/deltaManagerProxyBase.js.map +1 -0
- package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +3 -1
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +7 -7
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts +14 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +17 -0
- package/lib/error.js.map +1 -0
- package/lib/gc/garbageCollection.d.ts +10 -9
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +61 -53
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +16 -12
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +17 -4
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +13 -14
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +0 -8
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +5 -17
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +20 -59
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +46 -36
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +2 -2
- package/lib/gc/index.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js +25 -66
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/finalSpace.d.ts +29 -0
- package/lib/id-compressor/finalSpace.d.ts.map +1 -0
- package/lib/id-compressor/finalSpace.js +58 -0
- package/lib/id-compressor/finalSpace.js.map +1 -0
- package/lib/id-compressor/idCompressor.d.ts +25 -250
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js +385 -1142
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +32 -0
- package/lib/id-compressor/identifiers.d.ts.map +1 -0
- package/lib/id-compressor/identifiers.js +11 -0
- package/lib/id-compressor/identifiers.js.map +1 -0
- package/lib/id-compressor/index.d.ts +5 -6
- package/lib/id-compressor/index.d.ts.map +1 -1
- package/lib/id-compressor/index.js +5 -6
- package/lib/id-compressor/index.js.map +1 -1
- package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
- package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/lib/id-compressor/persistanceUtilities.js +34 -0
- package/lib/id-compressor/persistanceUtilities.js.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/lib/id-compressor/sessions.d.ts +115 -0
- package/lib/id-compressor/sessions.d.ts.map +1 -0
- package/lib/id-compressor/sessions.js +290 -0
- package/lib/id-compressor/sessions.js.map +1 -0
- package/lib/id-compressor/utilities.d.ts +49 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -0
- package/lib/id-compressor/utilities.js +148 -0
- package/lib/id-compressor/utilities.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.js +10 -6
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +2 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +10 -5
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +2 -2
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +15 -12
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +17 -7
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +2 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +13 -10
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +7 -5
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +13 -22
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +6 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +20 -8
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.js +1 -2
- package/lib/opProperties.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 +18 -8
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +62 -40
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +18 -14
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +3 -3
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +3 -3
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +21 -22
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +31 -10
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +265 -133
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +8 -7
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +75 -74
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +2 -2
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js +6 -10
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +9 -13
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/index.d.ts +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 +10 -19
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +42 -115
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +4 -14
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +14 -100
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +38 -25
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -3
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +5 -6
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +3 -0
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +5 -3
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +10 -4
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +100 -51
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +8 -8
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +35 -25
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +28 -31
- package/src/batchTracker.ts +7 -5
- package/src/blobManager.ts +188 -166
- package/src/connectionTelemetry.ts +9 -4
- package/src/containerRuntime.ts +806 -441
- package/src/dataStore.ts +12 -4
- package/src/dataStoreContext.ts +39 -43
- package/src/dataStoreContexts.ts +4 -6
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +114 -80
- package/src/deltaManagerProxyBase.ts +111 -0
- package/src/deltaManagerSummarizerProxy.ts +4 -1
- package/src/deltaScheduler.ts +7 -11
- package/src/error.ts +18 -0
- package/src/gc/garbageCollection.md +53 -5
- package/src/gc/garbageCollection.ts +58 -52
- package/src/gc/gcConfigs.ts +4 -2
- package/src/gc/gcDefinitions.ts +17 -20
- package/src/gc/gcEarlyAdoption.md +145 -0
- package/src/gc/gcHelpers.ts +1 -12
- package/src/gc/gcSummaryStateTracker.ts +19 -65
- package/src/gc/gcTelemetry.ts +14 -12
- package/src/gc/gcUnreferencedStateTracker.ts +1 -1
- package/src/gc/index.ts +2 -4
- package/src/id-compressor/appendOnlySortedMap.ts +26 -87
- package/src/id-compressor/finalSpace.ts +67 -0
- package/src/id-compressor/idCompressor.ts +458 -1682
- package/src/id-compressor/identifiers.ts +42 -0
- package/src/id-compressor/index.ts +11 -20
- package/src/id-compressor/persistanceUtilities.ts +58 -0
- package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
- package/src/id-compressor/sessions.ts +405 -0
- package/src/id-compressor/utilities.ts +187 -0
- package/src/index.ts +7 -2
- package/src/opLifecycle/opCompressor.ts +6 -5
- package/src/opLifecycle/opDecompressor.ts +6 -4
- package/src/opLifecycle/opGroupingManager.ts +9 -6
- package/src/opLifecycle/opSplitter.ts +7 -6
- package/src/opLifecycle/outbox.ts +23 -32
- package/src/opLifecycle/remoteMessageProcessor.ts +27 -8
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +72 -42
- package/src/scheduleManager.ts +7 -5
- package/src/summary/index.ts +4 -3
- package/src/summary/orderedClientElection.ts +10 -6
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +291 -163
- package/src/summary/summarizer.ts +27 -16
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +1 -1
- package/src/summary/summarizerNode/index.ts +1 -2
- package/src/summary/summarizerNode/summarizerNode.ts +36 -160
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -130
- package/src/summary/summarizerTypes.ts +40 -25
- package/src/summary/summaryCollection.ts +3 -3
- package/src/summary/summaryFormat.ts +4 -1
- package/src/summary/summaryGenerator.ts +52 -52
- package/src/summary/summaryManager.ts +44 -17
- package/dist/id-compressor/idRange.d.ts +0 -11
- package/dist/id-compressor/idRange.d.ts.map +0 -1
- package/dist/id-compressor/idRange.js +0 -29
- package/dist/id-compressor/idRange.js.map +0 -1
- package/dist/id-compressor/numericUuid.d.ts +0 -59
- package/dist/id-compressor/numericUuid.d.ts.map +0 -1
- package/dist/id-compressor/numericUuid.js +0 -325
- package/dist/id-compressor/numericUuid.js.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.js +0 -488
- package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/dist/id-compressor/utils.d.ts +0 -57
- package/dist/id-compressor/utils.d.ts.map +0 -1
- package/dist/id-compressor/utils.js +0 -90
- package/dist/id-compressor/utils.js.map +0 -1
- package/dist/id-compressor/uuidUtilities.d.ts +0 -28
- package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/dist/id-compressor/uuidUtilities.js +0 -104
- package/dist/id-compressor/uuidUtilities.js.map +0 -1
- package/lib/id-compressor/idRange.d.ts +0 -11
- package/lib/id-compressor/idRange.d.ts.map +0 -1
- package/lib/id-compressor/idRange.js +0 -25
- package/lib/id-compressor/idRange.js.map +0 -1
- package/lib/id-compressor/numericUuid.d.ts +0 -59
- package/lib/id-compressor/numericUuid.d.ts.map +0 -1
- package/lib/id-compressor/numericUuid.js +0 -315
- package/lib/id-compressor/numericUuid.js.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.js +0 -484
- package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/lib/id-compressor/utils.d.ts +0 -57
- package/lib/id-compressor/utils.d.ts.map +0 -1
- package/lib/id-compressor/utils.js +0 -79
- package/lib/id-compressor/utils.js.map +0 -1
- package/lib/id-compressor/uuidUtilities.d.ts +0 -28
- package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/lib/id-compressor/uuidUtilities.js +0 -96
- package/lib/id-compressor/uuidUtilities.js.map +0 -1
- package/src/id-compressor/idRange.ts +0 -35
- package/src/id-compressor/numericUuid.ts +0 -383
- package/src/id-compressor/sessionIdNormalizer.ts +0 -609
- package/src/id-compressor/utils.ts +0 -114
- package/src/id-compressor/uuidUtilities.ts +0 -120
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/* eslint-disable no-bitwise */
|
|
7
|
+
import { assert } from "@fluidframework/core-utils";
|
|
8
|
+
import { SessionId, StableId } from "@fluidframework/runtime-definitions";
|
|
9
|
+
import { v4 } from "uuid";
|
|
10
|
+
import { LocalCompressedId, NumericUuid } from "./identifiers";
|
|
11
|
+
|
|
12
|
+
const hexadecimalCharCodes = Array.from("09afAF").map((c) => c.charCodeAt(0)) as [
|
|
13
|
+
zero: number,
|
|
14
|
+
nine: number,
|
|
15
|
+
a: number,
|
|
16
|
+
f: number,
|
|
17
|
+
A: number,
|
|
18
|
+
F: number,
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
function isHexadecimalCharacter(charCode: number): boolean {
|
|
22
|
+
return (
|
|
23
|
+
(charCode >= hexadecimalCharCodes[0] && charCode <= hexadecimalCharCodes[1]) ||
|
|
24
|
+
(charCode >= hexadecimalCharCodes[2] && charCode <= hexadecimalCharCodes[3]) ||
|
|
25
|
+
(charCode >= hexadecimalCharCodes[4] && charCode <= hexadecimalCharCodes[5])
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Generate a random session ID
|
|
31
|
+
*/
|
|
32
|
+
export function createSessionId(): SessionId {
|
|
33
|
+
return assertIsStableId(v4()) as SessionId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Asserts that the given string is a stable ID.
|
|
38
|
+
*/
|
|
39
|
+
export function assertIsStableId(stableId: string): StableId {
|
|
40
|
+
assert(isStableId(stableId), 0x4a3 /* Expected a StableId */);
|
|
41
|
+
return stableId;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Asserts that the given string is a stable ID.
|
|
46
|
+
*/
|
|
47
|
+
export function assertIsSessionId(stableId: string): SessionId {
|
|
48
|
+
assertIsStableId(stableId);
|
|
49
|
+
return stableId as SessionId;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Generate a random stable ID
|
|
54
|
+
*/
|
|
55
|
+
export function generateStableId(): StableId {
|
|
56
|
+
return assertIsStableId(v4());
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Returns true iff the given string is a valid Version 4, variant 2 UUID
|
|
61
|
+
* 'xxxxxxxx-xxxx-4xxx-vxxx-xxxxxxxxxxxx'
|
|
62
|
+
*/
|
|
63
|
+
export function isStableId(str: string): str is StableId {
|
|
64
|
+
if (str.length !== 36) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
for (let i = 0; i < str.length; i++) {
|
|
69
|
+
switch (i) {
|
|
70
|
+
case 8:
|
|
71
|
+
case 13:
|
|
72
|
+
case 18:
|
|
73
|
+
case 23:
|
|
74
|
+
if (str.charAt(i) !== "-") {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
|
|
79
|
+
case 14:
|
|
80
|
+
if (str.charAt(i) !== "4") {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
break;
|
|
84
|
+
|
|
85
|
+
case 19: {
|
|
86
|
+
const char = str.charAt(i);
|
|
87
|
+
if (char !== "8" && char !== "9" && char !== "a" && char !== "b") {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
default:
|
|
94
|
+
if (!isHexadecimalCharacter(str.charCodeAt(i))) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A numeric comparator used for sorting in ascending order.
|
|
106
|
+
*
|
|
107
|
+
* Handles +/-0 like Map: -0 is equal to +0.
|
|
108
|
+
*/
|
|
109
|
+
export function compareFiniteNumbers<T extends number>(a: T, b: T): number {
|
|
110
|
+
return a - b;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Compares strings lexically to form a strict partial ordering.
|
|
115
|
+
*/
|
|
116
|
+
export function compareStrings<T extends string>(a: T, b: T): number {
|
|
117
|
+
return a > b ? 1 : a === b ? 0 : -1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Compares bigints to form a strict partial ordering.
|
|
122
|
+
*/
|
|
123
|
+
export function compareBigints<T extends bigint>(a: T, b: T): number {
|
|
124
|
+
return a > b ? 1 : a === b ? 0 : -1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function genCountFromLocalId(localId: LocalCompressedId): number {
|
|
128
|
+
return -localId;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function localIdFromGenCount(genCount: number): LocalCompressedId {
|
|
132
|
+
return -genCount as LocalCompressedId;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
|
|
136
|
+
const versionMask = 0x4n << (19n * 4n); // Version 4
|
|
137
|
+
const variantMask = 0x8n << (15n * 4n); // Variant RFC4122 (1 0 x x)
|
|
138
|
+
const upperMask = 0xffffffffffffn << (20n * 4n);
|
|
139
|
+
// Upper mask when version/variant bits are removed
|
|
140
|
+
const strippedUpperMask = upperMask >> 6n;
|
|
141
|
+
const middieBittiesMask = 0xfffn << (16n * 4n);
|
|
142
|
+
// Middie mask when version/variant bits are removed
|
|
143
|
+
const strippedMiddieBittiesMask = middieBittiesMask >> 2n;
|
|
144
|
+
// Note: leading character should be 3 to mask at 0011
|
|
145
|
+
// The more-significant half of the N nibble is used to denote the variant (10xx)
|
|
146
|
+
const lowerMask = 0x3fffffffffffffffn;
|
|
147
|
+
|
|
148
|
+
export function numericUuidFromStableId(stableId: StableId): NumericUuid {
|
|
149
|
+
const uuidU128 = BigInt(`0x${stableId.replace(/-/g, "")}`);
|
|
150
|
+
const upperMasked = uuidU128 & upperMask;
|
|
151
|
+
const middieBittiesMasked = uuidU128 & middieBittiesMask;
|
|
152
|
+
const lowerMasked = uuidU128 & lowerMask;
|
|
153
|
+
|
|
154
|
+
const upperMaskedPlaced = upperMasked >> 6n;
|
|
155
|
+
const middieBittiesMaskedPlaced = middieBittiesMasked >> 2n;
|
|
156
|
+
|
|
157
|
+
const id = upperMaskedPlaced | middieBittiesMaskedPlaced | lowerMasked;
|
|
158
|
+
return id as NumericUuid;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function stableIdFromNumericUuid(numericUuid: NumericUuid): StableId {
|
|
162
|
+
// bitwise reverse transform
|
|
163
|
+
const upperMasked = (numericUuid & strippedUpperMask) << 6n;
|
|
164
|
+
const middieBittiesMasked = (numericUuid & strippedMiddieBittiesMask) << 2n;
|
|
165
|
+
const lowerMasked = numericUuid & lowerMask;
|
|
166
|
+
const uuidU128 = upperMasked | versionMask | middieBittiesMasked | variantMask | lowerMasked;
|
|
167
|
+
// Pad to 32 characters, inserting leading zeroes if needed
|
|
168
|
+
const uuidString = uuidU128.toString(16).padStart(32, "0");
|
|
169
|
+
return `${uuidString.substring(0, 8)}-${uuidString.substring(8, 12)}-${uuidString.substring(
|
|
170
|
+
12,
|
|
171
|
+
16,
|
|
172
|
+
)}-${uuidString.substring(16, 20)}-${uuidString.substring(20, 32)}` as StableId;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function offsetNumericUuid(numericUuid: NumericUuid, offset: number): NumericUuid {
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
177
|
+
return (numericUuid + BigInt(offset)) as NumericUuid;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function subtractNumericUuids(a: NumericUuid, b: NumericUuid): NumericUuid {
|
|
181
|
+
return (a - b) as NumericUuid;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function addNumericUuids(a: NumericUuid, b: NumericUuid): NumericUuid {
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
186
|
+
return (a + b) as NumericUuid;
|
|
187
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -6,20 +6,23 @@
|
|
|
6
6
|
export {
|
|
7
7
|
ContainerMessageType,
|
|
8
8
|
ContainerRuntimeMessage,
|
|
9
|
+
IContainerRuntimeMessageCompatDetails,
|
|
10
|
+
CompatModeBehavior,
|
|
9
11
|
ISummaryRuntimeOptions,
|
|
10
12
|
ISummaryBaseConfiguration,
|
|
11
13
|
ISummaryConfigurationHeuristics,
|
|
12
14
|
ISummaryConfigurationDisableSummarizer,
|
|
13
15
|
ISummaryConfigurationDisableHeuristics,
|
|
14
16
|
IContainerRuntimeOptions,
|
|
15
|
-
IRootSummaryTreeWithStats,
|
|
16
17
|
isRuntimeMessage,
|
|
17
18
|
RuntimeMessage,
|
|
18
19
|
agentSchedulerId,
|
|
19
20
|
ContainerRuntime,
|
|
20
21
|
RuntimeHeaders,
|
|
21
22
|
AllowTombstoneRequestHeaderKey,
|
|
23
|
+
AllowInactiveRequestHeaderKey,
|
|
22
24
|
TombstoneResponseHeaderKey,
|
|
25
|
+
InactiveResponseHeaderKey,
|
|
23
26
|
ISummaryConfiguration,
|
|
24
27
|
DefaultSummaryConfiguration,
|
|
25
28
|
ICompressionRuntimeOptions,
|
|
@@ -69,6 +72,8 @@ export {
|
|
|
69
72
|
ICancellableSummarizerController,
|
|
70
73
|
SubmitSummaryFailureData,
|
|
71
74
|
SummaryStage,
|
|
75
|
+
IRetriableFailureResult,
|
|
76
|
+
ISummarizeEventProps,
|
|
72
77
|
} from "./summary";
|
|
78
|
+
export { isStableId, generateStableId, assertIsStableId } from "./id-compressor";
|
|
73
79
|
export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle";
|
|
74
|
-
export { generateStableId, isStableId, assertIsStableId } from "./id-compressor";
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { assert
|
|
8
|
-
import {
|
|
6
|
+
import { createChildLogger, UsageError } from "@fluidframework/telemetry-utils";
|
|
7
|
+
import { assert } from "@fluidframework/core-utils";
|
|
8
|
+
import { IsoBuffer } from "@fluid-internal/client-utils";
|
|
9
9
|
import { compress } from "lz4js";
|
|
10
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
10
11
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
11
12
|
import { estimateSocketSize } from "./batchManager";
|
|
12
13
|
import { IBatch, BatchMessage } from "./definitions";
|
|
@@ -19,8 +20,8 @@ import { IBatch, BatchMessage } from "./definitions";
|
|
|
19
20
|
export class OpCompressor {
|
|
20
21
|
private readonly logger;
|
|
21
22
|
|
|
22
|
-
constructor(logger:
|
|
23
|
-
this.logger =
|
|
23
|
+
constructor(logger: ITelemetryBaseLogger) {
|
|
24
|
+
this.logger = createChildLogger({ logger, namespace: "OpCompressor" });
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
public compressBatch(batch: IBatch): IBatch {
|
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
import { decompress } from "lz4js";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { assert
|
|
9
|
-
import {
|
|
8
|
+
import { assert } from "@fluidframework/core-utils";
|
|
9
|
+
import { IsoBuffer, Uint8ArrayToString } from "@fluid-internal/client-utils";
|
|
10
|
+
import { createChildLogger } from "@fluidframework/telemetry-utils";
|
|
11
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
10
12
|
import { CompressionAlgorithms } from "../containerRuntime";
|
|
11
13
|
import { IBatchMetadata } from "../metadata";
|
|
12
14
|
import { IMessageProcessingResult } from "./definitions";
|
|
@@ -32,8 +34,8 @@ export class OpDecompressor {
|
|
|
32
34
|
private processedCount = 0;
|
|
33
35
|
private readonly logger;
|
|
34
36
|
|
|
35
|
-
constructor(logger:
|
|
36
|
-
this.logger =
|
|
37
|
+
constructor(logger: ITelemetryBaseLogger) {
|
|
38
|
+
this.logger = createChildLogger({ logger, namespace: "OpDecompressor" });
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
public processMessage(message: ISequencedDocumentMessage): IMessageProcessingResult {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert } from "@fluidframework/
|
|
6
|
+
import { assert } from "@fluidframework/core-utils";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { ContainerMessageType } from "..";
|
|
9
9
|
import { IBatch } from "./definitions";
|
|
@@ -22,6 +22,12 @@ interface IGroupedMessage {
|
|
|
22
22
|
compression?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function isGroupContents(
|
|
26
|
+
opContents: IGroupedBatchMessageContents | { type?: unknown } | undefined,
|
|
27
|
+
): opContents is IGroupedBatchMessageContents {
|
|
28
|
+
return opContents?.type === OpGroupingManager.groupedBatchOp;
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
export class OpGroupingManager {
|
|
26
32
|
static readonly groupedBatchOp = "groupedBatch";
|
|
27
33
|
|
|
@@ -68,14 +74,11 @@ export class OpGroupingManager {
|
|
|
68
74
|
}
|
|
69
75
|
|
|
70
76
|
public ungroupOp(op: ISequencedDocumentMessage): ISequencedDocumentMessage[] {
|
|
71
|
-
if (
|
|
72
|
-
(op.contents as { type?: unknown } | undefined)?.type !==
|
|
73
|
-
OpGroupingManager.groupedBatchOp
|
|
74
|
-
) {
|
|
77
|
+
if (!isGroupContents(op.contents)) {
|
|
75
78
|
return [op];
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
const messages =
|
|
81
|
+
const messages = op.contents.contents;
|
|
79
82
|
let fakeCsn = 1;
|
|
80
83
|
return messages.map((subMessage) => ({
|
|
81
84
|
...op,
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryLoggerExt, ChildLogger } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { assert } from "@fluidframework/common-utils";
|
|
8
|
-
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
9
6
|
import {
|
|
7
|
+
createChildLogger,
|
|
10
8
|
DataCorruptionError,
|
|
11
9
|
extractSafePropertiesFromMessage,
|
|
12
|
-
} from "@fluidframework/
|
|
10
|
+
} from "@fluidframework/telemetry-utils";
|
|
11
|
+
import { assert } from "@fluidframework/core-utils";
|
|
12
|
+
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
13
13
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
14
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
14
15
|
import { ContainerMessageType, ContainerRuntimeMessage } from "../containerRuntime";
|
|
15
16
|
import { estimateSocketSize } from "./batchManager";
|
|
16
17
|
import { BatchMessage, IBatch, IChunkedOp, IMessageProcessingResult } from "./definitions";
|
|
@@ -30,10 +31,10 @@ export class OpSplitter {
|
|
|
30
31
|
| undefined,
|
|
31
32
|
public readonly chunkSizeInBytes: number,
|
|
32
33
|
private readonly maxBatchSizeInBytes: number,
|
|
33
|
-
logger:
|
|
34
|
+
logger: ITelemetryBaseLogger,
|
|
34
35
|
) {
|
|
35
36
|
this.chunkMap = new Map<string, string[]>(chunks);
|
|
36
|
-
this.logger =
|
|
37
|
+
this.logger = createChildLogger({ logger, namespace: "OpSplitter" });
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
public get isBatchChunkingEnabled(): boolean {
|
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
loggerToMonitoringContext,
|
|
7
|
+
createChildMonitoringContext,
|
|
8
|
+
GenericError,
|
|
10
9
|
MonitoringContext,
|
|
10
|
+
UsageError,
|
|
11
11
|
} from "@fluidframework/telemetry-utils";
|
|
12
|
-
import { assert } from "@fluidframework/
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { MessageType } from "@fluidframework/protocol-definitions";
|
|
12
|
+
import { assert } from "@fluidframework/core-utils";
|
|
13
|
+
import { IBatchMessage, ICriticalContainerError } from "@fluidframework/container-definitions";
|
|
14
|
+
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
16
15
|
import { ICompressionRuntimeOptions } from "../containerRuntime";
|
|
17
16
|
import { IPendingBatchMessage, PendingStateManager } from "../pendingStateManager";
|
|
18
17
|
import {
|
|
@@ -37,11 +36,14 @@ export interface IOutboxConfig {
|
|
|
37
36
|
export interface IOutboxParameters {
|
|
38
37
|
readonly shouldSend: () => boolean;
|
|
39
38
|
readonly pendingStateManager: PendingStateManager;
|
|
40
|
-
readonly
|
|
39
|
+
readonly submitBatchFn:
|
|
40
|
+
| ((batch: IBatchMessage[], referenceSequenceNumber?: number) => number)
|
|
41
|
+
| undefined;
|
|
42
|
+
readonly legacySendBatchFn: (batch: IBatch) => void;
|
|
41
43
|
readonly config: IOutboxConfig;
|
|
42
44
|
readonly compressor: OpCompressor;
|
|
43
45
|
readonly splitter: OpSplitter;
|
|
44
|
-
readonly logger:
|
|
46
|
+
readonly logger: ITelemetryBaseLogger;
|
|
45
47
|
readonly groupingManager: OpGroupingManager;
|
|
46
48
|
readonly getCurrentSequenceNumbers: () => BatchSequenceNumbers;
|
|
47
49
|
readonly reSubmit: (message: IPendingBatchMessage) => void;
|
|
@@ -65,9 +67,8 @@ export function getLongStack<T>(action: () => T, length: number = 50): T {
|
|
|
65
67
|
if (
|
|
66
68
|
(
|
|
67
69
|
Object.getOwnPropertyDescriptor(errorObj, "stackTraceLimit") ||
|
|
68
|
-
Object.getOwnPropertyDescriptor(Object.getPrototypeOf(errorObj), "stackTraceLimit")
|
|
69
|
-
|
|
70
|
-
).writable !== true
|
|
70
|
+
Object.getOwnPropertyDescriptor(Object.getPrototypeOf(errorObj), "stackTraceLimit")
|
|
71
|
+
)?.writable !== true
|
|
71
72
|
) {
|
|
72
73
|
return action();
|
|
73
74
|
}
|
|
@@ -100,7 +101,7 @@ export class Outbox {
|
|
|
100
101
|
private mismatchedOpsReported = 0;
|
|
101
102
|
|
|
102
103
|
constructor(private readonly params: IOutboxParameters) {
|
|
103
|
-
this.mc =
|
|
104
|
+
this.mc = createChildMonitoringContext({ logger: params.logger, namespace: "Outbox" });
|
|
104
105
|
const isCompressionEnabled =
|
|
105
106
|
this.params.config.compressionOptions.minimumBatchSizeInBytes !==
|
|
106
107
|
Number.POSITIVE_INFINITY;
|
|
@@ -113,12 +114,12 @@ export class Outbox {
|
|
|
113
114
|
this.blobAttachBatch = new BatchManager({ hardLimit });
|
|
114
115
|
}
|
|
115
116
|
|
|
117
|
+
public get messageCount(): number {
|
|
118
|
+
return this.attachFlowBatch.length + this.mainBatch.length + this.blobAttachBatch.length;
|
|
119
|
+
}
|
|
120
|
+
|
|
116
121
|
public get isEmpty(): boolean {
|
|
117
|
-
return
|
|
118
|
-
this.attachFlowBatch.length === 0 &&
|
|
119
|
-
this.mainBatch.length === 0 &&
|
|
120
|
-
this.blobAttachBatch.length === 0
|
|
121
|
-
);
|
|
122
|
+
return this.messageCount === 0;
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
/**
|
|
@@ -326,7 +327,7 @@ export class Outbox {
|
|
|
326
327
|
this.params.config.compressionOptions === undefined ||
|
|
327
328
|
this.params.config.compressionOptions.minimumBatchSizeInBytes >
|
|
328
329
|
batch.contentSizeInBytes ||
|
|
329
|
-
this.params.
|
|
330
|
+
this.params.submitBatchFn === undefined
|
|
330
331
|
) {
|
|
331
332
|
// Nothing to do if the batch is empty or if compression is disabled or not supported, or if we don't need to compress
|
|
332
333
|
return disableGroupedBatching ? batch : this.params.groupingManager.groupBatch(batch);
|
|
@@ -381,7 +382,7 @@ export class Outbox {
|
|
|
381
382
|
});
|
|
382
383
|
}
|
|
383
384
|
|
|
384
|
-
if (this.params.
|
|
385
|
+
if (this.params.submitBatchFn === undefined) {
|
|
385
386
|
// Legacy path - supporting old loader versions. Can be removed only when LTS moves above
|
|
386
387
|
// version that has support for batches (submitBatchFn)
|
|
387
388
|
assert(
|
|
@@ -389,23 +390,13 @@ export class Outbox {
|
|
|
389
390
|
0x5a6 /* Compression should not have happened if the loader does not support it */,
|
|
390
391
|
);
|
|
391
392
|
|
|
392
|
-
|
|
393
|
-
this.params.containerContext.submitFn(
|
|
394
|
-
MessageType.Operation,
|
|
395
|
-
// For back-compat (submitFn only works on deserialized content)
|
|
396
|
-
message.contents === undefined ? undefined : JSON.parse(message.contents),
|
|
397
|
-
true, // batch
|
|
398
|
-
message.metadata,
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
this.params.containerContext.deltaManager.flush();
|
|
393
|
+
this.params.legacySendBatchFn(batch);
|
|
403
394
|
} else {
|
|
404
395
|
assert(
|
|
405
396
|
batch.referenceSequenceNumber !== undefined,
|
|
406
397
|
0x58e /* Batch must not be empty */,
|
|
407
398
|
);
|
|
408
|
-
this.params.
|
|
399
|
+
this.params.submitBatchFn(
|
|
409
400
|
batch.content.map((message) => ({
|
|
410
401
|
contents: message.contents,
|
|
411
402
|
metadata: message.metadata,
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ContainerMessageType,
|
|
9
|
+
ContainerRuntimeMessage,
|
|
10
|
+
SequencedContainerRuntimeMessage,
|
|
11
|
+
} from "../containerRuntime";
|
|
8
12
|
import { OpDecompressor } from "./opDecompressor";
|
|
9
13
|
import { OpGroupingManager } from "./opGroupingManager";
|
|
10
14
|
import { OpSplitter } from "./opSplitter";
|
|
@@ -24,6 +28,11 @@ export class RemoteMessageProcessor {
|
|
|
24
28
|
this.opSplitter.clearPartialChunks(clientId);
|
|
25
29
|
}
|
|
26
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Ungroups and Unchunks the runtime ops encapsulated by the single remoteMessage received over the wire
|
|
33
|
+
* @param remoteMessage - A message from another client, likely a chunked/grouped op
|
|
34
|
+
* @returns the ungrouped, unchunked, unpacked SequencedContainerRuntimeMessage encapsulated in the remote message
|
|
35
|
+
*/
|
|
27
36
|
public process(remoteMessage: ISequencedDocumentMessage): ISequencedDocumentMessage[] {
|
|
28
37
|
const result: ISequencedDocumentMessage[] = [];
|
|
29
38
|
|
|
@@ -32,11 +41,12 @@ export class RemoteMessageProcessor {
|
|
|
32
41
|
const message = this.opDecompressor.processMessage(ungroupedMessage).message;
|
|
33
42
|
|
|
34
43
|
for (let ungroupedMessage2 of this.opGroupingManager.ungroupOp(message)) {
|
|
44
|
+
// unpack and unchunk the ungrouped message in place
|
|
35
45
|
unpackRuntimeMessage(ungroupedMessage2);
|
|
36
|
-
|
|
37
46
|
const chunkProcessingResult =
|
|
38
47
|
this.opSplitter.processRemoteMessage(ungroupedMessage2);
|
|
39
48
|
ungroupedMessage2 = chunkProcessingResult.message;
|
|
49
|
+
|
|
40
50
|
if (chunkProcessingResult.state !== "Processed") {
|
|
41
51
|
// If the message is not chunked or if the splitter is still rebuilding the original message,
|
|
42
52
|
// there is no need to continue processing
|
|
@@ -92,21 +102,30 @@ const copy = (remoteMessage: ISequencedDocumentMessage): ISequencedDocumentMessa
|
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
/**
|
|
95
|
-
* For a given message, it moves the nested
|
|
105
|
+
* For a given message, it moves the nested ContainerRuntimeMessage props one level up.
|
|
96
106
|
*
|
|
107
|
+
* The return type illustrates the assumption that the message param
|
|
108
|
+
* becomes a ContainerRuntimeMessage by the time the function returns
|
|
109
|
+
* (but there is no runtime validation of the 'type' or 'compatDetails' values)
|
|
97
110
|
*/
|
|
98
|
-
|
|
111
|
+
function unpack(
|
|
112
|
+
message: ISequencedDocumentMessage,
|
|
113
|
+
): asserts message is SequencedContainerRuntimeMessage {
|
|
99
114
|
const innerContents = message.contents as ContainerRuntimeMessage;
|
|
100
|
-
|
|
101
|
-
message
|
|
102
|
-
|
|
115
|
+
|
|
116
|
+
// We're going to turn message into a SequencedContainerRuntimeMessage in-place
|
|
117
|
+
const sequencedContainerRuntimeMessage = message as SequencedContainerRuntimeMessage;
|
|
118
|
+
sequencedContainerRuntimeMessage.type = innerContents.type;
|
|
119
|
+
sequencedContainerRuntimeMessage.contents = innerContents.contents;
|
|
120
|
+
sequencedContainerRuntimeMessage.compatDetails = innerContents.compatDetails;
|
|
121
|
+
}
|
|
103
122
|
|
|
104
123
|
/**
|
|
105
124
|
* Unpacks runtime messages.
|
|
106
125
|
*
|
|
107
126
|
* @remarks This API makes no promises regarding backward-compatibility. This is internal API.
|
|
108
127
|
* @param message - message (as it observed in storage / service)
|
|
109
|
-
* @returns
|
|
128
|
+
* @returns whether the given message was unpacked
|
|
110
129
|
*
|
|
111
130
|
* @internal
|
|
112
131
|
*/
|
package/src/packageVersion.ts
CHANGED