@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
|
@@ -12,12 +12,11 @@ import {
|
|
|
12
12
|
ISummarizeResult,
|
|
13
13
|
ISummaryTreeWithStats,
|
|
14
14
|
} from "@fluidframework/runtime-definitions";
|
|
15
|
-
import { mergeStats,
|
|
16
|
-
import {
|
|
17
|
-
import { GCVersion, IGCStats } from "./gcDefinitions";
|
|
18
|
-
import {
|
|
15
|
+
import { mergeStats, SummaryTreeBuilder } from "@fluidframework/runtime-utils";
|
|
16
|
+
import { IRefreshSummaryResult } from "../summary";
|
|
17
|
+
import { GCVersion, IGarbageCollectorConfigs, IGCStats } from "./gcDefinitions";
|
|
18
|
+
import { generateSortedGCState } from "./gcHelpers";
|
|
19
19
|
import { IGarbageCollectionSnapshotData, IGarbageCollectionState } from "./gcSummaryDefinitions";
|
|
20
|
-
import { IGarbageCollectorConfigs } from ".";
|
|
21
20
|
|
|
22
21
|
export const gcStateBlobKey = `${gcBlobPrefix}_root`;
|
|
23
22
|
|
|
@@ -264,72 +263,27 @@ export class GCSummaryStateTracker {
|
|
|
264
263
|
}
|
|
265
264
|
|
|
266
265
|
/**
|
|
267
|
-
* Called to refresh the latest summary state. This happens when either a pending summary is acked
|
|
268
|
-
* is downloaded and should be used to update the state.
|
|
266
|
+
* Called to refresh the latest summary state. This happens when either a pending summary is acked.
|
|
269
267
|
*/
|
|
270
|
-
public async refreshLatestSummary(
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
readAndParseBlob: ReadAndParseBlob,
|
|
274
|
-
): Promise<IGarbageCollectionSnapshotData | undefined> {
|
|
275
|
-
// If the latest summary was updated and the summary was tracked, this client is the one that generated this
|
|
276
|
-
// summary. So, update wasGCRunInLatestSummary.
|
|
277
|
-
// Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
|
|
278
|
-
// true in scenarios where GC is disabled but enabled in the snapshot we loaded from.
|
|
279
|
-
if (result.latestSummaryUpdated && result.wasSummaryTracked) {
|
|
280
|
-
this.wasGCRunInLatestSummary = this.configs.shouldRunGC;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (!result.latestSummaryUpdated || !this.configs.shouldRunGC) {
|
|
284
|
-
return undefined;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// If the summary was tracked by this client, it was the one that generated the summary in the first place.
|
|
288
|
-
// Update latest state from pending.
|
|
289
|
-
if (result.wasSummaryTracked) {
|
|
290
|
-
this.latestSummaryGCVersion = this.configs.gcVersionInEffect;
|
|
291
|
-
this.latestSummaryData = this.pendingSummaryData;
|
|
292
|
-
this.pendingSummaryData = undefined;
|
|
293
|
-
this.updatedDSCountSinceLastSummary = 0;
|
|
294
|
-
return undefined;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// If the summary was not tracked by this client, the state should be updated from the downloaded snapshot.
|
|
298
|
-
const snapshotTree = result.snapshotTree;
|
|
299
|
-
const metadataBlobId = snapshotTree.blobs[metadataBlobName];
|
|
300
|
-
const metadata = metadataBlobId
|
|
301
|
-
? await readAndParseBlob<IContainerRuntimeMetadata>(metadataBlobId)
|
|
302
|
-
: undefined;
|
|
303
|
-
this.latestSummaryGCVersion = getGCVersion(metadata);
|
|
304
|
-
|
|
305
|
-
const gcSnapshotTree = snapshotTree.trees[gcTreeKey];
|
|
306
|
-
// If GC ran in the container that generated this snapshot, it will have a GC tree.
|
|
307
|
-
this.wasGCRunInLatestSummary = gcSnapshotTree !== undefined;
|
|
308
|
-
|
|
309
|
-
if (gcSnapshotTree === undefined) {
|
|
310
|
-
return undefined;
|
|
268
|
+
public async refreshLatestSummary(result: IRefreshSummaryResult): Promise<void> {
|
|
269
|
+
if (!result.isSummaryTracked) {
|
|
270
|
+
return;
|
|
311
271
|
}
|
|
312
272
|
|
|
313
|
-
|
|
273
|
+
// If the summary is tracked, this client is the one that generated it. So, update wasGCRunInLatestSummary.
|
|
274
|
+
// Note that this has to be updated if GC did not run too. Otherwise, `gcStateNeedsReset` will always return
|
|
275
|
+
// true in scenarios where GC is currently disabled but enabled in the snapshot we loaded from.
|
|
276
|
+
this.wasGCRunInLatestSummary = this.configs.shouldRunGC;
|
|
314
277
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
// because irrespective of GC versions, these nodes have been deleted and cannot be brought back. The
|
|
318
|
-
// deletedNodes info is needed to identify when these nodes are used.
|
|
319
|
-
if (getGCVersion(metadata) !== this.configs.gcVersionInEffect) {
|
|
320
|
-
snapshotData = {
|
|
321
|
-
gcState: undefined,
|
|
322
|
-
tombstones: undefined,
|
|
323
|
-
deletedNodes: snapshotData.deletedNodes,
|
|
324
|
-
};
|
|
278
|
+
if (!this.configs.shouldRunGC) {
|
|
279
|
+
return;
|
|
325
280
|
}
|
|
326
281
|
|
|
327
|
-
this.
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
return snapshotData;
|
|
282
|
+
this.latestSummaryGCVersion = this.configs.gcVersionInEffect;
|
|
283
|
+
this.latestSummaryData = this.pendingSummaryData;
|
|
284
|
+
this.pendingSummaryData = undefined;
|
|
285
|
+
this.updatedDSCountSinceLastSummary = 0;
|
|
286
|
+
return;
|
|
333
287
|
}
|
|
334
288
|
|
|
335
289
|
/**
|
package/src/gc/gcTelemetry.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { ITelemetryGenericEvent } from "@fluidframework/
|
|
6
|
+
import { ITelemetryGenericEvent } from "@fluidframework/core-interfaces";
|
|
7
7
|
import { IGarbageCollectionData } from "@fluidframework/runtime-definitions";
|
|
8
|
-
import { packagePathToTelemetryProperty } from "@fluidframework/runtime-utils";
|
|
9
8
|
import {
|
|
10
9
|
generateStack,
|
|
11
10
|
ITelemetryLoggerExt,
|
|
12
11
|
MonitoringContext,
|
|
12
|
+
tagCodeArtifacts,
|
|
13
13
|
} from "@fluidframework/telemetry-utils";
|
|
14
14
|
import { ICreateContainerMetadata } from "../summary";
|
|
15
15
|
import {
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
runSweepKey,
|
|
24
24
|
} from "./gcDefinitions";
|
|
25
25
|
import { UnreferencedStateTracker } from "./gcUnreferencedStateTracker";
|
|
26
|
-
import { tagAsCodeArtifact } from "./gcHelpers";
|
|
27
26
|
|
|
28
27
|
type NodeUsageType = "Changed" | "Loaded" | "Revived";
|
|
29
28
|
|
|
@@ -161,7 +160,6 @@ export class GCTelemetryTracker {
|
|
|
161
160
|
const { usageType, currentReferenceTimestampMs, packagePath, id, fromId, ...propsToLog } =
|
|
162
161
|
nodeUsageProps;
|
|
163
162
|
const eventProps: Omit<IUnreferencedEventProps, "state" | "usageType"> = {
|
|
164
|
-
id: tagAsCodeArtifact(id),
|
|
165
163
|
type: nodeType,
|
|
166
164
|
unrefTime: nodeStateTracker.unreferencedTimestampMs,
|
|
167
165
|
age:
|
|
@@ -171,7 +169,7 @@ export class GCTelemetryTracker {
|
|
|
171
169
|
state === UnreferencedState.Inactive
|
|
172
170
|
? this.configs.inactiveTimeoutMs
|
|
173
171
|
: this.configs.sweepTimeoutMs,
|
|
174
|
-
|
|
172
|
+
...tagCodeArtifacts({ id, fromId }),
|
|
175
173
|
...propsToLog,
|
|
176
174
|
...this.createContainerMetadata,
|
|
177
175
|
};
|
|
@@ -184,7 +182,7 @@ export class GCTelemetryTracker {
|
|
|
184
182
|
{
|
|
185
183
|
eventName: `GC_Tombstone_${nodeType}_Revived`,
|
|
186
184
|
category: "generic",
|
|
187
|
-
url:
|
|
185
|
+
...tagCodeArtifacts({ url: id }),
|
|
188
186
|
gcTombstoneEnforcementAllowed: this.gcTombstoneEnforcementAllowed,
|
|
189
187
|
},
|
|
190
188
|
undefined /* packagePath */,
|
|
@@ -211,7 +209,7 @@ export class GCTelemetryTracker {
|
|
|
211
209
|
const { id: taggedId, fromId: taggedFromId, ...otherProps } = eventProps;
|
|
212
210
|
const event = {
|
|
213
211
|
eventName: `${state}Object_${nodeUsageProps.usageType}`,
|
|
214
|
-
pkg:
|
|
212
|
+
pkg: tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join("/") }).pkg,
|
|
215
213
|
stack: generateStack(),
|
|
216
214
|
id: taggedId,
|
|
217
215
|
fromId: taggedFromId,
|
|
@@ -277,8 +275,10 @@ export class GCTelemetryTracker {
|
|
|
277
275
|
if (missingExplicitRoutes.length > 0) {
|
|
278
276
|
logger.sendErrorEvent({
|
|
279
277
|
eventName: "gcUnknownOutboundReferences",
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
...tagCodeArtifacts({
|
|
279
|
+
id: nodeId,
|
|
280
|
+
routes: JSON.stringify(missingExplicitRoutes),
|
|
281
|
+
}),
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
}
|
|
@@ -318,8 +318,10 @@ export class GCTelemetryTracker {
|
|
|
318
318
|
}),
|
|
319
319
|
id,
|
|
320
320
|
fromId,
|
|
321
|
-
|
|
322
|
-
|
|
321
|
+
...tagCodeArtifacts({
|
|
322
|
+
pkg: pkg?.join("/"),
|
|
323
|
+
fromPkg: fromPkg?.join("/"),
|
|
324
|
+
}),
|
|
323
325
|
};
|
|
324
326
|
|
|
325
327
|
if (state === UnreferencedState.Inactive) {
|
|
@@ -379,7 +381,7 @@ export class GCTelemetryTracker {
|
|
|
379
381
|
lastSummaryTime,
|
|
380
382
|
...this.createContainerMetadata,
|
|
381
383
|
}),
|
|
382
|
-
id:
|
|
384
|
+
...tagCodeArtifacts({ id: JSON.stringify(deletedNodeIds) }),
|
|
383
385
|
});
|
|
384
386
|
}
|
|
385
387
|
}
|
|
@@ -398,7 +400,7 @@ export function sendGCUnexpectedUsageEvent(
|
|
|
398
400
|
packagePath: readonly string[] | undefined,
|
|
399
401
|
error?: unknown,
|
|
400
402
|
) {
|
|
401
|
-
event.pkg =
|
|
403
|
+
event.pkg = tagCodeArtifacts({ pkg: packagePath?.join("/") })?.pkg;
|
|
402
404
|
event.tombstoneFlags = JSON.stringify({
|
|
403
405
|
DisableTombstone: mc.config.getBoolean(disableTombstoneKey),
|
|
404
406
|
ThrowOnTombstoneUsage: mc.config.getBoolean(throwOnTombstoneUsageKey),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { assert, Timer } from "@fluidframework/
|
|
6
|
+
import { assert, Timer } from "@fluidframework/core-utils";
|
|
7
7
|
import { UnreferencedState } from "./gcDefinitions";
|
|
8
8
|
|
|
9
9
|
/** A wrapper around common-utils Timer that requires the timeout when calling start/restart */
|
package/src/gc/index.ts
CHANGED
|
@@ -29,8 +29,8 @@ export {
|
|
|
29
29
|
runSessionExpiryKey,
|
|
30
30
|
runSweepKey,
|
|
31
31
|
stableGCVersion,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
disableAttachmentBlobSweepKey,
|
|
33
|
+
disableDatastoreSweepKey,
|
|
34
34
|
throwOnTombstoneLoadKey,
|
|
35
35
|
throwOnTombstoneUsageKey,
|
|
36
36
|
UnreferencedState,
|
|
@@ -38,12 +38,10 @@ export {
|
|
|
38
38
|
export {
|
|
39
39
|
cloneGCData,
|
|
40
40
|
concatGarbageCollectionStates,
|
|
41
|
-
getGCDataFromSnapshot,
|
|
42
41
|
shouldAllowGcTombstoneEnforcement,
|
|
43
42
|
shouldAllowGcSweep,
|
|
44
43
|
trimLeadingAndTrailingSlashes,
|
|
45
44
|
unpackChildNodesGCDetails,
|
|
46
|
-
tagAsCodeArtifact,
|
|
47
45
|
} from "./gcHelpers";
|
|
48
46
|
export { runGarbageCollection } from "./gcReferenceGraphAlgorithm";
|
|
49
47
|
export {
|
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/* eslint-disable tsdoc/syntax */
|
|
6
7
|
/* eslint-disable no-bitwise */
|
|
7
|
-
|
|
8
|
-
import { assert } from "@fluidframework/common-utils";
|
|
9
|
-
import { fail } from "./utils";
|
|
8
|
+
import { assert } from "@fluidframework/core-utils";
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* A map in which entries are always added in key-sorted order.
|
|
@@ -133,7 +132,7 @@ export class AppendOnlySortedMap<K, V> {
|
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
/**
|
|
136
|
-
* Adds a new key/value pair to the map. `key` must be
|
|
135
|
+
* Adds a new key/value pair to the map. `key` must be > to all keys in the map.
|
|
137
136
|
* @param key - the key to add.
|
|
138
137
|
* @param value - the value to add.
|
|
139
138
|
*/
|
|
@@ -141,7 +140,27 @@ export class AppendOnlySortedMap<K, V> {
|
|
|
141
140
|
const { elements } = this;
|
|
142
141
|
const { length } = elements;
|
|
143
142
|
if (length !== 0 && this.comparator(key, this.maxKey() as K) <= 0) {
|
|
144
|
-
|
|
143
|
+
throw new Error("Inserted key must be > all others in the map.");
|
|
144
|
+
}
|
|
145
|
+
elements.push(key);
|
|
146
|
+
elements.push(value);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Replaces the last key/value pair with the given one. If the map is empty, it simply appends.
|
|
151
|
+
* `key` must be > to all keys in the map prior to the one replaced.
|
|
152
|
+
* @param key - the key to add.
|
|
153
|
+
* @param value - the value to add.
|
|
154
|
+
*/
|
|
155
|
+
public replaceLast(key: K, value: V): void {
|
|
156
|
+
const { elements, comparator } = this;
|
|
157
|
+
const { length } = elements;
|
|
158
|
+
if (length !== 0) {
|
|
159
|
+
elements.pop();
|
|
160
|
+
elements.pop();
|
|
161
|
+
if (comparator(key, this.maxKey() as K) <= 0) {
|
|
162
|
+
throw new Error("Inserted key must be > all others in the map.");
|
|
163
|
+
}
|
|
145
164
|
}
|
|
146
165
|
elements.push(key);
|
|
147
166
|
elements.push(value);
|
|
@@ -217,7 +236,7 @@ export class AppendOnlySortedMap<K, V> {
|
|
|
217
236
|
if (prev !== undefined) {
|
|
218
237
|
assert(
|
|
219
238
|
this.comparator(kv[0], prev[0]) > 0,
|
|
220
|
-
|
|
239
|
+
0x752 /* Keys in map must be sorted. */,
|
|
221
240
|
);
|
|
222
241
|
}
|
|
223
242
|
prev = kv;
|
|
@@ -338,90 +357,10 @@ export class AppendOnlySortedMap<K, V> {
|
|
|
338
357
|
} else if (c === 0) {
|
|
339
358
|
return keyIndex;
|
|
340
359
|
} else {
|
|
341
|
-
|
|
360
|
+
throw new Error("Invalid comparator.");
|
|
342
361
|
}
|
|
343
362
|
mid = (low + high) >> 1;
|
|
344
363
|
}
|
|
345
364
|
return (mid * 2) ^ AppendOnlySortedMap.failureXor;
|
|
346
365
|
}
|
|
347
366
|
}
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* A map in which entries are always added in both key-sorted and value-sorted order.
|
|
351
|
-
* Supports appending and searching.
|
|
352
|
-
*/
|
|
353
|
-
export class AppendOnlyDoublySortedMap<K, V, S> extends AppendOnlySortedMap<K, V> {
|
|
354
|
-
public constructor(
|
|
355
|
-
keyComparator: (a: K, b: K) => number,
|
|
356
|
-
private readonly extractSearchValue: (value: V) => S,
|
|
357
|
-
private readonly valueComparator: (search: S, value: S) => number,
|
|
358
|
-
) {
|
|
359
|
-
super(keyComparator);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
public override append(key: K, value: V): void {
|
|
363
|
-
if (
|
|
364
|
-
this.elements.length !== 0 &&
|
|
365
|
-
this.valueComparator(
|
|
366
|
-
this.extractSearchValue(value),
|
|
367
|
-
this.extractSearchValue(this.maxValue() as V),
|
|
368
|
-
) <= 0
|
|
369
|
-
) {
|
|
370
|
-
fail("Inserted value must be > all others in the map.");
|
|
371
|
-
}
|
|
372
|
-
super.append(key, value);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
private readonly compareValues = (search: S, _: K, value: V): number => {
|
|
376
|
-
return this.valueComparator(search, this.extractSearchValue(value));
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// /**
|
|
380
|
-
// * @param value - the value to lookup.
|
|
381
|
-
// * @returns the key associated with `value` if such an entry exists, and undefined otherwise.
|
|
382
|
-
// */
|
|
383
|
-
// public getByValue(value: S): K | undefined {
|
|
384
|
-
// const index = AppendOnlySortedMap.keyIndexOf(this.elements, value, this.compareValues);
|
|
385
|
-
// return this.elements[index]?.[0];
|
|
386
|
-
// }
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* @param searchValue - the search value to lookup.
|
|
390
|
-
* @returns the entry who's value, when run through the extractor provided to the constructor, matches
|
|
391
|
-
* `searchValue`. If no such entry exists, this method returns the next lower entry as determined by the value
|
|
392
|
-
* comparator provided to the constructor. If no such entry exists, this method returns undefined.
|
|
393
|
-
*/
|
|
394
|
-
public getPairOrNextLowerByValue(searchValue: S): readonly [K, V] | undefined {
|
|
395
|
-
return this.getPairOrNextLowerBy(searchValue, this.compareValues);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
/**
|
|
399
|
-
* @param searchValue - the search value to lookup.
|
|
400
|
-
* @returns the entry who's value, when run through the extractor provided to the constructor, matches `searchValue`. If no such entry
|
|
401
|
-
* exists, this method returns the next higher entry as determined by the value comparator provided to the constructor. If no such entry
|
|
402
|
-
* exists, this method returns undefined.
|
|
403
|
-
*/
|
|
404
|
-
public getPairOrNextHigherByValue(searchValue: S): readonly [K, V] | undefined {
|
|
405
|
-
return this.getPairOrNextHigherBy(searchValue, this.compareValues);
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Test-only expensive assertions to check the internal validity of the data structure.
|
|
410
|
-
*/
|
|
411
|
-
public override assertValid(): void {
|
|
412
|
-
super.assertValid();
|
|
413
|
-
let prev: readonly [unknown, V] | undefined;
|
|
414
|
-
for (const kv of this.entries()) {
|
|
415
|
-
if (prev !== undefined) {
|
|
416
|
-
assert(
|
|
417
|
-
this.valueComparator(
|
|
418
|
-
this.extractSearchValue(kv[1]),
|
|
419
|
-
this.extractSearchValue(prev[1]),
|
|
420
|
-
) > 0,
|
|
421
|
-
0x480 /* Values in map must be sorted. */,
|
|
422
|
-
);
|
|
423
|
-
}
|
|
424
|
-
prev = kv;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { assert } from "@fluidframework/core-utils";
|
|
7
|
+
import { IdCluster, clustersEqual, lastAllocatedFinal, lastFinalizedFinal } from "./sessions";
|
|
8
|
+
import { FinalCompressedId } from "./identifiers";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* All IDs that have been finalized (acked), grouped into clusters sorted by their base final IDs.
|
|
12
|
+
* These clusters span the positive integer space and are not sparse, meaning a cluster's base final
|
|
13
|
+
* ID will always be one greater than the last final ID in the previous cluster (or 0 if there is not one).
|
|
14
|
+
*/
|
|
15
|
+
export class FinalSpace {
|
|
16
|
+
private readonly clusterList: IdCluster[] = [];
|
|
17
|
+
|
|
18
|
+
public get clusters(): readonly IdCluster[] {
|
|
19
|
+
return this.clusterList;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public getLastCluster(): IdCluster | undefined {
|
|
23
|
+
return this.clusterList[this.clusterList.length - 1];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public addCluster(newCluster: IdCluster) {
|
|
27
|
+
const lastCluster = this.getLastCluster();
|
|
28
|
+
assert(
|
|
29
|
+
lastCluster === undefined ||
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
31
|
+
newCluster.baseFinalId === lastCluster.baseFinalId + lastCluster.capacity,
|
|
32
|
+
0x753 /* Cluster insert to final_space is out of order. */,
|
|
33
|
+
);
|
|
34
|
+
this.clusterList.push(newCluster);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @returns the upper bound (exclusive) of finalized IDs in final space, i.e. one greater than the last final ID in the last cluster.
|
|
39
|
+
* Note: this does not include allocated but unfinalized space in clusters.
|
|
40
|
+
*/
|
|
41
|
+
public getFinalizedIdLimit(): FinalCompressedId {
|
|
42
|
+
const lastCluster = this.getLastCluster();
|
|
43
|
+
return lastCluster === undefined
|
|
44
|
+
? (0 as FinalCompressedId)
|
|
45
|
+
: (((lastFinalizedFinal(lastCluster) as number) + 1) as FinalCompressedId);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* @returns the upper bound (exclusive) of allocated IDs in final space, i.e. one greater than the last final ID in the last cluster.
|
|
50
|
+
* Note: this does includes all allocated IDs in clusters.
|
|
51
|
+
*/
|
|
52
|
+
public getAllocatedIdLimit(): FinalCompressedId {
|
|
53
|
+
const lastCluster = this.getLastCluster();
|
|
54
|
+
return lastCluster === undefined
|
|
55
|
+
? (0 as FinalCompressedId)
|
|
56
|
+
: (((lastAllocatedFinal(lastCluster) as number) + 1) as FinalCompressedId);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public equals(other: FinalSpace): boolean {
|
|
60
|
+
for (let i = 0; i < this.clusterList.length; i++) {
|
|
61
|
+
if (!clustersEqual(this.clusterList[i], other.clusterList[i])) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return this.clusterList.length === other.clusterList.length;
|
|
66
|
+
}
|
|
67
|
+
}
|