@fluidframework/container-runtime 2.0.0-dev.5.2.0.169897 → 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 +147 -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 +15 -18
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +212 -171
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +33 -17
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerRuntime.d.ts +172 -35
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +722 -425
- 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 +4 -4
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +87 -90
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -1
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +10 -10
- 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 +23 -7
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +125 -82
- 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 +65 -56
- 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 -5
- 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 +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/metadata.d.ts +18 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +7 -0
- package/dist/metadata.js.map +1 -0
- package/dist/opLifecycle/batchManager.d.ts +2 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js +15 -7
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +11 -0
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +1 -1
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +2 -1
- package/dist/opLifecycle/index.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 +30 -21
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +19 -13
- 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 +24 -19
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +39 -6
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +138 -61
- 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 +22 -8
- 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 +25 -10
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +101 -64
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +43 -33
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +4 -4
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +3 -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 +40 -23
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +144 -149
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
- 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 +21 -16
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +74 -123
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +44 -24
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +2 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +16 -13
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +4 -0
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +8 -5
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +21 -6
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +117 -54
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +8 -7
- 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 +15 -18
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +187 -146
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +23 -7
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerRuntime.d.ts +172 -35
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +678 -380
- 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 +4 -4
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +49 -52
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -1
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +3 -3
- 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 +23 -7
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +107 -64
- 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 -52
- 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 -5
- 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 +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/metadata.d.ts +18 -0
- package/lib/metadata.d.ts.map +1 -0
- package/lib/metadata.js +6 -0
- package/lib/metadata.js.map +1 -0
- package/lib/opLifecycle/batchManager.d.ts +2 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js +15 -7
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +11 -0
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +1 -1
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +1 -1
- package/lib/opLifecycle/index.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 +22 -13
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +17 -11
- 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 +15 -10
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +39 -6
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +132 -56
- 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 +23 -9
- 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 +25 -10
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +90 -53
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +25 -15
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +4 -4
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +2 -2
- 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 +40 -23
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +132 -137
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +25 -29
- 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 +21 -16
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +70 -119
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +44 -24
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +2 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +9 -6
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +4 -0
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +7 -4
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +21 -6
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +109 -47
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +8 -7
- 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 +30 -32
- package/src/batchTracker.ts +7 -5
- package/src/blobManager.ts +235 -172
- package/src/connectionTelemetry.ts +19 -5
- package/src/containerRuntime.ts +853 -431
- package/src/dataStore.ts +12 -4
- package/src/dataStoreContext.ts +49 -46
- package/src/dataStoreContexts.ts +4 -4
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +119 -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 -51
- package/src/gc/gcConfigs.ts +4 -2
- package/src/gc/gcDefinitions.ts +17 -21
- 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 +15 -13
- 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 +9 -2
- package/src/metadata.ts +19 -0
- package/src/opLifecycle/README.md +20 -0
- package/src/opLifecycle/batchManager.ts +9 -1
- package/src/opLifecycle/definitions.ts +11 -0
- package/src/opLifecycle/index.ts +1 -1
- package/src/opLifecycle/opCompressor.ts +6 -5
- package/src/opLifecycle/opDecompressor.ts +47 -17
- package/src/opLifecycle/opGroupingManager.ts +18 -8
- package/src/opLifecycle/opSplitter.ts +10 -7
- package/src/opLifecycle/outbox.ts +177 -72
- package/src/opLifecycle/remoteMessageProcessor.ts +32 -9
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +123 -78
- package/src/scheduleManager.ts +22 -11
- package/src/summary/index.ts +7 -4
- 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 +2 -2
- package/src/summary/summarizerNode/summarizerNode.ts +142 -184
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +27 -35
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +72 -148
- package/src/summary/summarizerTypes.ts +49 -24
- package/src/summary/summaryCollection.ts +9 -4
- package/src/summary/summaryFormat.ts +9 -2
- package/src/summary/summaryGenerator.ts +72 -49
- package/src/summary/summaryManager.ts +44 -16
- 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 -30
- package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/dist/id-compressor/uuidUtilities.js +0 -106
- 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 -30
- package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/lib/id-compressor/uuidUtilities.js +0 -98
- 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 -123
|
@@ -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,
|
|
@@ -67,6 +70,10 @@ export {
|
|
|
67
70
|
OpActionEventListener,
|
|
68
71
|
OpActionEventName,
|
|
69
72
|
ICancellableSummarizerController,
|
|
73
|
+
SubmitSummaryFailureData,
|
|
74
|
+
SummaryStage,
|
|
75
|
+
IRetriableFailureResult,
|
|
76
|
+
ISummarizeEventProps,
|
|
70
77
|
} from "./summary";
|
|
78
|
+
export { isStableId, generateStableId, assertIsStableId } from "./id-compressor";
|
|
71
79
|
export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle";
|
|
72
|
-
export { generateStableId, isStableId, assertIsStableId } from "./id-compressor";
|
package/src/metadata.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Batching makes assumptions about what might be on the metadata. This interface codifies those assumptions, but does not validate them.
|
|
8
|
+
*/
|
|
9
|
+
export interface IBatchMetadata {
|
|
10
|
+
batch?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Blob handling makes assumptions about what might be on the metadata. This interface codifies those assumptions, but does not validate them.
|
|
15
|
+
*/
|
|
16
|
+
export interface IBlobMetadata {
|
|
17
|
+
blobId?: string;
|
|
18
|
+
localId?: string;
|
|
19
|
+
}
|
|
@@ -51,6 +51,26 @@ and verifying that the following expectation changes won't have any effects:
|
|
|
51
51
|
- client sequence numbers on batch messages can only be used to order messages with the same sequenceNumber
|
|
52
52
|
- requires all ops to be processed by runtime layer (version "2.0.0-internal.1.2.0" or later https://github.com/microsoft/FluidFramework/pull/11832)
|
|
53
53
|
|
|
54
|
+
Grouped batching may become problematic for batches which contain reentrant ops. This is the case when changes are made to a DDS inside a DDS 'onChanged' event handler. This means that the reentrant op will have a different reference sequence number than the rest of the ops in the batch, resulting in a different view of the state of the data model.
|
|
55
|
+
|
|
56
|
+
Therefore, when grouped batching is enabled, all batches with reentrant ops are rebased to the current reference sequence number and resubmitted to the data stores so that all ops are in agreement about the state of the data model and ensure eventual consistency.
|
|
57
|
+
|
|
58
|
+
### How to enable
|
|
59
|
+
|
|
60
|
+
**This feature is disabled by default, currently considered experimental and not ready for production usage.**
|
|
61
|
+
|
|
62
|
+
If all prerequisites in the previous section are met, enabling the feature can be done via the `IContainerRuntimeOptions` as following:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
const runtimeOptions: IContainerRuntimeOptions = {
|
|
66
|
+
(...)
|
|
67
|
+
enableGroupedBatching: true,
|
|
68
|
+
(...)
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
In case of emergency grouped batching can be disabled at runtime, using feature gates. If `"Fluid.ContainerRuntime.DisableGroupedBatching"` is set to `true`, it will disable grouped batching if enabled from `IContainerRuntimeOptions` in the code.
|
|
73
|
+
|
|
54
74
|
## Chunking for compression
|
|
55
75
|
|
|
56
76
|
**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.
|
|
@@ -29,6 +29,7 @@ const opOverhead = 200;
|
|
|
29
29
|
export class BatchManager {
|
|
30
30
|
private pendingBatch: BatchMessage[] = [];
|
|
31
31
|
private batchContentSize = 0;
|
|
32
|
+
private hasReentrantOps = false;
|
|
32
33
|
|
|
33
34
|
public get length() {
|
|
34
35
|
return this.pendingBatch.length;
|
|
@@ -54,9 +55,14 @@ export class BatchManager {
|
|
|
54
55
|
|
|
55
56
|
constructor(public readonly options: IBatchManagerOptions) {}
|
|
56
57
|
|
|
57
|
-
public push(
|
|
58
|
+
public push(
|
|
59
|
+
message: BatchMessage,
|
|
60
|
+
reentrant: boolean,
|
|
61
|
+
currentClientSequenceNumber?: number,
|
|
62
|
+
): boolean {
|
|
58
63
|
const contentSize = this.batchContentSize + (message.contents?.length ?? 0);
|
|
59
64
|
const opCount = this.pendingBatch.length;
|
|
65
|
+
this.hasReentrantOps = this.hasReentrantOps || reentrant;
|
|
60
66
|
|
|
61
67
|
// Attempt to estimate batch size, aka socket message size.
|
|
62
68
|
// Each op has pretty large envelope, estimating to be 200 bytes.
|
|
@@ -100,11 +106,13 @@ export class BatchManager {
|
|
|
100
106
|
content: this.pendingBatch,
|
|
101
107
|
contentSizeInBytes: this.batchContentSize,
|
|
102
108
|
referenceSequenceNumber: this.referenceSequenceNumber,
|
|
109
|
+
hasReentrantOps: this.hasReentrantOps,
|
|
103
110
|
};
|
|
104
111
|
|
|
105
112
|
this.pendingBatch = [];
|
|
106
113
|
this.batchContentSize = 0;
|
|
107
114
|
this.clientSequenceNumber = undefined;
|
|
115
|
+
this.hasReentrantOps = false;
|
|
108
116
|
|
|
109
117
|
return addBatchMetadata(batch);
|
|
110
118
|
}
|
|
@@ -34,6 +34,17 @@ export interface IBatch {
|
|
|
34
34
|
* The reference sequence number for the batch
|
|
35
35
|
*/
|
|
36
36
|
readonly referenceSequenceNumber: number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Wether or not the batch contains at least one op which was produced as the result
|
|
39
|
+
* of processing another op. This means that the batch must be rebased before
|
|
40
|
+
* submitted, to ensure that all ops have the same reference sequence numbers and a
|
|
41
|
+
* consistent view of the data model. This happens when the op is created within a
|
|
42
|
+
* 'changed' event handler of a DDS and will have a different reference sequence number
|
|
43
|
+
* than the rest of the ops in the batch, meaning that it has a different view of the
|
|
44
|
+
* state of the data model, therefore all ops must be resubmitted and rebased to the current
|
|
45
|
+
* reference sequence number to be in agreement about the data model state.
|
|
46
|
+
*/
|
|
47
|
+
readonly hasReentrantOps?: boolean;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
export interface IBatchCheckpoint {
|
package/src/opLifecycle/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ export {
|
|
|
11
11
|
IChunkedOp,
|
|
12
12
|
IMessageProcessingResult,
|
|
13
13
|
} from "./definitions";
|
|
14
|
-
export { Outbox } from "./outbox";
|
|
14
|
+
export { Outbox, getLongStack } from "./outbox";
|
|
15
15
|
export { OpCompressor } from "./opCompressor";
|
|
16
16
|
export { OpDecompressor } from "./opDecompressor";
|
|
17
17
|
export { OpSplitter, splitOp } from "./opSplitter";
|
|
@@ -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,11 +5,21 @@
|
|
|
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";
|
|
13
|
+
import { IBatchMetadata } from "../metadata";
|
|
11
14
|
import { IMessageProcessingResult } from "./definitions";
|
|
12
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Compression makes assumptions about the shape of message contents. This interface codifies those assumptions, but does not validate them.
|
|
18
|
+
*/
|
|
19
|
+
interface IPackedContentsContents {
|
|
20
|
+
packedContents: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
/**
|
|
14
24
|
* State machine that "unrolls" contents of compressed batches of ops after decompressing them.
|
|
15
25
|
* This class relies on some implicit contracts defined below:
|
|
@@ -24,8 +34,8 @@ export class OpDecompressor {
|
|
|
24
34
|
private processedCount = 0;
|
|
25
35
|
private readonly logger;
|
|
26
36
|
|
|
27
|
-
constructor(logger:
|
|
28
|
-
this.logger =
|
|
37
|
+
constructor(logger: ITelemetryBaseLogger) {
|
|
38
|
+
this.logger = createChildLogger({ logger, namespace: "OpDecompressor" });
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
public processMessage(message: ISequencedDocumentMessage): IMessageProcessingResult {
|
|
@@ -34,7 +44,10 @@ export class OpDecompressor {
|
|
|
34
44
|
0x511 /* Only lz4 compression is supported */,
|
|
35
45
|
);
|
|
36
46
|
|
|
37
|
-
if (
|
|
47
|
+
if (
|
|
48
|
+
(message.metadata as IBatchMetadata | undefined)?.batch === true &&
|
|
49
|
+
this.isCompressed(message)
|
|
50
|
+
) {
|
|
38
51
|
// Beginning of a compressed batch
|
|
39
52
|
assert(this.activeBatch === false, 0x4b8 /* shouldn't have multiple active batches */);
|
|
40
53
|
if (message.compression) {
|
|
@@ -47,7 +60,10 @@ export class OpDecompressor {
|
|
|
47
60
|
|
|
48
61
|
this.activeBatch = true;
|
|
49
62
|
|
|
50
|
-
const contents = IsoBuffer.from(
|
|
63
|
+
const contents = IsoBuffer.from(
|
|
64
|
+
(message.contents as IPackedContentsContents).packedContents,
|
|
65
|
+
"base64",
|
|
66
|
+
);
|
|
51
67
|
const decompressedMessage = decompress(contents);
|
|
52
68
|
const intoString = Uint8ArrayToString(decompressedMessage);
|
|
53
69
|
const asObj = JSON.parse(intoString);
|
|
@@ -61,7 +77,7 @@ export class OpDecompressor {
|
|
|
61
77
|
|
|
62
78
|
if (
|
|
63
79
|
this.rootMessageContents !== undefined &&
|
|
64
|
-
message.metadata?.batch === undefined &&
|
|
80
|
+
(message.metadata as IBatchMetadata | undefined)?.batch === undefined &&
|
|
65
81
|
this.activeBatch
|
|
66
82
|
) {
|
|
67
83
|
assert(message.contents === undefined, 0x512 /* Expecting empty message */);
|
|
@@ -73,7 +89,10 @@ export class OpDecompressor {
|
|
|
73
89
|
};
|
|
74
90
|
}
|
|
75
91
|
|
|
76
|
-
if (
|
|
92
|
+
if (
|
|
93
|
+
this.rootMessageContents !== undefined &&
|
|
94
|
+
(message.metadata as IBatchMetadata | undefined)?.batch === false
|
|
95
|
+
) {
|
|
77
96
|
// End of compressed batch
|
|
78
97
|
const returnMessage = newMessage(
|
|
79
98
|
message,
|
|
@@ -90,14 +109,20 @@ export class OpDecompressor {
|
|
|
90
109
|
};
|
|
91
110
|
}
|
|
92
111
|
|
|
93
|
-
if (
|
|
112
|
+
if (
|
|
113
|
+
(message.metadata as IBatchMetadata | undefined)?.batch === undefined &&
|
|
114
|
+
this.isCompressed(message)
|
|
115
|
+
) {
|
|
94
116
|
// Single compressed message
|
|
95
117
|
assert(
|
|
96
118
|
this.activeBatch === false,
|
|
97
119
|
0x4ba /* shouldn't receive compressed message in middle of a batch */,
|
|
98
120
|
);
|
|
99
121
|
|
|
100
|
-
const contents = IsoBuffer.from(
|
|
122
|
+
const contents = IsoBuffer.from(
|
|
123
|
+
(message.contents as IPackedContentsContents).packedContents,
|
|
124
|
+
"base64",
|
|
125
|
+
);
|
|
101
126
|
const decompressedMessage = decompress(contents);
|
|
102
127
|
const intoString = new TextDecoder().decode(decompressedMessage);
|
|
103
128
|
const asObj = JSON.parse(intoString);
|
|
@@ -135,16 +160,19 @@ export class OpDecompressor {
|
|
|
135
160
|
message.contents !== null &&
|
|
136
161
|
typeof message.contents === "object" &&
|
|
137
162
|
Object.keys(message.contents).length === 1 &&
|
|
138
|
-
message.contents
|
|
139
|
-
|
|
140
|
-
message.contents.packedContents.length > 0 &&
|
|
141
|
-
IsoBuffer.from(
|
|
142
|
-
message.contents.packedContents
|
|
163
|
+
typeof (message.contents as { packedContents?: unknown }).packedContents ===
|
|
164
|
+
"string" &&
|
|
165
|
+
(message.contents as IPackedContentsContents).packedContents.length > 0 &&
|
|
166
|
+
IsoBuffer.from(
|
|
167
|
+
(message.contents as IPackedContentsContents).packedContents,
|
|
168
|
+
"base64",
|
|
169
|
+
).toString("base64") ===
|
|
170
|
+
(message.contents as IPackedContentsContents).packedContents
|
|
143
171
|
) {
|
|
144
172
|
this.logger.sendTelemetryEvent({
|
|
145
173
|
eventName: "LegacyCompression",
|
|
146
174
|
type: message.type,
|
|
147
|
-
batch: message.metadata?.batch,
|
|
175
|
+
batch: (message.metadata as IBatchMetadata | undefined)?.batch,
|
|
148
176
|
});
|
|
149
177
|
return true;
|
|
150
178
|
}
|
|
@@ -164,5 +192,7 @@ const newMessage = (
|
|
|
164
192
|
...originalMessage,
|
|
165
193
|
contents,
|
|
166
194
|
compression: undefined,
|
|
167
|
-
|
|
195
|
+
// TODO: It should already be the case that we're not modifying any metadata, not clear if/why this shallow clone should be required.
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
197
|
+
metadata: { ...(originalMessage.metadata as any) },
|
|
168
198
|
});
|
|
@@ -3,19 +3,33 @@
|
|
|
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";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Grouping makes assumptions about the shape of message contents. This interface codifies those assumptions, but does not validate them.
|
|
13
|
+
*/
|
|
14
|
+
interface IGroupedBatchMessageContents {
|
|
15
|
+
type: typeof OpGroupingManager.groupedBatchOp;
|
|
16
|
+
contents: IGroupedMessage[];
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
interface IGroupedMessage {
|
|
12
20
|
contents?: unknown;
|
|
13
21
|
metadata?: Record<string, unknown>;
|
|
14
22
|
compression?: string;
|
|
15
23
|
}
|
|
16
24
|
|
|
25
|
+
function isGroupContents(
|
|
26
|
+
opContents: IGroupedBatchMessageContents | { type?: unknown } | undefined,
|
|
27
|
+
): opContents is IGroupedBatchMessageContents {
|
|
28
|
+
return opContents?.type === OpGroupingManager.groupedBatchOp;
|
|
29
|
+
}
|
|
30
|
+
|
|
17
31
|
export class OpGroupingManager {
|
|
18
|
-
static groupedBatchOp = "groupedBatch";
|
|
32
|
+
static readonly groupedBatchOp = "groupedBatch";
|
|
19
33
|
|
|
20
34
|
constructor(private readonly groupedBatchingEnabled: boolean) {}
|
|
21
35
|
|
|
@@ -25,10 +39,6 @@ export class OpGroupingManager {
|
|
|
25
39
|
}
|
|
26
40
|
|
|
27
41
|
for (const message of batch.content) {
|
|
28
|
-
// Blob attaches cannot be grouped (grouped batching would hide metadata)
|
|
29
|
-
if (message.type === ContainerMessageType.BlobAttach) {
|
|
30
|
-
return batch;
|
|
31
|
-
}
|
|
32
42
|
if (message.metadata) {
|
|
33
43
|
const keys = Object.keys(message.metadata);
|
|
34
44
|
assert(keys.length < 2, 0x5dd /* cannot group ops with metadata */);
|
|
@@ -64,11 +74,11 @@ export class OpGroupingManager {
|
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
public ungroupOp(op: ISequencedDocumentMessage): ISequencedDocumentMessage[] {
|
|
67
|
-
if (op.contents
|
|
77
|
+
if (!isGroupContents(op.contents)) {
|
|
68
78
|
return [op];
|
|
69
79
|
}
|
|
70
80
|
|
|
71
|
-
const messages = op.contents.contents
|
|
81
|
+
const messages = op.contents.contents;
|
|
72
82
|
let fakeCsn = 1;
|
|
73
83
|
return messages.map((subMessage) => ({
|
|
74
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 {
|
|
@@ -52,7 +53,9 @@ export class OpSplitter {
|
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
// TODO: Verify whether this should be able to handle server-generated ops (with null clientId)
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
58
|
+
const clientId = message.clientId as string;
|
|
56
59
|
const chunkedContent = message.contents as IChunkedOp;
|
|
57
60
|
this.addChunk(clientId, chunkedContent, message);
|
|
58
61
|
|