@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
package/dist/blobManager.js
CHANGED
|
@@ -7,10 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.BlobManager = exports.BlobHandle = void 0;
|
|
8
8
|
const uuid_1 = require("uuid");
|
|
9
9
|
const runtime_utils_1 = require("@fluidframework/runtime-utils");
|
|
10
|
-
const
|
|
10
|
+
const core_utils_1 = require("@fluidframework/core-utils");
|
|
11
|
+
const client_utils_1 = require("@fluid-internal/client-utils");
|
|
11
12
|
const container_definitions_1 = require("@fluidframework/container-definitions");
|
|
12
13
|
const telemetry_utils_1 = require("@fluidframework/telemetry-utils");
|
|
13
|
-
const container_utils_1 = require("@fluidframework/container-utils");
|
|
14
14
|
const containerRuntime_1 = require("./containerRuntime");
|
|
15
15
|
const gc_1 = require("./gc");
|
|
16
16
|
const throttler_1 = require("./throttler");
|
|
@@ -23,10 +23,11 @@ const summary_1 = require("./summary");
|
|
|
23
23
|
* and loads blob.
|
|
24
24
|
*/
|
|
25
25
|
class BlobHandle {
|
|
26
|
-
constructor(path, routeContext, get) {
|
|
26
|
+
constructor(path, routeContext, get, onAttachGraph) {
|
|
27
27
|
this.path = path;
|
|
28
28
|
this.routeContext = routeContext;
|
|
29
29
|
this.get = get;
|
|
30
|
+
this.onAttachGraph = onAttachGraph;
|
|
30
31
|
this.attached = false;
|
|
31
32
|
this.absolutePath = (0, runtime_utils_1.generateHandleContextPath)(path, this.routeContext);
|
|
32
33
|
}
|
|
@@ -37,7 +38,10 @@ class BlobHandle {
|
|
|
37
38
|
return this.routeContext.isAttached && this.attached;
|
|
38
39
|
}
|
|
39
40
|
attachGraph() {
|
|
40
|
-
this.attached
|
|
41
|
+
if (!this.attached) {
|
|
42
|
+
this.attached = true;
|
|
43
|
+
this.onAttachGraph?.();
|
|
44
|
+
}
|
|
41
45
|
}
|
|
42
46
|
bind(handle) {
|
|
43
47
|
throw new Error("Cannot bind to blob handle");
|
|
@@ -47,7 +51,7 @@ exports.BlobHandle = BlobHandle;
|
|
|
47
51
|
class CancellableThrottler {
|
|
48
52
|
constructor(throttler) {
|
|
49
53
|
this.throttler = throttler;
|
|
50
|
-
this.cancelP = new
|
|
54
|
+
this.cancelP = new core_utils_1.Deferred();
|
|
51
55
|
}
|
|
52
56
|
async getDelay() {
|
|
53
57
|
return Promise.race([
|
|
@@ -57,19 +61,10 @@ class CancellableThrottler {
|
|
|
57
61
|
}
|
|
58
62
|
cancel() {
|
|
59
63
|
this.cancelP.resolve();
|
|
60
|
-
this.cancelP = new
|
|
64
|
+
this.cancelP = new core_utils_1.Deferred();
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
|
|
64
|
-
// expect blobs to be uploaded before we actually see the op round-trip
|
|
65
|
-
var PendingBlobStatus;
|
|
66
|
-
(function (PendingBlobStatus) {
|
|
67
|
-
PendingBlobStatus[PendingBlobStatus["OnlinePendingUpload"] = 0] = "OnlinePendingUpload";
|
|
68
|
-
PendingBlobStatus[PendingBlobStatus["OnlinePendingOp"] = 1] = "OnlinePendingOp";
|
|
69
|
-
PendingBlobStatus[PendingBlobStatus["OfflinePendingUpload"] = 2] = "OfflinePendingUpload";
|
|
70
|
-
PendingBlobStatus[PendingBlobStatus["OfflinePendingOp"] = 3] = "OfflinePendingOp";
|
|
71
|
-
})(PendingBlobStatus || (PendingBlobStatus = {}));
|
|
72
|
-
class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
67
|
+
class BlobManager extends client_utils_1.TypedEventEmitter {
|
|
73
68
|
constructor(routeContext, snapshot, getStorage,
|
|
74
69
|
/**
|
|
75
70
|
* Submit a BlobAttach op. When a blob is uploaded, there is a short grace period before which the blob is
|
|
@@ -96,9 +91,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
96
91
|
this.runtime = runtime;
|
|
97
92
|
this.closeContainer = closeContainer;
|
|
98
93
|
/**
|
|
99
|
-
* Blobs which
|
|
100
|
-
* Until we see the op round-trip, there is a possibility we may need to re-upload the blob, so
|
|
101
|
-
* we must save it. This is true for both the online and offline flow.
|
|
94
|
+
* Blobs which we have not yet seen a BlobAttach op round-trip and not yet attached to a DDS.
|
|
102
95
|
*/
|
|
103
96
|
this.pendingBlobs = new Map();
|
|
104
97
|
/**
|
|
@@ -116,98 +109,107 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
116
109
|
* Tombstone is a temporary feature that imitates a blob getting swept by garbage collection.
|
|
117
110
|
*/
|
|
118
111
|
this.tombstonedBlobs = new Set();
|
|
119
|
-
this.mc = (0, telemetry_utils_1.
|
|
112
|
+
this.mc = (0, telemetry_utils_1.createChildMonitoringContext)({
|
|
113
|
+
logger: this.runtime.logger,
|
|
114
|
+
namespace: "BlobManager",
|
|
115
|
+
});
|
|
120
116
|
// Read the feature flag that tells whether to throw when a tombstone blob is requested.
|
|
121
117
|
this.throwOnTombstoneLoad =
|
|
122
118
|
this.mc.config.getBoolean(gc_1.throwOnTombstoneLoadKey) === true &&
|
|
123
119
|
this.runtime.gcTombstoneEnforcementAllowed &&
|
|
124
120
|
this.runtime.clientDetails.type !== summary_1.summarizerClientType;
|
|
125
|
-
this.runtime.on("disconnected", () => this.onDisconnected());
|
|
126
121
|
this.redirectTable = this.load(snapshot);
|
|
127
122
|
// Begin uploading stashed blobs from previous container instance
|
|
128
123
|
Object.entries(stashedBlobs).forEach(([localId, entry]) => {
|
|
129
|
-
const blob = (0,
|
|
124
|
+
const blob = (0, client_utils_1.stringToBuffer)(entry.blob, "base64");
|
|
125
|
+
const attached = entry.attached;
|
|
126
|
+
const acked = entry.acked;
|
|
127
|
+
const storageId = entry.storageId; // entry.storageId = response.id
|
|
130
128
|
if (entry.minTTLInSeconds && entry.uploadTime) {
|
|
131
129
|
const timeLapseSinceLocalUpload = (Date.now() - entry.uploadTime) / 1000;
|
|
132
130
|
// stashed entries with more than half-life in storage will not be reuploaded
|
|
133
131
|
if (entry.minTTLInSeconds - timeLapseSinceLocalUpload > entry.minTTLInSeconds / 2) {
|
|
134
132
|
this.pendingBlobs.set(localId, {
|
|
135
133
|
blob,
|
|
136
|
-
|
|
137
|
-
|
|
134
|
+
uploading: false,
|
|
135
|
+
opsent: true,
|
|
136
|
+
handleP: new core_utils_1.Deferred(),
|
|
137
|
+
storageId,
|
|
138
138
|
uploadP: undefined,
|
|
139
139
|
uploadTime: entry.uploadTime,
|
|
140
140
|
minTTLInSeconds: entry.minTTLInSeconds,
|
|
141
|
+
attached,
|
|
142
|
+
acked,
|
|
141
143
|
});
|
|
142
144
|
return;
|
|
143
145
|
}
|
|
144
146
|
}
|
|
145
147
|
this.pendingBlobs.set(localId, {
|
|
146
148
|
blob,
|
|
147
|
-
|
|
148
|
-
handleP: new
|
|
149
|
+
uploading: true,
|
|
150
|
+
handleP: new core_utils_1.Deferred(),
|
|
149
151
|
uploadP: this.uploadBlob(localId, blob),
|
|
152
|
+
attached,
|
|
153
|
+
acked,
|
|
154
|
+
opsent: true,
|
|
150
155
|
});
|
|
151
156
|
});
|
|
152
157
|
this.sendBlobAttachOp = (localId, blobId) => {
|
|
153
158
|
const pendingEntry = this.pendingBlobs.get(localId);
|
|
154
|
-
|
|
159
|
+
(0, core_utils_1.assert)(pendingEntry !== undefined, 0x725 /* Must have pending blob entry for upcoming op */);
|
|
160
|
+
if (pendingEntry?.uploadTime && pendingEntry?.minTTLInSeconds) {
|
|
155
161
|
const secondsSinceUpload = (Date.now() - pendingEntry.uploadTime) / 1000;
|
|
156
162
|
const expired = pendingEntry.minTTLInSeconds - secondsSinceUpload < 0;
|
|
157
163
|
this.mc.logger.sendTelemetryEvent({
|
|
158
164
|
eventName: "sendBlobAttach",
|
|
159
|
-
entryStatus: pendingEntry.status,
|
|
160
165
|
secondsSinceUpload,
|
|
161
166
|
minTTLInSeconds: pendingEntry.minTTLInSeconds,
|
|
162
167
|
expired,
|
|
163
168
|
});
|
|
164
169
|
if (expired) {
|
|
165
170
|
// we want to avoid submitting ops with broken handles
|
|
166
|
-
this.closeContainer(new
|
|
171
|
+
this.closeContainer(new telemetry_utils_1.GenericError("Trying to submit a BlobAttach for expired blob", undefined, {
|
|
167
172
|
localId,
|
|
168
173
|
blobId,
|
|
169
|
-
entryStatus: pendingEntry.status,
|
|
170
174
|
secondsSinceUpload,
|
|
171
175
|
}));
|
|
172
176
|
}
|
|
173
177
|
}
|
|
178
|
+
pendingEntry.opsent = true;
|
|
174
179
|
return sendBlobAttachOp(localId, blobId);
|
|
175
180
|
};
|
|
176
181
|
}
|
|
177
|
-
get
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
+
get allBlobsAttached() {
|
|
183
|
+
for (const [, entry] of this.pendingBlobs) {
|
|
184
|
+
if (entry.attached === false) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return true;
|
|
182
189
|
}
|
|
183
190
|
get hasPendingBlobs() {
|
|
184
191
|
return ((this.runtime.attachState !== container_definitions_1.AttachState.Attached && this.redirectTable.size > 0) ||
|
|
185
192
|
this.pendingBlobs.size > 0);
|
|
186
193
|
}
|
|
194
|
+
createAbortError(pending) {
|
|
195
|
+
return new telemetry_utils_1.LoggingError("uploadBlob aborted", {
|
|
196
|
+
acked: pending?.acked,
|
|
197
|
+
uploadTime: pending?.uploadTime,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
187
200
|
/**
|
|
188
201
|
* Upload blobs added while offline. This must be completed before connecting and resubmitting ops.
|
|
189
202
|
*/
|
|
190
|
-
async
|
|
203
|
+
async processStashedChanges() {
|
|
191
204
|
this.retryThrottler.cancel();
|
|
192
|
-
const pendingUploads = this.
|
|
205
|
+
const pendingUploads = Array.from(this.pendingBlobs.values())
|
|
206
|
+
.filter((e) => e.uploading === true)
|
|
207
|
+
.map(async (e) => e.uploadP);
|
|
193
208
|
await telemetry_utils_1.PerformanceEvent.timedExecAsync(this.mc.logger, {
|
|
194
|
-
eventName: "
|
|
209
|
+
eventName: "BlobUploadProcessStashedChanges",
|
|
195
210
|
count: pendingUploads.length,
|
|
196
211
|
}, async () => Promise.all(pendingUploads), { start: true, end: true });
|
|
197
212
|
}
|
|
198
|
-
/**
|
|
199
|
-
* Transition online blobs waiting for BlobAttach op round-trip since we will not see the op until we are connected
|
|
200
|
-
* again
|
|
201
|
-
*/
|
|
202
|
-
onDisconnected() {
|
|
203
|
-
for (const [localId, entry] of this.pendingBlobs) {
|
|
204
|
-
if (entry.status === PendingBlobStatus.OnlinePendingOp) {
|
|
205
|
-
// This will submit another BlobAttach op for this blob. This is necessary because the one we sent
|
|
206
|
-
// already didn't have the local ID.
|
|
207
|
-
this.transitionToOffline(localId);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
213
|
/**
|
|
212
214
|
* Set of actual storage IDs (i.e., IDs that can be requested from storage). This will be empty if the container is
|
|
213
215
|
* detached or there are no (non-pending) attachment blobs in the document
|
|
@@ -218,7 +220,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
218
220
|
const undefinedValueInTable = ids.delete(undefined);
|
|
219
221
|
// For a detached container, entries are inserted into the redirect table with an undefined storage ID.
|
|
220
222
|
// For an attached container, entries are inserted w/storage ID after the BlobAttach op round-trips.
|
|
221
|
-
(0,
|
|
223
|
+
(0, core_utils_1.assert)(!undefinedValueInTable ||
|
|
222
224
|
(this.runtime.attachState === container_definitions_1.AttachState.Detached && ids.size === 0), 0x382 /* 'redirectTable' must contain only undefined while detached / defined values while attached */);
|
|
223
225
|
return ids;
|
|
224
226
|
}
|
|
@@ -232,14 +234,14 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
232
234
|
}
|
|
233
235
|
let storageId;
|
|
234
236
|
if (this.runtime.attachState === container_definitions_1.AttachState.Detached) {
|
|
235
|
-
(0,
|
|
237
|
+
(0, core_utils_1.assert)(this.redirectTable.has(blobId), 0x383 /* requesting unknown blobs */);
|
|
236
238
|
// Blobs created while the container is detached are stored in IDetachedBlobStorage.
|
|
237
239
|
// The 'IDocumentStorageService.readBlob()' call below will retrieve these via localId.
|
|
238
240
|
storageId = blobId;
|
|
239
241
|
}
|
|
240
242
|
else {
|
|
241
243
|
const attachedStorageId = this.redirectTable.get(blobId);
|
|
242
|
-
(0,
|
|
244
|
+
(0, core_utils_1.assert)(!!attachedStorageId, 0x11f /* "requesting unknown blobs" */);
|
|
243
245
|
storageId = attachedStorageId;
|
|
244
246
|
}
|
|
245
247
|
// Let runtime know that the corresponding GC node was requested.
|
|
@@ -249,8 +251,16 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
249
251
|
}, { end: true, cancel: "error" });
|
|
250
252
|
}
|
|
251
253
|
getBlobHandle(id) {
|
|
252
|
-
(0,
|
|
253
|
-
|
|
254
|
+
(0, core_utils_1.assert)(this.redirectTable.has(id) || this.pendingBlobs.has(id), 0x384 /* requesting handle for unknown blob */);
|
|
255
|
+
const pending = this.pendingBlobs.get(id);
|
|
256
|
+
const callback = pending
|
|
257
|
+
? () => {
|
|
258
|
+
pending.attached = true;
|
|
259
|
+
this.emit("blobAttached", pending);
|
|
260
|
+
this.deletePendingBlobMaybe(id);
|
|
261
|
+
}
|
|
262
|
+
: undefined;
|
|
263
|
+
return new BlobHandle(`${BlobManager.basePath}/${id}`, this.routeContext, async () => this.getBlob(id), callback);
|
|
254
264
|
}
|
|
255
265
|
async createBlobDetached(blob) {
|
|
256
266
|
// Blobs created while the container is detached are stored in IDetachedBlobStorage.
|
|
@@ -259,7 +269,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
259
269
|
this.setRedirection(response.id, undefined);
|
|
260
270
|
return this.getBlobHandle(response.id);
|
|
261
271
|
}
|
|
262
|
-
async createBlob(blob) {
|
|
272
|
+
async createBlob(blob, signal) {
|
|
263
273
|
if (this.runtime.attachState === container_definitions_1.AttachState.Detached) {
|
|
264
274
|
return this.createBlobDetached(blob);
|
|
265
275
|
}
|
|
@@ -268,18 +278,33 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
268
278
|
this.mc.logger.sendTelemetryEvent({ eventName: "CreateBlobWhileAttaching" });
|
|
269
279
|
await new Promise((resolve) => this.runtime.once("attached", resolve));
|
|
270
280
|
}
|
|
271
|
-
(0,
|
|
281
|
+
(0, core_utils_1.assert)(this.runtime.attachState === container_definitions_1.AttachState.Attached, 0x385 /* For clarity and paranoid defense against adding future attachment states */);
|
|
282
|
+
if (signal?.aborted) {
|
|
283
|
+
throw this.createAbortError();
|
|
284
|
+
}
|
|
272
285
|
// Create a local ID for the blob. After uploading it to storage and before returning it, a local ID to
|
|
273
286
|
// storage ID mapping is created.
|
|
274
287
|
const localId = (0, uuid_1.v4)();
|
|
275
288
|
const pendingEntry = {
|
|
276
289
|
blob,
|
|
277
|
-
|
|
278
|
-
handleP: new
|
|
290
|
+
uploading: true,
|
|
291
|
+
handleP: new core_utils_1.Deferred(),
|
|
279
292
|
uploadP: this.uploadBlob(localId, blob),
|
|
293
|
+
attached: false,
|
|
294
|
+
acked: false,
|
|
295
|
+
abortSignal: signal,
|
|
296
|
+
opsent: false,
|
|
280
297
|
};
|
|
281
298
|
this.pendingBlobs.set(localId, pendingEntry);
|
|
282
|
-
|
|
299
|
+
const abortListener = () => {
|
|
300
|
+
if (!pendingEntry.acked) {
|
|
301
|
+
pendingEntry.handleP.reject(this.createAbortError(pendingEntry));
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
signal?.addEventListener("abort", abortListener, { once: true });
|
|
305
|
+
return pendingEntry.handleP.promise.finally(() => {
|
|
306
|
+
signal?.removeEventListener("abort", abortListener);
|
|
307
|
+
});
|
|
283
308
|
}
|
|
284
309
|
async uploadBlob(localId, blob) {
|
|
285
310
|
return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "createBlob" }, async () => this.getStorage().createBlob(blob), { end: true, cancel: this.runtime.connected ? "error" : "generic" }).then((response) => this.onUploadResolve(localId, response), async (err) => this.onUploadReject(localId, err));
|
|
@@ -291,69 +316,62 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
291
316
|
setRedirection(fromId, toId) {
|
|
292
317
|
this.redirectTable.set(fromId, toId);
|
|
293
318
|
}
|
|
294
|
-
|
|
319
|
+
deletePendingBlobMaybe(id) {
|
|
295
320
|
if (this.pendingBlobs.has(id)) {
|
|
296
|
-
this.pendingBlobs.
|
|
297
|
-
if (
|
|
298
|
-
this.
|
|
321
|
+
const entry = this.pendingBlobs.get(id);
|
|
322
|
+
if (entry?.attached && entry?.acked) {
|
|
323
|
+
this.deletePendingBlob(id);
|
|
299
324
|
}
|
|
300
325
|
}
|
|
301
326
|
}
|
|
327
|
+
deletePendingBlob(id) {
|
|
328
|
+
if (this.pendingBlobs.delete(id) && !this.hasPendingBlobs) {
|
|
329
|
+
this.emit("noPendingBlobs");
|
|
330
|
+
}
|
|
331
|
+
}
|
|
302
332
|
onUploadResolve(localId, response) {
|
|
303
|
-
var _a;
|
|
304
333
|
const entry = this.pendingBlobs.get(localId);
|
|
305
|
-
(0,
|
|
306
|
-
|
|
307
|
-
|
|
334
|
+
(0, core_utils_1.assert)(entry !== undefined, 0x6c8 /* pending blob entry not found for uploaded blob */);
|
|
335
|
+
if (entry.abortSignal?.aborted === true && !entry.opsent) {
|
|
336
|
+
this.deletePendingBlob(localId);
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
(0, core_utils_1.assert)(entry.uploading === true, 0x386 /* Must have pending blob entry for uploaded blob */);
|
|
308
340
|
entry.storageId = response.id;
|
|
309
341
|
entry.uploadTime = Date.now();
|
|
310
342
|
entry.minTTLInSeconds = response.minTTLInSeconds;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
329
|
-
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
330
|
-
// blob alive in storage.
|
|
331
|
-
this.opsInFlight.set(response.id, ((_a = this.opsInFlight.get(response.id)) !== null && _a !== void 0 ? _a : []).concat(localId));
|
|
332
|
-
entry.status = PendingBlobStatus.OnlinePendingOp;
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
else if (entry.status === PendingBlobStatus.OfflinePendingUpload) {
|
|
336
|
-
// We already submitted a BlobAttach op for this blob when it was transitioned to offline flow
|
|
337
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
338
|
-
}
|
|
343
|
+
// Send a blob attach op. This serves two purposes:
|
|
344
|
+
// 1. If its a new blob, i.e., it isn't de-duped, the server will keep the blob alive if it sees this op
|
|
345
|
+
// until its storage ID is added to the next summary.
|
|
346
|
+
// 2. It will create a local ID to storage ID mapping in all clients which is needed to retrieve the
|
|
347
|
+
// blob from the server via the storage ID.
|
|
348
|
+
if (!entry.opsent) {
|
|
349
|
+
this.sendBlobAttachOp(localId, response.id);
|
|
350
|
+
}
|
|
351
|
+
if (this.storageIds.has(response.id)) {
|
|
352
|
+
// The blob is de-duped. Set up a local ID to storage ID mapping and return the blob. Since this is
|
|
353
|
+
// an existing blob, we don't have to wait for the op to be ack'd since this step has already
|
|
354
|
+
// happened before and so, the server won't delete it.
|
|
355
|
+
this.setRedirection(localId, response.id);
|
|
356
|
+
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
357
|
+
this.deletePendingBlobMaybe(localId);
|
|
339
358
|
}
|
|
340
359
|
else {
|
|
341
|
-
//
|
|
342
|
-
this
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
entry.status = PendingBlobStatus.OfflinePendingOp;
|
|
360
|
+
// If there is already an op for this storage ID, append the local ID to the list. Once any op for
|
|
361
|
+
// this storage ID is ack'd, all pending blobs for it can be resolved since the op will keep the
|
|
362
|
+
// blob alive in storage.
|
|
363
|
+
this.opsInFlight.set(response.id, (this.opsInFlight.get(response.id) ?? []).concat(localId));
|
|
347
364
|
}
|
|
348
365
|
return response;
|
|
349
366
|
}
|
|
350
367
|
async onUploadReject(localId, error) {
|
|
351
368
|
const entry = this.pendingBlobs.get(localId);
|
|
352
|
-
(0,
|
|
369
|
+
(0, core_utils_1.assert)(!!entry, 0x387 /* Must have pending blob entry for blob which failed to upload */);
|
|
370
|
+
if (entry.abortSignal?.aborted === true && !entry.opsent) {
|
|
371
|
+
this.deletePendingBlob(localId);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
353
374
|
if (!this.runtime.connected) {
|
|
354
|
-
if (entry.status === PendingBlobStatus.OnlinePendingUpload) {
|
|
355
|
-
this.transitionToOffline(localId);
|
|
356
|
-
}
|
|
357
375
|
// we are probably not connected to storage but start another upload request in case we are
|
|
358
376
|
entry.uploadP = this.retryThrottler
|
|
359
377
|
.getDelay()
|
|
@@ -365,50 +383,34 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
365
383
|
throw error;
|
|
366
384
|
}
|
|
367
385
|
}
|
|
368
|
-
transitionToOffline(localId) {
|
|
369
|
-
(0, common_utils_1.assert)(!this.runtime.connected, 0x388 /* Must only transition to offline flow while runtime is disconnected */);
|
|
370
|
-
const entry = this.pendingBlobs.get(localId);
|
|
371
|
-
(0, common_utils_1.assert)(!!entry, 0x389 /* No pending blob entry */);
|
|
372
|
-
(0, common_utils_1.assert)([PendingBlobStatus.OnlinePendingUpload, PendingBlobStatus.OnlinePendingOp].includes(entry.status), 0x38a /* Blob must be in online flow to transition to offline flow */);
|
|
373
|
-
/**
|
|
374
|
-
* If we haven't already submitted a BlobAttach op for this entry, send it before returning the blob handle.
|
|
375
|
-
* This will make sure that the BlobAttach op is sequenced prior to any ops referencing the handle. Otherwise,
|
|
376
|
-
* an invalid handle could be added to the document.
|
|
377
|
-
* storageId may be undefined but since we are not connected we will have a chance to add it when reSubmit()
|
|
378
|
-
* is called on reconnection.
|
|
379
|
-
*/
|
|
380
|
-
if (entry.status !== PendingBlobStatus.OnlinePendingOp) {
|
|
381
|
-
this.sendBlobAttachOp(localId, entry.storageId);
|
|
382
|
-
}
|
|
383
|
-
entry.status =
|
|
384
|
-
entry.status === PendingBlobStatus.OnlinePendingUpload
|
|
385
|
-
? PendingBlobStatus.OfflinePendingUpload
|
|
386
|
-
: PendingBlobStatus.OfflinePendingOp;
|
|
387
|
-
entry.handleP.resolve(this.getBlobHandle(localId));
|
|
388
|
-
}
|
|
389
386
|
/**
|
|
390
387
|
* Resubmit a BlobAttach op. Used to add storage IDs to ops that were
|
|
391
388
|
* submitted to runtime while disconnected.
|
|
392
389
|
* @param metadata - op metadata containing storage and/or local IDs
|
|
393
390
|
*/
|
|
394
391
|
reSubmit(metadata) {
|
|
395
|
-
(0,
|
|
392
|
+
(0, core_utils_1.assert)(!!metadata, 0x38b /* Resubmitted ops must have metadata */);
|
|
396
393
|
const { localId, blobId } = metadata;
|
|
397
|
-
(0,
|
|
394
|
+
(0, core_utils_1.assert)(localId !== undefined, 0x50d /* local ID not available on reSubmit */);
|
|
398
395
|
const pendingEntry = this.pendingBlobs.get(localId);
|
|
399
396
|
if (!blobId) {
|
|
400
397
|
// We submitted this op while offline. The blob should have been uploaded by now.
|
|
401
|
-
(0,
|
|
402
|
-
|
|
403
|
-
return this.sendBlobAttachOp(localId, pendingEntry.storageId);
|
|
398
|
+
(0, core_utils_1.assert)(pendingEntry?.opsent === true && !!pendingEntry?.storageId, 0x38d /* blob must be uploaded before resubmitting BlobAttach op */);
|
|
399
|
+
return this.sendBlobAttachOp(localId, pendingEntry?.storageId);
|
|
404
400
|
}
|
|
405
401
|
return this.sendBlobAttachOp(localId, blobId);
|
|
406
402
|
}
|
|
407
403
|
processBlobAttachOp(message, local) {
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
404
|
+
const localId = message.metadata?.localId;
|
|
405
|
+
const blobId = message.metadata?.blobId;
|
|
406
|
+
if (localId) {
|
|
407
|
+
const pendingEntry = this.pendingBlobs.get(localId);
|
|
408
|
+
if (pendingEntry?.abortSignal?.aborted) {
|
|
409
|
+
this.deletePendingBlob(localId);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
(0, core_utils_1.assert)(blobId !== undefined, 0x12a /* "Missing blob id on metadata" */);
|
|
412
414
|
// Set up a mapping from local ID to storage ID. This is crucial since without this the blob cannot be
|
|
413
415
|
// requested from the server.
|
|
414
416
|
// Note: The check for undefined is needed for back-compat when localId was not part of the BlobAttach op that
|
|
@@ -419,26 +421,28 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
419
421
|
// set identity (id -> id) entry
|
|
420
422
|
this.setRedirection(blobId, blobId);
|
|
421
423
|
if (local) {
|
|
422
|
-
(0,
|
|
424
|
+
(0, core_utils_1.assert)(localId !== undefined, 0x50e /* local ID not present in blob attach message */);
|
|
423
425
|
const waitingBlobs = this.opsInFlight.get(blobId);
|
|
424
426
|
if (waitingBlobs !== undefined) {
|
|
425
427
|
// For each op corresponding to this storage ID that we are waiting for, resolve the pending blob.
|
|
426
428
|
// This is safe because the server will keep the blob alive and the op containing the local ID to
|
|
427
429
|
// storage ID is already in flight and any op containing this local ID will be sequenced after that.
|
|
428
430
|
waitingBlobs.forEach((pendingLocalId) => {
|
|
429
|
-
const
|
|
430
|
-
(0,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
this.deleteAndEmitsIfEmpty(pendingLocalId);
|
|
436
|
-
}
|
|
431
|
+
const entry = this.pendingBlobs.get(pendingLocalId);
|
|
432
|
+
(0, core_utils_1.assert)(entry !== undefined, 0x38f /* local online BlobAttach op with no pending blob entry */);
|
|
433
|
+
this.setRedirection(pendingLocalId, blobId);
|
|
434
|
+
entry.acked = true;
|
|
435
|
+
entry.handleP.resolve(this.getBlobHandle(pendingLocalId));
|
|
436
|
+
this.deletePendingBlobMaybe(pendingLocalId);
|
|
437
437
|
});
|
|
438
438
|
this.opsInFlight.delete(blobId);
|
|
439
439
|
}
|
|
440
|
-
|
|
441
|
-
|
|
440
|
+
const localEntry = this.pendingBlobs.get(localId);
|
|
441
|
+
if (localEntry) {
|
|
442
|
+
localEntry.acked = true;
|
|
443
|
+
localEntry.handleP.resolve(this.getBlobHandle(localId));
|
|
444
|
+
this.deletePendingBlobMaybe(localId);
|
|
445
|
+
}
|
|
442
446
|
}
|
|
443
447
|
}
|
|
444
448
|
/**
|
|
@@ -465,11 +469,10 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
465
469
|
* Load a set of previously attached blob IDs and redirect table from a previous snapshot.
|
|
466
470
|
*/
|
|
467
471
|
load(snapshot) {
|
|
468
|
-
var _a, _b, _c;
|
|
469
472
|
this.mc.logger.sendTelemetryEvent({
|
|
470
473
|
eventName: "AttachmentBlobsLoaded",
|
|
471
|
-
count:
|
|
472
|
-
redirectTable:
|
|
474
|
+
count: snapshot.ids?.length ?? 0,
|
|
475
|
+
redirectTable: snapshot.redirectTable?.length,
|
|
473
476
|
});
|
|
474
477
|
const table = new Map(snapshot.redirectTable);
|
|
475
478
|
if (snapshot.ids) {
|
|
@@ -506,7 +509,7 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
506
509
|
getGCData(fullGC = false) {
|
|
507
510
|
const gcData = { gcNodes: {} };
|
|
508
511
|
for (const [localId, storageId] of this.redirectTable) {
|
|
509
|
-
(0,
|
|
512
|
+
(0, core_utils_1.assert)(!!storageId, 0x390 /* Must be attached to get GC data */);
|
|
510
513
|
// Only return local ids as GC nodes because a blob can only be referenced via its local id. The storage
|
|
511
514
|
// id entries have the same key and value, ignore them.
|
|
512
515
|
// The outbound routes are empty because a blob node cannot reference other nodes. It can only be referenced
|
|
@@ -528,11 +531,11 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
528
531
|
* Delete attachment blobs that are sweep ready.
|
|
529
532
|
* @param sweepReadyBlobRoutes - The routes of blobs that are sweep ready and should be deleted. These routes will
|
|
530
533
|
* be based off of local ids.
|
|
531
|
-
* @returns
|
|
534
|
+
* @returns The routes of blobs that were deleted.
|
|
532
535
|
*/
|
|
533
536
|
deleteSweepReadyNodes(sweepReadyBlobRoutes) {
|
|
534
537
|
// If sweep for attachment blobs is not enabled, return empty list indicating nothing is deleted.
|
|
535
|
-
if (this.mc.config.getBoolean(gc_1.
|
|
538
|
+
if (this.mc.config.getBoolean(gc_1.disableAttachmentBlobSweepKey) === true) {
|
|
536
539
|
return [];
|
|
537
540
|
}
|
|
538
541
|
this.deleteBlobsFromRedirectTable(sweepReadyBlobRoutes);
|
|
@@ -566,14 +569,14 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
566
569
|
continue;
|
|
567
570
|
}
|
|
568
571
|
const storageId = this.redirectTable.get(blobId);
|
|
569
|
-
(0,
|
|
572
|
+
(0, core_utils_1.assert)(!!storageId, 0x5bb /* Must be attached to run GC */);
|
|
570
573
|
maybeUnusedStorageIds.add(storageId);
|
|
571
574
|
this.redirectTable.delete(blobId);
|
|
572
575
|
}
|
|
573
576
|
// Find out storage ids that are in-use and remove them from maybeUnusedStorageIds. A storage id is in-use if
|
|
574
577
|
// the redirect table has a local id -> storage id entry for it.
|
|
575
578
|
for (const [localId, storageId] of this.redirectTable.entries()) {
|
|
576
|
-
(0,
|
|
579
|
+
(0, core_utils_1.assert)(!!storageId, 0x5bc /* Must be attached to run GC */);
|
|
577
580
|
// For every storage id, the redirect table has a id -> id entry. These do not make the storage id in-use.
|
|
578
581
|
if (maybeUnusedStorageIds.has(storageId) && localId !== storageId) {
|
|
579
582
|
maybeUnusedStorageIds.delete(storageId);
|
|
@@ -647,27 +650,65 @@ class BlobManager extends common_utils_1.TypedEventEmitter {
|
|
|
647
650
|
}
|
|
648
651
|
}
|
|
649
652
|
setRedirectTable(table) {
|
|
650
|
-
(0,
|
|
651
|
-
(0,
|
|
653
|
+
(0, core_utils_1.assert)(this.runtime.attachState === container_definitions_1.AttachState.Detached, 0x252 /* "redirect table can only be set in detached container" */);
|
|
654
|
+
(0, core_utils_1.assert)(this.redirectTable.size === table.size, 0x391 /* Redirect table size must match BlobManager's local ID count */);
|
|
652
655
|
for (const [localId, storageId] of table) {
|
|
653
|
-
(0,
|
|
656
|
+
(0, core_utils_1.assert)(this.redirectTable.has(localId), 0x254 /* "unrecognized id in redirect table" */);
|
|
654
657
|
this.setRedirection(localId, storageId);
|
|
655
658
|
// set identity (id -> id) entry
|
|
656
659
|
this.setRedirection(storageId, storageId);
|
|
657
660
|
}
|
|
658
661
|
}
|
|
659
|
-
getPendingBlobs() {
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
662
|
+
async getPendingBlobs(waitBlobsToAttach) {
|
|
663
|
+
return telemetry_utils_1.PerformanceEvent.timedExecAsync(this.mc.logger, { eventName: "GetPendingBlobs" }, async () => {
|
|
664
|
+
if (this.pendingBlobs.size === 0) {
|
|
665
|
+
return;
|
|
666
|
+
}
|
|
667
|
+
const blobs = {};
|
|
668
|
+
const localBlobs = new Set();
|
|
669
|
+
while (localBlobs.size < this.pendingBlobs.size) {
|
|
670
|
+
const attachBlobsP = [];
|
|
671
|
+
for (const [id, entry] of this.pendingBlobs) {
|
|
672
|
+
if (!localBlobs.has(entry)) {
|
|
673
|
+
localBlobs.add(entry);
|
|
674
|
+
if (waitBlobsToAttach) {
|
|
675
|
+
if (!entry.opsent) {
|
|
676
|
+
this.sendBlobAttachOp(id, entry.storageId);
|
|
677
|
+
}
|
|
678
|
+
entry.handleP.resolve(this.getBlobHandle(id));
|
|
679
|
+
attachBlobsP.push(new Promise((resolve) => {
|
|
680
|
+
const onBlobAttached = (attachedEntry) => {
|
|
681
|
+
if (attachedEntry === entry) {
|
|
682
|
+
this.off("blobAttached", onBlobAttached);
|
|
683
|
+
resolve();
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
if (!entry.attached) {
|
|
687
|
+
this.on("blobAttached", onBlobAttached);
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
resolve();
|
|
691
|
+
}
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
}
|
|
667
695
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
696
|
+
await Promise.all(attachBlobsP);
|
|
697
|
+
}
|
|
698
|
+
// another for is needed to correctly mark attach state
|
|
699
|
+
// future optimization won't add unattached blobs to the list
|
|
700
|
+
for (const [id, entry] of this.pendingBlobs) {
|
|
701
|
+
blobs[id] = {
|
|
702
|
+
blob: (0, client_utils_1.bufferToString)(entry.blob, "base64"),
|
|
703
|
+
storageId: entry.storageId,
|
|
704
|
+
attached: entry.attached,
|
|
705
|
+
acked: entry.acked,
|
|
706
|
+
minTTLInSeconds: entry.minTTLInSeconds,
|
|
707
|
+
uploadTime: entry.uploadTime,
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
return blobs;
|
|
711
|
+
});
|
|
671
712
|
}
|
|
672
713
|
}
|
|
673
714
|
exports.BlobManager = BlobManager;
|
|
@@ -686,7 +727,7 @@ function getGCNodePathFromBlobId(blobId) {
|
|
|
686
727
|
*/
|
|
687
728
|
function getBlobIdFromGCNodePath(nodePath) {
|
|
688
729
|
const pathParts = nodePath.split("/");
|
|
689
|
-
(0,
|
|
730
|
+
(0, core_utils_1.assert)(pathParts.length === 3 && pathParts[1] === BlobManager.basePath, 0x5bd /* Invalid blob node path */);
|
|
690
731
|
return pathParts[2];
|
|
691
732
|
}
|
|
692
733
|
//# sourceMappingURL=blobManager.js.map
|