@fluidframework/container-runtime 2.0.0-dev.2.3.0.115467 → 2.0.0-dev.4.1.0.148229
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +21 -10
- package/.mocharc.js +2 -2
- package/api-extractor.json +2 -2
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +2 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +74 -42
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +321 -152
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +11 -9
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +3 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +148 -114
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +534 -342
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +11 -9
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +40 -13
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +146 -66
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +7 -3
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +3 -1
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +39 -12
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +164 -76
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +19 -0
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/dist/deltaManagerSummarizerProxy.js +40 -0
- package/dist/deltaManagerSummarizerProxy.js.map +1 -0
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +8 -3
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +204 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -0
- package/dist/gc/garbageCollection.js +926 -0
- package/dist/gc/garbageCollection.js.map +1 -0
- package/dist/gc/gcConfigs.d.ts +22 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -0
- package/dist/gc/gcConfigs.js +143 -0
- package/dist/gc/gcConfigs.js.map +1 -0
- package/dist/gc/gcDefinitions.d.ts +320 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -0
- package/dist/gc/gcDefinitions.js +81 -0
- package/dist/gc/gcDefinitions.js.map +1 -0
- package/dist/gc/gcHelpers.d.ts +86 -0
- package/dist/gc/gcHelpers.d.ts.map +1 -0
- package/dist/gc/gcHelpers.js +268 -0
- package/dist/gc/gcHelpers.js.map +1 -0
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/dist/gc/gcReferenceGraphAlgorithm.js +49 -0
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -0
- package/dist/gc/gcSummaryDefinitions.d.ts +52 -0
- package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/dist/gc/gcSummaryDefinitions.js +7 -0
- package/dist/gc/gcSummaryDefinitions.js.map +1 -0
- package/dist/gc/gcSummaryStateTracker.d.ts +93 -0
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/dist/gc/gcSummaryStateTracker.js +239 -0
- package/dist/gc/gcSummaryStateTracker.js.map +1 -0
- package/{lib → dist/gc}/gcSweepReadyUsageDetection.d.ts +5 -5
- package/dist/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/dist/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +15 -11
- package/dist/gc/gcSweepReadyUsageDetection.js.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts +34 -0
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/dist/gc/gcUnreferencedStateTracker.js +94 -0
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/dist/gc/index.d.ts +13 -0
- package/dist/gc/index.d.ts.map +1 -0
- package/dist/gc/index.js +50 -0
- package/dist/gc/index.js.map +1 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -13
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +10 -0
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +37 -8
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +29 -1
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +3 -3
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +3 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +46 -17
- 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 +72 -18
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +46 -2
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +142 -5
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +23 -2
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +101 -51
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +17 -2
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/opProperties.d.ts.map +1 -1
- package/dist/opProperties.js +1 -3
- 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 +6 -15
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +137 -165
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +0 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +11 -21
- package/dist/scheduleManager.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.d.ts +17 -0
- package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/dist/storageServiceWithAttachBlobs.js +32 -0
- package/dist/storageServiceWithAttachBlobs.js.map +1 -0
- package/dist/summary/index.d.ts +17 -0
- package/dist/summary/index.d.ts.map +1 -0
- package/dist/summary/index.js +46 -0
- package/dist/summary/index.js.map +1 -0
- package/dist/summary/orderedClientElection.d.ts.map +1 -0
- package/dist/{orderedClientElection.js → summary/orderedClientElection.js} +10 -4
- package/dist/summary/orderedClientElection.js.map +1 -0
- package/{lib → dist/summary}/runWhileConnectedCoordinator.d.ts +3 -2
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/dist/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +5 -4
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/{lib → dist/summary}/runningSummarizer.d.ts +19 -18
- package/dist/summary/runningSummarizer.d.ts.map +1 -0
- package/dist/{runningSummarizer.js → summary/runningSummarizer.js} +191 -77
- package/dist/summary/runningSummarizer.js.map +1 -0
- package/dist/{summarizer.d.ts → summary/summarizer.d.ts} +6 -12
- package/dist/summary/summarizer.d.ts.map +1 -0
- package/dist/{summarizer.js → summary/summarizer.js} +32 -76
- package/dist/summary/summarizer.js.map +1 -0
- package/dist/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +1 -2
- package/dist/summary/summarizerClientElection.d.ts.map +1 -0
- package/dist/{summarizerClientElection.js → summary/summarizerClientElection.js} +3 -30
- package/dist/summary/summarizerClientElection.js.map +1 -0
- package/dist/{summarizerHeuristics.d.ts → summary/summarizerHeuristics.d.ts} +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -0
- package/dist/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +9 -12
- package/dist/summary/summarizerHeuristics.js.map +1 -0
- package/dist/summary/summarizerNode/index.d.ts +8 -0
- package/dist/summary/summarizerNode/index.d.ts.map +1 -0
- package/dist/summary/summarizerNode/index.js +12 -0
- package/dist/summary/summarizerNode/index.js.map +1 -0
- package/dist/summary/summarizerNode/summarizerNode.d.ts +149 -0
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNode.js +531 -0
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +125 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +132 -0
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +22 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +423 -0
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/{lib → dist/summary}/summarizerTypes.d.ts +29 -42
- package/dist/summary/summarizerTypes.d.ts.map +1 -0
- package/dist/{summarizerTypes.js → summary/summarizerTypes.js} +0 -5
- package/dist/summary/summarizerTypes.js.map +1 -0
- package/dist/summary/summaryCollection.d.ts.map +1 -0
- package/dist/{summaryCollection.js → summary/summaryCollection.js} +18 -8
- package/dist/summary/summaryCollection.js.map +1 -0
- package/{lib → dist/summary}/summaryFormat.d.ts +3 -21
- package/dist/summary/summaryFormat.d.ts.map +1 -0
- package/dist/{summaryFormat.js → summary/summaryFormat.js} +19 -21
- package/dist/summary/summaryFormat.js.map +1 -0
- package/dist/summary/summaryGenerator.d.ts.map +1 -0
- package/dist/{summaryGenerator.js → summary/summaryGenerator.js} +34 -16
- package/dist/summary/summaryGenerator.js.map +1 -0
- package/dist/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -0
- package/dist/{summaryManager.js → summary/summaryManager.js} +21 -9
- package/dist/summary/summaryManager.js.map +1 -0
- package/dist/throttler.d.ts +2 -2
- package/dist/throttler.d.ts.map +1 -1
- package/dist/throttler.js +4 -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 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +74 -42
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +322 -153
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +11 -9
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +3 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +148 -114
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +506 -314
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +11 -9
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +40 -13
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +136 -56
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +7 -3
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +3 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +39 -12
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +162 -74
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +19 -0
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/lib/deltaManagerSummarizerProxy.js +36 -0
- package/lib/deltaManagerSummarizerProxy.js.map +1 -0
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +9 -4
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +204 -0
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/gc/garbageCollection.js +922 -0
- package/lib/gc/garbageCollection.js.map +1 -0
- package/lib/gc/gcConfigs.d.ts +22 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -0
- package/lib/gc/gcConfigs.js +139 -0
- package/lib/gc/gcConfigs.js.map +1 -0
- package/lib/gc/gcDefinitions.d.ts +320 -0
- package/lib/gc/gcDefinitions.d.ts.map +1 -0
- package/lib/gc/gcDefinitions.js +78 -0
- package/lib/gc/gcDefinitions.js.map +1 -0
- package/lib/gc/gcHelpers.d.ts +86 -0
- package/lib/gc/gcHelpers.d.ts.map +1 -0
- package/lib/gc/gcHelpers.js +254 -0
- package/lib/gc/gcHelpers.js.map +1 -0
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts +16 -0
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/lib/gc/gcReferenceGraphAlgorithm.js +45 -0
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -0
- package/lib/gc/gcSummaryDefinitions.d.ts +52 -0
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/lib/gc/gcSummaryDefinitions.js +6 -0
- package/lib/gc/gcSummaryDefinitions.js.map +1 -0
- package/lib/gc/gcSummaryStateTracker.d.ts +93 -0
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/lib/gc/gcSummaryStateTracker.js +235 -0
- package/lib/gc/gcSummaryStateTracker.js.map +1 -0
- package/{dist → lib/gc}/gcSweepReadyUsageDetection.d.ts +5 -5
- package/lib/gc/gcSweepReadyUsageDetection.d.ts.map +1 -0
- package/lib/{gcSweepReadyUsageDetection.js → gc/gcSweepReadyUsageDetection.js} +15 -11
- package/lib/gc/gcSweepReadyUsageDetection.js.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.d.ts +34 -0
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/lib/gc/gcUnreferencedStateTracker.js +90 -0
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/lib/gc/index.d.ts +13 -0
- package/lib/gc/index.d.ts.map +1 -0
- package/lib/gc/index.js +12 -0
- package/lib/gc/index.js.map +1 -0
- package/lib/index.d.ts +3 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -6
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts +10 -0
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +35 -7
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +29 -1
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +3 -3
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +2 -2
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +47 -18
- 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 +72 -18
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +46 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +141 -5
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +23 -2
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +103 -53
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +17 -2
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/opProperties.d.ts.map +1 -1
- package/lib/opProperties.js +1 -3
- 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 +6 -15
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +137 -165
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts +0 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +11 -21
- package/lib/scheduleManager.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.d.ts +17 -0
- package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/lib/storageServiceWithAttachBlobs.js +28 -0
- package/lib/storageServiceWithAttachBlobs.js.map +1 -0
- package/lib/summary/index.d.ts +17 -0
- package/lib/summary/index.d.ts.map +1 -0
- package/lib/summary/index.js +15 -0
- package/lib/summary/index.js.map +1 -0
- package/lib/summary/orderedClientElection.d.ts.map +1 -0
- package/lib/{orderedClientElection.js → summary/orderedClientElection.js} +10 -4
- package/lib/summary/orderedClientElection.js.map +1 -0
- package/{dist → lib/summary}/runWhileConnectedCoordinator.d.ts +3 -2
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/lib/{runWhileConnectedCoordinator.js → summary/runWhileConnectedCoordinator.js} +5 -4
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/{dist → lib/summary}/runningSummarizer.d.ts +19 -18
- package/lib/summary/runningSummarizer.d.ts.map +1 -0
- package/lib/{runningSummarizer.js → summary/runningSummarizer.js} +193 -79
- package/lib/summary/runningSummarizer.js.map +1 -0
- package/lib/{summarizer.d.ts → summary/summarizer.d.ts} +6 -12
- package/lib/summary/summarizer.d.ts.map +1 -0
- package/lib/{summarizer.js → summary/summarizer.js} +34 -78
- package/lib/summary/summarizer.js.map +1 -0
- package/lib/{summarizerClientElection.d.ts → summary/summarizerClientElection.d.ts} +1 -2
- package/lib/summary/summarizerClientElection.d.ts.map +1 -0
- package/lib/{summarizerClientElection.js → summary/summarizerClientElection.js} +3 -30
- package/lib/summary/summarizerClientElection.js.map +1 -0
- package/lib/{summarizerHeuristics.d.ts → summary/summarizerHeuristics.d.ts} +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
- package/lib/{summarizerHeuristics.js → summary/summarizerHeuristics.js} +9 -12
- package/lib/summary/summarizerHeuristics.js.map +1 -0
- package/lib/summary/summarizerNode/index.d.ts +8 -0
- package/lib/summary/summarizerNode/index.d.ts.map +1 -0
- package/lib/summary/summarizerNode/index.js +7 -0
- package/lib/summary/summarizerNode/index.js.map +1 -0
- package/lib/summary/summarizerNode/summarizerNode.d.ts +149 -0
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNode.js +526 -0
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +125 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +125 -0
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +22 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +419 -0
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/{dist → lib/summary}/summarizerTypes.d.ts +29 -42
- package/lib/summary/summarizerTypes.d.ts.map +1 -0
- package/lib/summary/summarizerTypes.js +6 -0
- package/lib/summary/summarizerTypes.js.map +1 -0
- package/lib/summary/summaryCollection.d.ts.map +1 -0
- package/lib/{summaryCollection.js → summary/summaryCollection.js} +18 -8
- package/lib/summary/summaryCollection.js.map +1 -0
- package/{dist → lib/summary}/summaryFormat.d.ts +3 -21
- package/lib/summary/summaryFormat.d.ts.map +1 -0
- package/lib/{summaryFormat.js → summary/summaryFormat.js} +20 -21
- package/lib/summary/summaryFormat.js.map +1 -0
- package/lib/summary/summaryGenerator.d.ts.map +1 -0
- package/lib/{summaryGenerator.js → summary/summaryGenerator.js} +34 -16
- package/lib/summary/summaryGenerator.js.map +1 -0
- package/lib/{summaryManager.d.ts → summary/summaryManager.d.ts} +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -0
- package/lib/{summaryManager.js → summary/summaryManager.js} +21 -9
- package/lib/summary/summaryManager.js.map +1 -0
- package/lib/throttler.d.ts +2 -2
- package/lib/throttler.d.ts.map +1 -1
- package/lib/throttler.js +4 -4
- package/lib/throttler.js.map +1 -1
- package/package.json +67 -61
- package/prettier.config.cjs +1 -1
- package/src/batchTracker.ts +55 -50
- package/src/blobManager.ts +863 -594
- package/src/connectionTelemetry.ts +280 -249
- package/src/containerHandleContext.ts +27 -29
- package/src/containerRuntime.ts +3174 -2805
- package/src/dataStore.ts +172 -159
- package/src/dataStoreContext.ts +1141 -993
- package/src/dataStoreContexts.ts +178 -161
- package/src/dataStoreRegistry.ts +25 -20
- package/src/dataStores.ts +887 -716
- package/src/deltaManagerSummarizerProxy.ts +46 -0
- package/src/deltaScheduler.ts +158 -150
- package/{garbageCollection.md → src/gc/garbageCollection.md} +16 -3
- package/src/gc/garbageCollection.ts +1250 -0
- package/src/gc/gcConfigs.ts +193 -0
- package/src/gc/gcDefinitions.ts +387 -0
- package/src/gc/gcHelpers.ts +332 -0
- package/src/gc/gcReferenceGraphAlgorithm.ts +52 -0
- package/src/gc/gcSummaryDefinitions.ts +54 -0
- package/src/gc/gcSummaryStateTracker.ts +329 -0
- package/src/gc/gcSweepReadyUsageDetection.ts +145 -0
- package/src/gc/gcUnreferencedStateTracker.ts +114 -0
- package/src/gc/index.ts +65 -0
- package/src/index.ts +61 -75
- package/src/opLifecycle/README.md +157 -0
- package/src/opLifecycle/batchManager.ts +119 -86
- package/src/opLifecycle/definitions.ts +49 -19
- package/src/opLifecycle/index.ts +7 -6
- package/src/opLifecycle/opCompressor.ts +78 -40
- package/src/opLifecycle/opDecompressor.ts +148 -64
- package/src/opLifecycle/opSplitter.ts +269 -66
- package/src/opLifecycle/outbox.ts +268 -184
- package/src/opLifecycle/remoteMessageProcessor.ts +63 -47
- package/src/opProperties.ts +11 -9
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +386 -381
- package/src/scheduleManager.ts +299 -280
- package/src/storageServiceWithAttachBlobs.ts +38 -0
- package/src/summary/index.ts +105 -0
- package/src/summary/orderedClientElection.ts +564 -0
- package/src/summary/runWhileConnectedCoordinator.ts +113 -0
- package/src/summary/runningSummarizer.ts +788 -0
- package/src/summary/summarizer.ts +372 -0
- package/src/summary/summarizerClientElection.ts +139 -0
- package/src/summary/summarizerHeuristics.ts +224 -0
- package/src/summary/summarizerNode/index.ts +12 -0
- package/src/summary/summarizerNode/summarizerNode.ts +766 -0
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +214 -0
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +644 -0
- package/src/summary/summarizerTypes.ts +507 -0
- package/src/summary/summaryCollection.ts +450 -0
- package/src/summary/summaryFormat.ts +228 -0
- package/src/summary/summaryGenerator.ts +505 -0
- package/src/summary/summaryManager.ts +423 -0
- package/src/throttler.ts +131 -122
- package/tsconfig.esnext.json +6 -6
- package/tsconfig.json +9 -13
- package/dist/garbageCollection.d.ts +0 -387
- package/dist/garbageCollection.d.ts.map +0 -1
- package/dist/garbageCollection.js +0 -1138
- package/dist/garbageCollection.js.map +0 -1
- package/dist/garbageCollectionConstants.d.ts +0 -19
- package/dist/garbageCollectionConstants.d.ts.map +0 -1
- package/dist/garbageCollectionConstants.js +0 -34
- package/dist/garbageCollectionConstants.js.map +0 -1
- package/dist/gcSweepReadyUsageDetection.d.ts.map +0 -1
- package/dist/gcSweepReadyUsageDetection.js.map +0 -1
- package/dist/orderedClientElection.d.ts.map +0 -1
- package/dist/orderedClientElection.js.map +0 -1
- package/dist/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/dist/runWhileConnectedCoordinator.js.map +0 -1
- package/dist/runningSummarizer.d.ts.map +0 -1
- package/dist/runningSummarizer.js.map +0 -1
- package/dist/serializedSnapshotStorage.d.ts +0 -58
- package/dist/serializedSnapshotStorage.d.ts.map +0 -1
- package/dist/serializedSnapshotStorage.js +0 -108
- package/dist/serializedSnapshotStorage.js.map +0 -1
- package/dist/summarizer.d.ts.map +0 -1
- package/dist/summarizer.js.map +0 -1
- package/dist/summarizerClientElection.d.ts.map +0 -1
- package/dist/summarizerClientElection.js.map +0 -1
- package/dist/summarizerHandle.d.ts +0 -12
- package/dist/summarizerHandle.d.ts.map +0 -1
- package/dist/summarizerHandle.js +0 -22
- package/dist/summarizerHandle.js.map +0 -1
- package/dist/summarizerHeuristics.d.ts.map +0 -1
- package/dist/summarizerHeuristics.js.map +0 -1
- package/dist/summarizerTypes.d.ts.map +0 -1
- package/dist/summarizerTypes.js.map +0 -1
- package/dist/summaryCollection.d.ts.map +0 -1
- package/dist/summaryCollection.js.map +0 -1
- package/dist/summaryFormat.d.ts.map +0 -1
- package/dist/summaryFormat.js.map +0 -1
- package/dist/summaryGenerator.d.ts.map +0 -1
- package/dist/summaryGenerator.js.map +0 -1
- package/dist/summaryManager.d.ts.map +0 -1
- package/dist/summaryManager.js.map +0 -1
- package/lib/garbageCollection.d.ts +0 -387
- package/lib/garbageCollection.d.ts.map +0 -1
- package/lib/garbageCollection.js +0 -1133
- package/lib/garbageCollection.js.map +0 -1
- package/lib/garbageCollectionConstants.d.ts +0 -19
- package/lib/garbageCollectionConstants.d.ts.map +0 -1
- package/lib/garbageCollectionConstants.js +0 -31
- package/lib/garbageCollectionConstants.js.map +0 -1
- package/lib/gcSweepReadyUsageDetection.d.ts.map +0 -1
- package/lib/gcSweepReadyUsageDetection.js.map +0 -1
- package/lib/orderedClientElection.d.ts.map +0 -1
- package/lib/orderedClientElection.js.map +0 -1
- package/lib/runWhileConnectedCoordinator.d.ts.map +0 -1
- package/lib/runWhileConnectedCoordinator.js.map +0 -1
- package/lib/runningSummarizer.d.ts.map +0 -1
- package/lib/runningSummarizer.js.map +0 -1
- package/lib/serializedSnapshotStorage.d.ts +0 -58
- package/lib/serializedSnapshotStorage.d.ts.map +0 -1
- package/lib/serializedSnapshotStorage.js +0 -104
- package/lib/serializedSnapshotStorage.js.map +0 -1
- package/lib/summarizer.d.ts.map +0 -1
- package/lib/summarizer.js.map +0 -1
- package/lib/summarizerClientElection.d.ts.map +0 -1
- package/lib/summarizerClientElection.js.map +0 -1
- package/lib/summarizerHandle.d.ts +0 -12
- package/lib/summarizerHandle.d.ts.map +0 -1
- package/lib/summarizerHandle.js +0 -18
- package/lib/summarizerHandle.js.map +0 -1
- package/lib/summarizerHeuristics.d.ts.map +0 -1
- package/lib/summarizerHeuristics.js.map +0 -1
- package/lib/summarizerTypes.d.ts.map +0 -1
- package/lib/summarizerTypes.js +0 -9
- package/lib/summarizerTypes.js.map +0 -1
- package/lib/summaryCollection.d.ts.map +0 -1
- package/lib/summaryCollection.js.map +0 -1
- package/lib/summaryFormat.d.ts.map +0 -1
- package/lib/summaryFormat.js.map +0 -1
- package/lib/summaryGenerator.d.ts.map +0 -1
- package/lib/summaryGenerator.js.map +0 -1
- package/lib/summaryManager.d.ts.map +0 -1
- package/lib/summaryManager.js.map +0 -1
- package/src/garbageCollection.ts +0 -1646
- package/src/garbageCollectionConstants.ts +0 -35
- package/src/gcSweepReadyUsageDetection.ts +0 -139
- package/src/orderedClientElection.ts +0 -532
- package/src/runWhileConnectedCoordinator.ts +0 -106
- package/src/runningSummarizer.ts +0 -611
- package/src/serializedSnapshotStorage.ts +0 -146
- package/src/summarizer.ts +0 -421
- package/src/summarizerClientElection.ts +0 -161
- package/src/summarizerHandle.ts +0 -21
- package/src/summarizerHeuristics.ts +0 -222
- package/src/summarizerTypes.ts +0 -510
- package/src/summaryCollection.ts +0 -421
- package/src/summaryFormat.ts +0 -235
- package/src/summaryGenerator.ts +0 -446
- package/src/summaryManager.ts +0 -394
- /package/dist/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/dist/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
- /package/dist/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
- /package/lib/{orderedClientElection.d.ts → summary/orderedClientElection.d.ts} +0 -0
- /package/lib/{summaryCollection.d.ts → summary/summaryCollection.d.ts} +0 -0
- /package/lib/{summaryGenerator.d.ts → summary/summaryGenerator.d.ts} +0 -0
package/src/index.ts
CHANGED
|
@@ -4,82 +4,68 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
ContainerMessageType,
|
|
8
|
+
ContainerRuntimeMessage,
|
|
9
|
+
ISummaryRuntimeOptions,
|
|
10
|
+
ISummaryBaseConfiguration,
|
|
11
|
+
ISummaryConfigurationHeuristics,
|
|
12
|
+
ISummaryConfigurationDisableSummarizer,
|
|
13
|
+
ISummaryConfigurationDisableHeuristics,
|
|
14
|
+
IContainerRuntimeOptions,
|
|
15
|
+
IRootSummaryTreeWithStats,
|
|
16
|
+
isRuntimeMessage,
|
|
17
|
+
RuntimeMessage,
|
|
18
|
+
agentSchedulerId,
|
|
19
|
+
ContainerRuntime,
|
|
20
|
+
RuntimeHeaders,
|
|
21
|
+
AllowTombstoneRequestHeaderKey,
|
|
22
|
+
TombstoneResponseHeaderKey,
|
|
23
|
+
ISummaryConfiguration,
|
|
24
|
+
DefaultSummaryConfiguration,
|
|
25
|
+
ICompressionRuntimeOptions,
|
|
26
|
+
CompressionAlgorithms,
|
|
26
27
|
} from "./containerRuntime";
|
|
27
28
|
export { FluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
29
|
+
export { IGCRuntimeOptions, IGCStats } from "./gc";
|
|
28
30
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
SummarizeResultPart,
|
|
70
|
-
SummarizerStopReason,
|
|
71
|
-
} from "./summarizerTypes";
|
|
72
|
-
export {
|
|
73
|
-
IAckedSummary,
|
|
74
|
-
IClientSummaryWatcher,
|
|
75
|
-
ISummary,
|
|
76
|
-
ISummaryCollectionOpEvents,
|
|
77
|
-
ISummaryAckMessage,
|
|
78
|
-
ISummaryNackMessage,
|
|
79
|
-
ISummaryOpMessage,
|
|
80
|
-
OpActionEventListener,
|
|
81
|
-
OpActionEventName,
|
|
82
|
-
SummaryCollection,
|
|
83
|
-
} from "./summaryCollection";
|
|
84
|
-
export { ICancellableSummarizerController, neverCancelledSummaryToken } from "./runWhileConnectedCoordinator";
|
|
31
|
+
IAckedSummary,
|
|
32
|
+
ISummarizer,
|
|
33
|
+
ISummarizeResults,
|
|
34
|
+
ISummaryCancellationToken,
|
|
35
|
+
neverCancelledSummaryToken,
|
|
36
|
+
Summarizer,
|
|
37
|
+
SummarizerStopReason,
|
|
38
|
+
SummaryCollection,
|
|
39
|
+
EnqueueSummarizeResult,
|
|
40
|
+
IAckSummaryResult,
|
|
41
|
+
IBaseSummarizeResult,
|
|
42
|
+
IBroadcastSummaryResult,
|
|
43
|
+
ICancellationToken,
|
|
44
|
+
IConnectableRuntime,
|
|
45
|
+
IEnqueueSummarizeOptions,
|
|
46
|
+
IGenerateSummaryTreeResult,
|
|
47
|
+
IGeneratedSummaryStats,
|
|
48
|
+
INackSummaryResult,
|
|
49
|
+
IOnDemandSummarizeOptions,
|
|
50
|
+
IRefreshSummaryAckOptions,
|
|
51
|
+
ISubmitSummaryOpResult,
|
|
52
|
+
ISubmitSummaryOptions,
|
|
53
|
+
ISummarizeOptions,
|
|
54
|
+
ISummarizerEvents,
|
|
55
|
+
ISummarizerInternalsProvider,
|
|
56
|
+
ISummarizerRuntime,
|
|
57
|
+
ISummarizingWarning,
|
|
58
|
+
IUploadSummaryResult,
|
|
59
|
+
SubmitSummaryResult,
|
|
60
|
+
SummarizeResultPart,
|
|
61
|
+
IClientSummaryWatcher,
|
|
62
|
+
ISummary,
|
|
63
|
+
ISummaryCollectionOpEvents,
|
|
64
|
+
ISummaryAckMessage,
|
|
65
|
+
ISummaryNackMessage,
|
|
66
|
+
ISummaryOpMessage,
|
|
67
|
+
OpActionEventListener,
|
|
68
|
+
OpActionEventName,
|
|
69
|
+
ICancellableSummarizerController,
|
|
70
|
+
} from "./summary";
|
|
85
71
|
export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle";
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Configs and feature gates for solving the 1MB limit.
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
There is a current limitation regarding the size of the payload a Fluid client can send and receive. [The limit is 1MB per payload](https://github.com/microsoft/FluidFramework/issues/9023) and it is currently enforced explicitly with the `BatchTooLarge` error which closes the container.
|
|
6
|
+
|
|
7
|
+
There are two features which can be used to work around this size limit, batch compression and compressed batch chunking. This document describes how to enable/disable them, along with a brief description of how they work. The features are enabled by default.
|
|
8
|
+
|
|
9
|
+
By default, the runtime is configured with a max batch size of `716800` bytes, which is lower than the 1MB limit. The reason for the lower value is to account for possible overhead from the op envelope and metadata.
|
|
10
|
+
|
|
11
|
+
## Table of contents
|
|
12
|
+
|
|
13
|
+
- [Introduction](#introduction)
|
|
14
|
+
- [Compression](#compression)
|
|
15
|
+
- [Chunking for compression](#chunking-for-compression)
|
|
16
|
+
- [Disabling in case of emergency](#disabling-in-case-of-emergency)
|
|
17
|
+
- [Example configs](#example-configs)
|
|
18
|
+
- [How it works](#how-it-works)
|
|
19
|
+
|
|
20
|
+
## Compression
|
|
21
|
+
|
|
22
|
+
**Compression targets payloads which exceed the max batch size and it is enabled by default.**. The `IContainerRuntimeOptions.compressionOptions` property, of type `ICompressionRuntimeOptions` is the configuration governing how compression works.
|
|
23
|
+
|
|
24
|
+
`ICompressionRuntimeOptions` has two properties:
|
|
25
|
+
|
|
26
|
+
- `minimumBatchSizeInBytes` – the minimum size of the batch for which compression should kick in. If the payload is too small, compression may not yield too many benefits. To target the original 1MB issue, a good value here would be to match the default maxBatchSizeInBytes (972800), however, experimentally, a good lower value could be at around 614400 bytes. Setting this value to `Number.POSITIVE_INFINITY` will disable compression.
|
|
27
|
+
- `compressionAlgorithm` – currently, only `lz4` is supported.
|
|
28
|
+
|
|
29
|
+
## Chunking for compression
|
|
30
|
+
|
|
31
|
+
**Op chunking for compression targets payloads which exceed the max batch size after compression.** So, only payloads which are already compressed. By default, the feature is enabled.
|
|
32
|
+
|
|
33
|
+
The `IContainerRuntimeOptions.chunkSizeInBytes` property is the only configuration for chunking and it represents the size of the chunked ops, when chunking is necessary. When chunking is performed, the large op is split into smaller ops (chunks). This config represents both the size of the chunks and the threshold for the feature to activate. The value enables a trade-off between large chunks / few ops and small chunks / many ops. A good value for this would be at around 204800. Setting this value to `Number.POSITIVE_INFINITY` will disable chunking.
|
|
34
|
+
|
|
35
|
+
This config would govern chunking compressed batches only. We will not be enabling chunking across all types of ops/batches but **only when compression is enabled and when the batch is compressed**, and its payload size is more than `IContainerRuntimeOptions.chunkSizeInBytes`.
|
|
36
|
+
|
|
37
|
+
## Disabling in case of emergency
|
|
38
|
+
|
|
39
|
+
If the features are enabled using the configs, they can be disabled at runtime via feature gates as following:
|
|
40
|
+
|
|
41
|
+
- `Fluid.ContainerRuntime.CompressionDisabled` - if set to true, will disable compression (this has a side effect of also disabling chunking, as chunking is invoked only for compressed payloads).
|
|
42
|
+
- `Fluid.ContainerRuntime.CompressionChunkingDisabled` - if set to true, will disable chunking for compression.
|
|
43
|
+
|
|
44
|
+
## Example configs
|
|
45
|
+
|
|
46
|
+
By default, the runtime is configured with the following values related to compression and chunking:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
const runtimeOptions: IContainerRuntimeOptions = {
|
|
50
|
+
compressionOptions: {
|
|
51
|
+
minimumBatchSizeInBytes: 614400,
|
|
52
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
53
|
+
},
|
|
54
|
+
chunkSizeInBytes: 204800,
|
|
55
|
+
maxBatchSizeInBytes: 716800,
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
To use compression but disable chunking:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
const runtimeOptions: IContainerRuntimeOptions = {
|
|
63
|
+
chunkSizeInBytes: Number.POSITIVE_INFINITY,
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
To disable compression (will also disable chunking, as chunking works only for compressed batches):
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
const runtimeOptions: IContainerRuntimeOptions = {
|
|
71
|
+
compressionOptions: {
|
|
72
|
+
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
73
|
+
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## How it works
|
|
79
|
+
|
|
80
|
+
Compression currently works as a runtime layer over the regular op sending/receiving pipeline.
|
|
81
|
+
|
|
82
|
+
If we have a batch with a size larger than the configured minimum required for compression (in the example let’s say it’s 850 bytes), as following:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
+-----------+-----------+-----------+-----------+
|
|
86
|
+
| Op 1 | Op 2 | Op 3 | Op 4 |
|
|
87
|
+
| SeqNum: 1 | SeqNum: 2 | SeqNum: 3 | SeqNum: 4 |
|
|
88
|
+
| Size: 100 | Size: 150 | Size: 200 | Size: 400 |
|
|
89
|
+
+-----------+-----------+-----------+-----------+
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The total size of the batch is 850 bytes. The client which needs to send the batch would compress the batch to a smaller size (200 bytes) and will send a new batch like the following:
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
+--------------------+-----------+-----------+-----------+
|
|
96
|
+
| Op 1 | Op 2 | Op 3 | Op 4 |
|
|
97
|
+
| SeqNum: 1 | SeqNum: 2 | SeqNum: 3 | SeqNum: 4 |
|
|
98
|
+
| Size: 200 | Size: 0 | Size: 0 | Size: 0 |
|
|
99
|
+
| Compression: 'lz4' | | | |
|
|
100
|
+
+--------------------+-----------+-----------+-----------+
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The first op in the batch is the only one with content (which is opaque due to it being compressed), the rest of the ops serve only to reserve the sequence numbers so that the state machine which rebuilds the original batch on the receiving client can reconstruct the original batch.
|
|
104
|
+
|
|
105
|
+
When the batch is received by a client, it will detect the first op as being compressed, it will decompress it and store it in memory. For each empty op subsequently received, it will fetch the uncompressed content from memory and rebuild the original ops. The original ops are then processed by the runtime and applied accordingly.
|
|
106
|
+
So, compression virtualizes the batch.
|
|
107
|
+
|
|
108
|
+
After compression, the first op in the batch can exceed 1MB, therefore it would still be rejected. In this case, another layer of virtualization is added after compression (and before decompression, symmetrically on the receiving end).
|
|
109
|
+
|
|
110
|
+
The first op in the compressed batch can be chunked into smaller ops which can be sent outside the original batch. However, to conveniently maintain the batch semantics, the last chunk (the chunk which triggers rebuilding the original op) is the first op in the new batch.
|
|
111
|
+
|
|
112
|
+
To illustrate, let’s take the large batch below:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
+--------------------+-----------+-----------+-----------+
|
|
116
|
+
| Op 1 | Op 2 | Op 3 | Op 4 |
|
|
117
|
+
| SeqNum: 1 | SeqNum: 2 | SeqNum: 3 | SeqNum: 4 |
|
|
118
|
+
| Size: 900 | Size: 0 | Size: 0 | Size: 0 |
|
|
119
|
+
| Compression: 'lz4' | | | |
|
|
120
|
+
+--------------------+-----------+-----------+-----------+
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This will produce the following batches:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
+-----------+
|
|
127
|
+
| Chunk 1/3 |
|
|
128
|
+
| SeqNum: 1 |
|
|
129
|
+
| Size: 300 |
|
|
130
|
+
+-----------+
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
+-----------+
|
|
136
|
+
| Chunk 2/3 |
|
|
137
|
+
| SeqNum: 2 |
|
|
138
|
+
| Size: 300 |
|
|
139
|
+
+-----------+
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
+-----------+-----------+-----------+-----------+
|
|
145
|
+
| Chunk 3/3 | Op 2 | Op 3 | Op 4 |
|
|
146
|
+
| SeqNum: 3 | SeqNum: 4 | SeqNum: 5 | SeqNum: 6 |
|
|
147
|
+
| Size: 300 | Size: 0 | Size: 0 | Size: 0 |
|
|
148
|
+
+-----------+-----------+-----------+-----------+
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The first 2 chunks are sent in their own batches, while the last chunk is the first op in the last batch which contains the ops reserving the required sequence numbers.
|
|
152
|
+
|
|
153
|
+
Notice that the sequence numbers don’t matter here, as all ops will be based off the same reference sequence number, so the sequence number will be recalculated for all, without additional work.
|
|
154
|
+
|
|
155
|
+
Additionally, as compression preserves the original uncompressed batch layout in terms of the number of ops by using empty ops to reserve the sequence numbers, this ensures that the clients will always receive the exact count of ops to rebuild the uncompressed batch sequentially.
|
|
156
|
+
|
|
157
|
+
On the receiving end, the client will accumulate chunks 1 and 2 and keep them in memory. When chunk 3 is received, the original large, decompressed op will be rebuilt, and the runtime will then process the batch as if it is a compressed batch.
|
|
@@ -7,99 +7,132 @@ import { ICompressionRuntimeOptions } from "../containerRuntime";
|
|
|
7
7
|
import { BatchMessage, IBatch, IBatchCheckpoint } from "./definitions";
|
|
8
8
|
|
|
9
9
|
export interface IBatchManagerOptions {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
readonly hardLimit: number;
|
|
11
|
+
readonly softLimit?: number;
|
|
12
|
+
readonly compressionOptions?: ICompressionRuntimeOptions;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Estimated size of the stringification overhead for an op accumulated
|
|
17
|
+
* from runtime to loader to the service.
|
|
18
|
+
*/
|
|
19
|
+
const opOverhead = 200;
|
|
20
|
+
|
|
15
21
|
/**
|
|
16
22
|
* Helper class that manages partial batch & rollback.
|
|
17
23
|
*/
|
|
18
24
|
export class BatchManager {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
25
|
+
private pendingBatch: BatchMessage[] = [];
|
|
26
|
+
private batchContentSize = 0;
|
|
27
|
+
|
|
28
|
+
public get length() {
|
|
29
|
+
return this.pendingBatch.length;
|
|
30
|
+
}
|
|
31
|
+
public get contentSizeInBytes() {
|
|
32
|
+
return this.batchContentSize;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
public get referenceSequenceNumber(): number | undefined {
|
|
36
|
+
return this.pendingBatch.length === 0
|
|
37
|
+
? undefined
|
|
38
|
+
: this.pendingBatch[this.pendingBatch.length - 1].referenceSequenceNumber;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
constructor(public readonly options: IBatchManagerOptions) {}
|
|
42
|
+
|
|
43
|
+
public push(message: BatchMessage): boolean {
|
|
44
|
+
const contentSize = this.batchContentSize + (message.contents?.length ?? 0);
|
|
45
|
+
const opCount = this.pendingBatch.length;
|
|
46
|
+
|
|
47
|
+
// Attempt to estimate batch size, aka socket message size.
|
|
48
|
+
// Each op has pretty large envelope, estimating to be 200 bytes.
|
|
49
|
+
// Also content will be strigified, and that adds a lot of overhead due to a lot of escape characters.
|
|
50
|
+
// Not taking it into account, as compression work should help there - compressed payload will be
|
|
51
|
+
// initially stored as base64, and that requires only 2 extra escape characters.
|
|
52
|
+
const socketMessageSize = contentSize + opOverhead * opCount;
|
|
53
|
+
|
|
54
|
+
// If we were provided soft limit, check for exceeding it.
|
|
55
|
+
// But only if we have any ops, as the intention here is to flush existing ops (on exceeding this limit)
|
|
56
|
+
// and start over. That's not an option if we have no ops.
|
|
57
|
+
// If compression is enabled, the soft and hard limit are ignored and the message will be pushed anyways.
|
|
58
|
+
// Cases where the message is still too large will be handled by the maxConsecutiveReconnects path.
|
|
59
|
+
if (
|
|
60
|
+
this.options.softLimit !== undefined &&
|
|
61
|
+
this.length > 0 &&
|
|
62
|
+
socketMessageSize >= this.options.softLimit
|
|
63
|
+
) {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (socketMessageSize >= this.options.hardLimit) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
this.batchContentSize = contentSize;
|
|
72
|
+
this.pendingBatch.push(message);
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public get empty() {
|
|
77
|
+
return this.pendingBatch.length === 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
public popBatch(): IBatch {
|
|
81
|
+
const batch: IBatch = {
|
|
82
|
+
content: this.pendingBatch,
|
|
83
|
+
contentSizeInBytes: this.batchContentSize,
|
|
84
|
+
referenceSequenceNumber: this.referenceSequenceNumber,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
this.pendingBatch = [];
|
|
88
|
+
this.batchContentSize = 0;
|
|
89
|
+
|
|
90
|
+
return addBatchMetadata(batch);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Capture the pending state at this point
|
|
95
|
+
*/
|
|
96
|
+
public checkpoint(): IBatchCheckpoint {
|
|
97
|
+
const startPoint = this.pendingBatch.length;
|
|
98
|
+
return {
|
|
99
|
+
rollback: (process: (message: BatchMessage) => void) => {
|
|
100
|
+
for (let i = this.pendingBatch.length; i > startPoint; ) {
|
|
101
|
+
i--;
|
|
102
|
+
const message = this.pendingBatch[i];
|
|
103
|
+
this.batchContentSize -= message.contents?.length ?? 0;
|
|
104
|
+
process(message);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
this.pendingBatch.length = startPoint;
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
90
111
|
}
|
|
91
112
|
|
|
92
113
|
const addBatchMetadata = (batch: IBatch): IBatch => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
114
|
+
if (batch.content.length > 1) {
|
|
115
|
+
batch.content[0].metadata = {
|
|
116
|
+
...batch.content[0].metadata,
|
|
117
|
+
batch: true,
|
|
118
|
+
};
|
|
119
|
+
batch.content[batch.content.length - 1].metadata = {
|
|
120
|
+
...batch.content[batch.content.length - 1].metadata,
|
|
121
|
+
batch: false,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return batch;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Estimates the real size in bytes on the socket for a given batch. It assumes that
|
|
130
|
+
* the envelope size (and the size of an empty op) is 200 bytes, taking into account
|
|
131
|
+
* extra overhead from stringification.
|
|
132
|
+
*
|
|
133
|
+
* @param batch - the batch to inspect
|
|
134
|
+
* @returns An estimate of the payload size in bytes which will be produced when the batch is sent over the wire
|
|
135
|
+
*/
|
|
136
|
+
export const estimateSocketSize = (batch: IBatch): number => {
|
|
137
|
+
return batch.contentSizeInBytes + opOverhead * batch.content.length;
|
|
105
138
|
};
|
|
@@ -4,41 +4,71 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
7
|
-
import { MessageType } from "@fluidframework/protocol-definitions";
|
|
7
|
+
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
8
8
|
import { CompressionAlgorithms, ContainerMessageType, ContainerRuntimeMessage } from "..";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Batch message type used internally by the runtime
|
|
12
12
|
*/
|
|
13
13
|
export type BatchMessage = IBatchMessage & {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
localOpMetadata: unknown;
|
|
15
|
+
deserializedContent: ContainerRuntimeMessage;
|
|
16
|
+
referenceSequenceNumber: number;
|
|
17
|
+
compression?: CompressionAlgorithms;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Batch interface used internally by the runtime.
|
|
22
22
|
*/
|
|
23
23
|
export interface IBatch {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Sum of the in-memory content sizes of all messages in the batch.
|
|
26
|
+
* If the batch is compressed, this number reflects the post-compression size.
|
|
27
|
+
*/
|
|
28
|
+
readonly contentSizeInBytes: number;
|
|
29
|
+
/**
|
|
30
|
+
* All the messages in the batch
|
|
31
|
+
*/
|
|
32
|
+
readonly content: BatchMessage[];
|
|
33
|
+
/**
|
|
34
|
+
* The reference sequence number for the batch
|
|
35
|
+
*/
|
|
36
|
+
readonly referenceSequenceNumber: number | undefined;
|
|
33
37
|
}
|
|
34
38
|
|
|
35
39
|
export interface IBatchCheckpoint {
|
|
36
|
-
|
|
40
|
+
rollback: (action: (message: BatchMessage) => void) => void;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
export interface IChunkedOp {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
chunkId: number;
|
|
45
|
+
totalChunks: number;
|
|
46
|
+
contents: string;
|
|
47
|
+
originalType: MessageType | ContainerMessageType;
|
|
48
|
+
originalMetadata?: Record<string, unknown>;
|
|
49
|
+
originalCompression?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The state of remote message processing:
|
|
54
|
+
* `Processed` - the message can be considered processed
|
|
55
|
+
* `Skipped` - the message was ignored by the processor
|
|
56
|
+
* `Accepted` - the message was processed partially. Eventually, a message
|
|
57
|
+
* will make the processor return `Processed`.
|
|
58
|
+
*/
|
|
59
|
+
export type ProcessingState = "Processed" | "Skipped" | "Accepted";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Return type for functions which process remote messages
|
|
63
|
+
*/
|
|
64
|
+
export interface IMessageProcessingResult {
|
|
65
|
+
/**
|
|
66
|
+
* A shallow copy of the input message if processing happened, or
|
|
67
|
+
* the original message otherwise
|
|
68
|
+
*/
|
|
69
|
+
readonly message: ISequencedDocumentMessage;
|
|
70
|
+
/**
|
|
71
|
+
* Processing result of the input message.
|
|
72
|
+
*/
|
|
73
|
+
readonly state: ProcessingState;
|
|
44
74
|
}
|
package/src/opLifecycle/index.ts
CHANGED
|
@@ -3,15 +3,16 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export { BatchManager } from "./batchManager";
|
|
6
|
+
export { BatchManager, estimateSocketSize } from "./batchManager";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
BatchMessage,
|
|
9
|
+
IBatch,
|
|
10
|
+
IBatchCheckpoint,
|
|
11
|
+
IChunkedOp,
|
|
12
|
+
IMessageProcessingResult,
|
|
12
13
|
} from "./definitions";
|
|
13
14
|
export { Outbox } from "./outbox";
|
|
14
15
|
export { OpCompressor } from "./opCompressor";
|
|
15
16
|
export { OpDecompressor } from "./opDecompressor";
|
|
16
|
-
export { OpSplitter } from "./opSplitter";
|
|
17
|
+
export { OpSplitter, splitOp } from "./opSplitter";
|
|
17
18
|
export { RemoteMessageProcessor, unpackRuntimeMessage } from "./remoteMessageProcessor";
|