@fluidframework/container-runtime 2.0.0-rc.2.0.1 → 2.0.0-rc.3.0.0
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 +23 -0
- package/api-report/container-runtime.api.md +471 -52
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js +4 -4
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +33 -30
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +82 -107
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +27 -22
- package/dist/channelCollection.d.ts.map +1 -1
- package/dist/channelCollection.js +189 -165
- package/dist/channelCollection.js.map +1 -1
- package/dist/connectionTelemetry.d.ts +3 -3
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +17 -17
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js +2 -2
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +42 -39
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +425 -292
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +8 -8
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +58 -19
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +171 -114
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -0
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js +12 -11
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +5 -1
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +4 -4
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.d.ts +1 -1
- package/dist/deltaScheduler.d.ts.map +1 -1
- package/dist/deltaScheduler.js +6 -6
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js +4 -4
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +3 -2
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +23 -23
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +2 -2
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +4 -5
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +4 -5
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +5 -1
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js +21 -12
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +2 -2
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +11 -11
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +2 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +11 -9
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +6 -6
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +1 -1
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +2 -1
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/legacy.d.ts +91 -0
- package/dist/messageTypes.d.ts +11 -5
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js +4 -0
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +2 -20
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +3 -3
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +3 -1
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +5 -6
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +15 -4
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +62 -63
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts +2 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js +14 -16
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +12 -4
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +63 -53
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +2 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +30 -29
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +8 -0
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +36 -32
- package/dist/opLifecycle/remoteMessageProcessor.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 +1 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +18 -18
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/public.d.ts +12 -0
- package/dist/scheduleManager.d.ts +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +28 -24
- package/dist/scheduleManager.js.map +1 -1
- package/dist/storageServiceWithAttachBlobs.d.ts +2 -2
- package/dist/storageServiceWithAttachBlobs.d.ts.map +1 -1
- package/dist/storageServiceWithAttachBlobs.js +2 -2
- package/dist/storageServiceWithAttachBlobs.js.map +1 -1
- package/dist/summary/documentSchema.d.ts +209 -0
- package/dist/summary/documentSchema.d.ts.map +1 -0
- package/dist/summary/documentSchema.js +390 -0
- package/dist/summary/documentSchema.js.map +1 -0
- package/dist/summary/index.d.ts +2 -1
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +4 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +2 -2
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +12 -7
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +3 -3
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +3 -3
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +16 -16
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +3 -2
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +13 -13
- 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.map +1 -1
- package/dist/summary/summarizerHeuristics.d.ts +1 -1
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js +2 -2
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +3 -2
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +28 -28
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +14 -14
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +5 -3
- 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 +7 -7
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +6 -17
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js +8 -8
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +4 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +17 -17
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +1 -1
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +15 -14
- package/dist/summary/summaryManager.js.map +1 -1
- package/internal.d.ts +11 -0
- package/legacy.d.ts +11 -0
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.d.ts.map +1 -1
- package/lib/batchTracker.js +2 -2
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +33 -30
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +48 -73
- package/lib/blobManager.js.map +1 -1
- package/lib/channelCollection.d.ts +27 -22
- package/lib/channelCollection.d.ts.map +1 -1
- package/lib/channelCollection.js +132 -108
- package/lib/channelCollection.js.map +1 -1
- package/lib/connectionTelemetry.d.ts +3 -3
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +3 -3
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.d.ts.map +1 -1
- package/lib/containerHandleContext.js +1 -1
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +42 -39
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +276 -141
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +3 -3
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +58 -19
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +110 -53
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -0
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js +3 -2
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +5 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.d.ts +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -1
- package/lib/deltaScheduler.js +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js +2 -2
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +3 -2
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +8 -8
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +2 -2
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +4 -5
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +4 -5
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcHelpers.d.ts +5 -1
- package/lib/gc/gcHelpers.d.ts.map +1 -1
- package/lib/gc/gcHelpers.js +10 -2
- package/lib/gc/gcHelpers.js.map +1 -1
- package/lib/gc/gcSummaryStateTracker.d.ts +2 -2
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/lib/gc/gcSummaryStateTracker.js +2 -2
- package/lib/gc/gcSummaryStateTracker.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +2 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +4 -2
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +2 -2
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +1 -1
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +1 -1
- package/lib/gc/index.js.map +1 -1
- package/lib/index.d.ts +5 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/legacy.d.ts +91 -0
- package/lib/messageTypes.d.ts +11 -5
- package/lib/messageTypes.d.ts.map +1 -1
- package/lib/messageTypes.js +4 -0
- package/lib/messageTypes.js.map +1 -1
- package/lib/opLifecycle/batchManager.d.ts.map +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +2 -20
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/index.d.ts +3 -3
- package/lib/opLifecycle/index.d.ts.map +1 -1
- package/lib/opLifecycle/index.js +2 -2
- package/lib/opLifecycle/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +2 -3
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts +15 -4
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +61 -62
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts +2 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js +9 -12
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts +12 -4
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +47 -38
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +2 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +19 -18
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +8 -0
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +36 -32
- package/lib/opLifecycle/remoteMessageProcessor.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 +1 -1
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +2 -2
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/public.d.ts +12 -0
- package/lib/scheduleManager.d.ts +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +7 -3
- package/lib/scheduleManager.js.map +1 -1
- package/lib/storageServiceWithAttachBlobs.d.ts +2 -2
- package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -1
- package/lib/storageServiceWithAttachBlobs.js +1 -1
- package/lib/storageServiceWithAttachBlobs.js.map +1 -1
- package/lib/summary/documentSchema.d.ts +209 -0
- package/lib/summary/documentSchema.d.ts.map +1 -0
- package/lib/summary/documentSchema.js +386 -0
- package/lib/summary/documentSchema.js.map +1 -0
- package/lib/summary/index.d.ts +2 -1
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -0
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +2 -2
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +7 -2
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +3 -3
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +3 -3
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +3 -2
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +3 -3
- 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.map +1 -1
- package/lib/summary/summarizerHeuristics.d.ts +1 -1
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
- package/lib/summary/summarizerHeuristics.js +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +3 -2
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +5 -5
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +2 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +5 -3
- 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 +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +6 -17
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js +3 -3
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +4 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +4 -4
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +1 -1
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +9 -8
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +57 -65
- package/src/batchTracker.ts +4 -3
- package/src/blobManager.ts +100 -77
- package/src/channelCollection.ts +223 -167
- package/src/connectionTelemetry.ts +12 -12
- package/src/containerHandleContext.ts +3 -2
- package/src/containerRuntime.ts +481 -277
- package/src/dataStore.ts +9 -4
- package/src/dataStoreContext.ts +201 -97
- package/src/dataStoreContexts.ts +5 -2
- package/src/dataStoreRegistry.ts +3 -2
- package/src/deltaManagerSummarizerProxy.ts +1 -1
- package/src/deltaScheduler.ts +2 -1
- package/src/error.ts +2 -2
- package/src/gc/garbageCollection.ts +21 -20
- package/src/gc/gcConfigs.ts +15 -18
- package/src/gc/gcDefinitions.ts +6 -8
- package/src/gc/gcHelpers.ts +22 -5
- package/src/gc/gcSummaryStateTracker.ts +7 -5
- package/src/gc/gcTelemetry.ts +13 -7
- package/src/gc/gcUnreferencedStateTracker.ts +3 -2
- package/src/gc/index.ts +1 -0
- package/src/index.ts +22 -1
- package/src/messageTypes.ts +20 -6
- package/src/opLifecycle/README.md +89 -0
- package/src/opLifecycle/batchManager.ts +1 -0
- package/src/opLifecycle/definitions.ts +3 -21
- package/src/opLifecycle/index.ts +3 -9
- package/src/opLifecycle/opCompressor.ts +6 -5
- package/src/opLifecycle/opDecompressor.ts +90 -100
- package/src/opLifecycle/opGroupingManager.ts +12 -14
- package/src/opLifecycle/opSplitter.ts +76 -48
- package/src/opLifecycle/outbox.ts +30 -38
- package/src/opLifecycle/remoteMessageProcessor.ts +43 -55
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +6 -6
- package/src/scheduleManager.ts +10 -8
- package/src/storageServiceWithAttachBlobs.ts +2 -2
- package/src/summary/documentSchema.ts +631 -0
- package/src/summary/index.ts +10 -1
- package/src/summary/orderedClientElection.ts +7 -7
- package/src/summary/runWhileConnectedCoordinator.ts +3 -2
- package/src/summary/runningSummarizer.ts +22 -20
- package/src/summary/summarizer.ts +17 -15
- package/src/summary/summarizerClientElection.ts +3 -2
- package/src/summary/summarizerHeuristics.ts +4 -2
- package/src/summary/summarizerNode/summarizerNode.ts +20 -18
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +3 -2
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +16 -8
- package/src/summary/summarizerTypes.ts +7 -3
- package/src/summary/summaryCollection.ts +3 -3
- package/src/summary/summaryFormat.ts +14 -26
- package/src/summary/summaryGenerator.ts +12 -15
- package/src/summary/summaryManager.ts +16 -13
- package/api-extractor-cjs.json +0 -8
- package/dist/container-runtime-alpha.d.ts +0 -1753
- package/dist/container-runtime-beta.d.ts +0 -268
- package/dist/container-runtime-public.d.ts +0 -268
- package/dist/container-runtime-untrimmed.d.ts +0 -1893
- package/lib/container-runtime-alpha.d.ts +0 -1753
- package/lib/container-runtime-beta.d.ts +0 -268
- package/lib/container-runtime-public.d.ts +0 -268
- package/lib/container-runtime-untrimmed.d.ts +0 -1893
- package/lib/test/batchTracker.spec.js +0 -88
- package/lib/test/batchTracker.spec.js.map +0 -1
- package/lib/test/blobManager.spec.js +0 -835
- package/lib/test/blobManager.spec.js.map +0 -1
- package/lib/test/channelCollection.spec.js +0 -141
- package/lib/test/channelCollection.spec.js.map +0 -1
- package/lib/test/containerRuntime.spec.js +0 -1748
- package/lib/test/containerRuntime.spec.js.map +0 -1
- package/lib/test/dataStoreContext.spec.js +0 -801
- package/lib/test/dataStoreContext.spec.js.map +0 -1
- package/lib/test/dataStoreCreation.spec.js +0 -312
- package/lib/test/dataStoreCreation.spec.js.map +0 -1
- package/lib/test/dataStoreRegistry.spec.js +0 -26
- package/lib/test/dataStoreRegistry.spec.js.map +0 -1
- package/lib/test/fuzz/fuzzUtils.js +0 -66
- package/lib/test/fuzz/fuzzUtils.js.map +0 -1
- package/lib/test/fuzz/summarizer.fuzz.spec.js +0 -31
- package/lib/test/fuzz/summarizer.fuzz.spec.js.map +0 -1
- package/lib/test/fuzz/summarizerFuzzMocks.js +0 -162
- package/lib/test/fuzz/summarizerFuzzMocks.js.map +0 -1
- package/lib/test/fuzz/summarizerFuzzSuite.js +0 -106
- package/lib/test/fuzz/summarizerFuzzSuite.js.map +0 -1
- package/lib/test/gc/garbageCollection.spec.js +0 -1465
- package/lib/test/gc/garbageCollection.spec.js.map +0 -1
- package/lib/test/gc/gcConfigs.spec.js +0 -690
- package/lib/test/gc/gcConfigs.spec.js.map +0 -1
- package/lib/test/gc/gcHelpers.spec.js +0 -110
- package/lib/test/gc/gcHelpers.spec.js.map +0 -1
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +0 -68
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +0 -1
- package/lib/test/gc/gcStats.spec.js +0 -391
- package/lib/test/gc/gcStats.spec.js.map +0 -1
- package/lib/test/gc/gcSummaryStateTracker.spec.js +0 -228
- package/lib/test/gc/gcSummaryStateTracker.spec.js.map +0 -1
- package/lib/test/gc/gcTelemetry.spec.js +0 -530
- package/lib/test/gc/gcTelemetry.spec.js.map +0 -1
- package/lib/test/gc/gcUnitTestHelpers.js +0 -29
- package/lib/test/gc/gcUnitTestHelpers.js.map +0 -1
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js +0 -192
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +0 -1
- package/lib/test/getPendingBlobs.spec.js +0 -193
- package/lib/test/getPendingBlobs.spec.js.map +0 -1
- package/lib/test/hardwareStats.spec.js +0 -93
- package/lib/test/hardwareStats.spec.js.map +0 -1
- package/lib/test/index.js +0 -6
- package/lib/test/index.js.map +0 -1
- package/lib/test/opLifecycle/OpGroupingManager.spec.js +0 -225
- package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +0 -1
- package/lib/test/opLifecycle/batchManager.spec.js +0 -189
- package/lib/test/opLifecycle/batchManager.spec.js.map +0 -1
- package/lib/test/opLifecycle/opCompressor.spec.js +0 -74
- package/lib/test/opLifecycle/opCompressor.spec.js.map +0 -1
- package/lib/test/opLifecycle/opDecompressor.spec.js +0 -218
- package/lib/test/opLifecycle/opDecompressor.spec.js.map +0 -1
- package/lib/test/opLifecycle/opSplitter.spec.js +0 -272
- package/lib/test/opLifecycle/opSplitter.spec.js.map +0 -1
- package/lib/test/opLifecycle/outbox.spec.js +0 -675
- package/lib/test/opLifecycle/outbox.spec.js.map +0 -1
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +0 -196
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +0 -1
- package/lib/test/pendingStateManager.spec.js +0 -329
- package/lib/test/pendingStateManager.spec.js.map +0 -1
- package/lib/test/scheduleManager.spec.js +0 -270
- package/lib/test/scheduleManager.spec.js.map +0 -1
- package/lib/test/summarizerNode.spec.js +0 -326
- package/lib/test/summarizerNode.spec.js.map +0 -1
- package/lib/test/summarizerNodeWithGc.spec.js +0 -318
- package/lib/test/summarizerNodeWithGc.spec.js.map +0 -1
- package/lib/test/summary/orderedClientElection.spec.js +0 -535
- package/lib/test/summary/orderedClientElection.spec.js.map +0 -1
- package/lib/test/summary/runningSummarizer.spec.js +0 -1349
- package/lib/test/summary/runningSummarizer.spec.js.map +0 -1
- package/lib/test/summary/summarizer.spec.js +0 -29
- package/lib/test/summary/summarizer.spec.js.map +0 -1
- package/lib/test/summary/summarizerClientElection.spec.js +0 -436
- package/lib/test/summary/summarizerClientElection.spec.js.map +0 -1
- package/lib/test/summary/summarizerHeuristics.spec.js +0 -289
- package/lib/test/summary/summarizerHeuristics.spec.js.map +0 -1
- package/lib/test/summary/summaryCollection.spec.js +0 -200
- package/lib/test/summary/summaryCollection.spec.js.map +0 -1
- package/lib/test/summary/summaryManager.spec.js +0 -430
- package/lib/test/summary/summaryManager.spec.js.map +0 -1
- package/lib/test/summary/testQuorumClients.js +0 -34
- package/lib/test/summary/testQuorumClients.js.map +0 -1
- package/lib/test/throttler.spec.js +0 -175
- package/lib/test/throttler.spec.js.map +0 -1
- package/lib/test/types/validateContainerRuntimePrevious.generated.js +0 -180
- package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +0 -1
- /package/{dist → lib}/tsdoc-metadata.json +0 -0
package/lib/dataStore.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
+
import { IDataStore, IFluidDataStoreChannel } from "@fluidframework/runtime-definitions/internal";
|
|
5
6
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
6
|
-
import { IDataStore, IFluidDataStoreChannel } from "@fluidframework/runtime-definitions";
|
|
7
7
|
import { ChannelCollection } from "./channelCollection.js";
|
|
8
8
|
/**
|
|
9
9
|
* Interface for an op to be used for assigning an
|
package/lib/dataStore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStore.d.ts","sourceRoot":"","sources":["../src/dataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"dataStore.d.ts","sourceRoot":"","sources":["../src/dataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAEN,UAAU,EACV,sBAAsB,EACtB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACtC,uCAAuC;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,+BACP,GAAG,yDAM/B,CAAC;AAEF,eAAO,MAAM,kBAAkB,0BACP,sBAAsB,cACjC,MAAM,qBACC,iBAAiB,UAC5B,mBAAmB,KACzB,UAAyF,CAAC"}
|
package/lib/dataStore.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { TelemetryDataTag, UsageError } from "@fluidframework/telemetry-utils";
|
|
6
|
-
import { assert, unreachableCase } from "@fluidframework/core-utils";
|
|
7
5
|
import { AttachState } from "@fluidframework/container-definitions";
|
|
6
|
+
import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
7
|
+
import { TelemetryDataTag, UsageError } from "@fluidframework/telemetry-utils/internal";
|
|
8
8
|
import { ContainerMessageType } from "./messageTypes.js";
|
|
9
9
|
/**
|
|
10
10
|
* Type guard that returns true if the given alias message is actually an instance of
|
|
@@ -68,7 +68,7 @@ class DataStore {
|
|
|
68
68
|
};
|
|
69
69
|
this.fluidDataStoreChannel.makeVisibleAndAttachGraph();
|
|
70
70
|
if (this.parentContext.attachState === AttachState.Detached) {
|
|
71
|
-
const localResult = this.channelCollection.processAliasMessageCore(
|
|
71
|
+
const localResult = this.channelCollection.processAliasMessageCore(this.internalId, alias);
|
|
72
72
|
// Explicitly lock-out future attempts of aliasing,
|
|
73
73
|
// regardless of result
|
|
74
74
|
this.aliasState = AliasState.Aliased;
|
package/lib/dataStore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStore.js","sourceRoot":"","sources":["../src/dataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,gBAAgB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CA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;QAClB,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,WAAM,GAAN,MAAM,CAAqB;QAC3B,kBAAa,GAAb,aAAa,CAAkC;QAnHzD,eAAU,GAAe,UAAU,CAAC,IAAI,CAAC;QAqHhD,IAAI,CAAC,cAAc,GAAG,iBAAiB,CAAC,cAAc,CAAC;IACxD,CAAC;IAEO,KAAK,CAAC,eAAe,CAC5B,QAGS;QAET,IAAI,oBAAgC,CAAC;QACrC,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,oBAAoB,GAAG,GAAG,EAAE,CAC3B,MAAM,CACL,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAC/E,CAAC;YAEH,IAAI,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,QAAQ,EAAE;gBACjD,oBAAoB,EAAE,CAAC;gBACvB,OAAO;aACP;YAED,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;YACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE;YACf,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from \"@fluidframework/telemetry-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { FluidObject, IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tAliasResult,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n} from \"@fluidframework/runtime-definitions\";\nimport { ChannelCollection } from \"./channelCollection.js\";\nimport { ContainerMessageType } from \"./messageTypes.js\";\n\n/**\n * Interface for an op to be used for assigning an\n * alias to a datastore\n */\nexport interface IDataStoreAliasMessage {\n\t/** The internal id of the datastore */\n\treadonly internalId: string;\n\t/** The alias name to be assigned to the datastore */\n\treadonly alias: string;\n}\n\n/**\n * Type guard that returns true if the given alias message is actually an instance of\n * a class which implements {@link IDataStoreAliasMessage}\n * @param maybeDataStoreAliasMessage - message object to be validated\n * @returns True if the {@link IDataStoreAliasMessage} is fully implemented, false otherwise\n */\nexport const isDataStoreAliasMessage = (\n\tmaybeDataStoreAliasMessage: any,\n): maybeDataStoreAliasMessage is IDataStoreAliasMessage => {\n\treturn (\n\t\ttypeof maybeDataStoreAliasMessage?.internalId === \"string\" &&\n\t\ttypeof maybeDataStoreAliasMessage?.alias === \"string\"\n\t);\n};\n\nexport const channelToDataStore = (\n\tfluidDataStoreChannel: IFluidDataStoreChannel,\n\tinternalId: string,\n\tchannelCollection: ChannelCollection,\n\tlogger: ITelemetryLoggerExt,\n): IDataStore => new DataStore(fluidDataStoreChannel, internalId, channelCollection, logger);\n\nenum AliasState {\n\tAliased = \"Aliased\",\n\tAliasing = \"Aliasing\",\n\tNone = \"None\",\n}\n\nclass DataStore implements IDataStore {\n\tprivate aliasState: AliasState = AliasState.None;\n\tprivate alias: string | undefined;\n\tprivate readonly pendingAliases: Map<string, Promise<AliasResult>>;\n\tprivate aliasResult: Promise<AliasResult> | undefined;\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.trySetAlias}\n\t */\n\tasync trySetAlias(alias: string): Promise<AliasResult> {\n\t\tif (alias.includes(\"/\")) {\n\t\t\tthrow new UsageError(`The alias cannot contain slashes: '${alias}'`);\n\t\t}\n\n\t\tswitch (this.aliasState) {\n\t\t\t// If we're already aliasing, check if it's for the same value and return\n\t\t\t// the stored promise, otherwise return 'AlreadyAliased'\n\t\t\tcase AliasState.Aliasing:\n\t\t\t\tassert(\n\t\t\t\t\tthis.aliasResult !== undefined,\n\t\t\t\t\t0x316 /* There should be a cached promise of in-progress aliasing */,\n\t\t\t\t);\n\t\t\t\tawait this.aliasResult;\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\t// If this datastore is already aliased, return true only if this\n\t\t\t// is a repeated call for the same alias\n\t\t\tcase AliasState.Aliased:\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\tcase AliasState.None: {\n\t\t\t\tconst existingAlias = this.pendingAliases.get(alias);\n\t\t\t\tif (existingAlias !== undefined) {\n\t\t\t\t\t// There is already another datastore which will be aliased\n\t\t\t\t\t// to the same name\n\t\t\t\t\treturn \"Conflict\";\n\t\t\t\t}\n\n\t\t\t\t// There is no current or past alias operation for this datastore,\n\t\t\t\t// or for this alias, so it is safe to continue execution\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(this.aliasState);\n\t\t}\n\n\t\tthis.aliasState = AliasState.Aliasing;\n\t\tthis.aliasResult = this.trySetAliasInternal(alias);\n\t\tthis.pendingAliases.set(alias, this.aliasResult);\n\t\treturn this.aliasResult;\n\t}\n\n\tasync trySetAliasInternal(alias: string): Promise<AliasResult> {\n\t\tconst message: IDataStoreAliasMessage = {\n\t\t\tinternalId: this.internalId,\n\t\t\talias,\n\t\t};\n\t\tthis.fluidDataStoreChannel.makeVisibleAndAttachGraph();\n\n\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\tconst localResult = this.channelCollection.processAliasMessageCore(message);\n\t\t\t// Explicitly lock-out future attempts of aliasing,\n\t\t\t// regardless of result\n\t\t\tthis.aliasState = AliasState.Aliased;\n\t\t\treturn localResult ? \"Success\" : \"Conflict\";\n\t\t}\n\n\t\tconst aliased = await this.ackBasedPromise<boolean>((resolve) => {\n\t\t\tthis.parentContext.submitMessage(ContainerMessageType.Alias, message, resolve);\n\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"AliasingException\",\n\t\t\t\t\t\talias: {\n\t\t\t\t\t\t\tvalue: alias,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.UserData,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinternalId: {\n\t\t\t\t\t\t\tvalue: this.internalId,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tthis.pendingAliases.delete(alias);\n\t\t\t});\n\n\t\tif (!aliased) {\n\t\t\tthis.aliasState = AliasState.None;\n\t\t\tthis.aliasResult = undefined;\n\t\t\treturn \"Conflict\";\n\t\t}\n\n\t\tthis.alias = alias;\n\t\tthis.aliasState = AliasState.Aliased;\n\t\treturn \"Success\";\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}\n\t */\n\tget entryPoint(): IFluidHandle<FluidObject> {\n\t\treturn this.fluidDataStoreChannel.entryPoint;\n\t}\n\n\tconstructor(\n\t\tprivate readonly fluidDataStoreChannel: IFluidDataStoreChannel,\n\t\tprivate readonly internalId: string,\n\t\tprivate readonly channelCollection: ChannelCollection,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly parentContext = channelCollection.parentContext,\n\t) {\n\t\tthis.pendingAliases = channelCollection.pendingAliases;\n\t}\n\n\tprivate async ackBasedPromise<T>(\n\t\texecutor: (\n\t\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\t\treject: (reason?: any) => void,\n\t\t) => void,\n\t): Promise<T> {\n\t\tlet rejectBecauseDispose: () => void;\n\t\treturn new Promise<T>((resolve, reject) => {\n\t\t\trejectBecauseDispose = () =>\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\"ContainerRuntime disposed while this ack-based Promise was pending\"),\n\t\t\t\t);\n\n\t\t\tif (this.parentContext.containerRuntime.disposed) {\n\t\t\t\trejectBecauseDispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.parentContext.containerRuntime.on(\"dispose\", rejectBecauseDispose);\n\t\t\texecutor(resolve, reject);\n\t\t}).finally(() => {\n\t\t\tthis.parentContext.containerRuntime.off(\"dispose\", rejectBecauseDispose);\n\t\t});\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dataStore.js","sourceRoot":"","sources":["../src/dataStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAEpE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAO9E,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAGxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAazD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACtC,0BAA+B,EACwB,EAAE;IACzD,OAAO,CACN,OAAO,0BAA0B,EAAE,UAAU,KAAK,QAAQ;QAC1D,OAAO,0BAA0B,EAAE,KAAK,KAAK,QAAQ,CACrD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CACjC,qBAA6C,EAC7C,UAAkB,EAClB,iBAAoC,EACpC,MAA2B,EACd,EAAE,CAAC,IAAI,SAAS,CAAC,qBAAqB,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAE7F,IAAK,UAIJ;AAJD,WAAK,UAAU;IACd,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;AACd,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAED,MAAM,SAAS;IAMd;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,KAAa;QAC9B,IAAI,KAAK,CAAC,QAAQ,CAAC,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,SAAS,EAAE,oBAAoB,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACJ,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { FluidObject, IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport {\n\tAliasResult,\n\tIDataStore,\n\tIFluidDataStoreChannel,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { TelemetryDataTag, UsageError } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ChannelCollection } from \"./channelCollection.js\";\nimport { ContainerMessageType } from \"./messageTypes.js\";\n\n/**\n * Interface for an op to be used for assigning an\n * alias to a datastore\n */\nexport interface IDataStoreAliasMessage {\n\t/** The internal id of the datastore */\n\treadonly internalId: string;\n\t/** The alias name to be assigned to the datastore */\n\treadonly alias: string;\n}\n\n/**\n * Type guard that returns true if the given alias message is actually an instance of\n * a class which implements {@link IDataStoreAliasMessage}\n * @param maybeDataStoreAliasMessage - message object to be validated\n * @returns True if the {@link IDataStoreAliasMessage} is fully implemented, false otherwise\n */\nexport const isDataStoreAliasMessage = (\n\tmaybeDataStoreAliasMessage: any,\n): maybeDataStoreAliasMessage is IDataStoreAliasMessage => {\n\treturn (\n\t\ttypeof maybeDataStoreAliasMessage?.internalId === \"string\" &&\n\t\ttypeof maybeDataStoreAliasMessage?.alias === \"string\"\n\t);\n};\n\nexport const channelToDataStore = (\n\tfluidDataStoreChannel: IFluidDataStoreChannel,\n\tinternalId: string,\n\tchannelCollection: ChannelCollection,\n\tlogger: ITelemetryLoggerExt,\n): IDataStore => new DataStore(fluidDataStoreChannel, internalId, channelCollection, logger);\n\nenum AliasState {\n\tAliased = \"Aliased\",\n\tAliasing = \"Aliasing\",\n\tNone = \"None\",\n}\n\nclass DataStore implements IDataStore {\n\tprivate aliasState: AliasState = AliasState.None;\n\tprivate alias: string | undefined;\n\tprivate readonly pendingAliases: Map<string, Promise<AliasResult>>;\n\tprivate aliasResult: Promise<AliasResult> | undefined;\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.trySetAlias}\n\t */\n\tasync trySetAlias(alias: string): Promise<AliasResult> {\n\t\tif (alias.includes(\"/\")) {\n\t\t\tthrow new UsageError(`The alias cannot contain slashes: '${alias}'`);\n\t\t}\n\n\t\tswitch (this.aliasState) {\n\t\t\t// If we're already aliasing, check if it's for the same value and return\n\t\t\t// the stored promise, otherwise return 'AlreadyAliased'\n\t\t\tcase AliasState.Aliasing:\n\t\t\t\tassert(\n\t\t\t\t\tthis.aliasResult !== undefined,\n\t\t\t\t\t0x316 /* There should be a cached promise of in-progress aliasing */,\n\t\t\t\t);\n\t\t\t\tawait this.aliasResult;\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\t// If this datastore is already aliased, return true only if this\n\t\t\t// is a repeated call for the same alias\n\t\t\tcase AliasState.Aliased:\n\t\t\t\treturn this.alias === alias ? \"Success\" : \"AlreadyAliased\";\n\n\t\t\tcase AliasState.None: {\n\t\t\t\tconst existingAlias = this.pendingAliases.get(alias);\n\t\t\t\tif (existingAlias !== undefined) {\n\t\t\t\t\t// There is already another datastore which will be aliased\n\t\t\t\t\t// to the same name\n\t\t\t\t\treturn \"Conflict\";\n\t\t\t\t}\n\n\t\t\t\t// There is no current or past alias operation for this datastore,\n\t\t\t\t// or for this alias, so it is safe to continue execution\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tdefault:\n\t\t\t\tunreachableCase(this.aliasState);\n\t\t}\n\n\t\tthis.aliasState = AliasState.Aliasing;\n\t\tthis.aliasResult = this.trySetAliasInternal(alias);\n\t\tthis.pendingAliases.set(alias, this.aliasResult);\n\t\treturn this.aliasResult;\n\t}\n\n\tasync trySetAliasInternal(alias: string): Promise<AliasResult> {\n\t\tconst message: IDataStoreAliasMessage = {\n\t\t\tinternalId: this.internalId,\n\t\t\talias,\n\t\t};\n\t\tthis.fluidDataStoreChannel.makeVisibleAndAttachGraph();\n\n\t\tif (this.parentContext.attachState === AttachState.Detached) {\n\t\t\tconst localResult = this.channelCollection.processAliasMessageCore(\n\t\t\t\tthis.internalId,\n\t\t\t\talias,\n\t\t\t);\n\t\t\t// Explicitly lock-out future attempts of aliasing,\n\t\t\t// regardless of result\n\t\t\tthis.aliasState = AliasState.Aliased;\n\t\t\treturn localResult ? \"Success\" : \"Conflict\";\n\t\t}\n\n\t\tconst aliased = await this.ackBasedPromise<boolean>((resolve) => {\n\t\t\tthis.parentContext.submitMessage(ContainerMessageType.Alias, message, resolve);\n\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"AliasingException\",\n\t\t\t\t\t\talias: {\n\t\t\t\t\t\t\tvalue: alias,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.UserData,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tinternalId: {\n\t\t\t\t\t\t\tvalue: this.internalId,\n\t\t\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.finally(() => {\n\t\t\t\tthis.pendingAliases.delete(alias);\n\t\t\t});\n\n\t\tif (!aliased) {\n\t\t\tthis.aliasState = AliasState.None;\n\t\t\tthis.aliasResult = undefined;\n\t\t\treturn \"Conflict\";\n\t\t}\n\n\t\tthis.alias = alias;\n\t\tthis.aliasState = AliasState.Aliased;\n\t\treturn \"Success\";\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.entryPoint}\n\t */\n\tget entryPoint(): IFluidHandle<FluidObject> {\n\t\treturn this.fluidDataStoreChannel.entryPoint;\n\t}\n\n\tconstructor(\n\t\tprivate readonly fluidDataStoreChannel: IFluidDataStoreChannel,\n\t\tprivate readonly internalId: string,\n\t\tprivate readonly channelCollection: ChannelCollection,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly parentContext = channelCollection.parentContext,\n\t) {\n\t\tthis.pendingAliases = channelCollection.pendingAliases;\n\t}\n\n\tprivate async ackBasedPromise<T>(\n\t\texecutor: (\n\t\t\tresolve: (value: T | PromiseLike<T>) => void,\n\t\t\treject: (reason?: any) => void,\n\t\t) => void,\n\t): Promise<T> {\n\t\tlet rejectBecauseDispose: () => void;\n\t\treturn new Promise<T>((resolve, reject) => {\n\t\t\trejectBecauseDispose = () =>\n\t\t\t\treject(\n\t\t\t\t\tnew Error(\"ContainerRuntime disposed while this ack-based Promise was pending\"),\n\t\t\t\t);\n\n\t\t\tif (this.parentContext.containerRuntime.disposed) {\n\t\t\t\trejectBecauseDispose();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.parentContext.containerRuntime.on(\"dispose\", rejectBecauseDispose);\n\t\t\texecutor(resolve, reject);\n\t\t}).finally(() => {\n\t\t\tthis.parentContext.containerRuntime.off(\"dispose\", rejectBecauseDispose);\n\t\t});\n\t}\n}\n"]}
|
|
@@ -2,22 +2,42 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IDisposable, FluidObject, IRequest, IResponse, IFluidHandle } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IAudience, IDeltaManager, AttachState } from "@fluidframework/container-definitions";
|
|
7
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
8
|
-
import {
|
|
6
|
+
import { AttachState, IAudience, IDeltaManager } from "@fluidframework/container-definitions";
|
|
7
|
+
import { FluidObject, IDisposable, IEvent, IFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
|
|
8
|
+
import { IDocumentStorageService } from "@fluidframework/driver-definitions/internal";
|
|
9
9
|
import type { IIdCompressor } from "@fluidframework/id-compressor";
|
|
10
10
|
import { IClientDetails, IDocumentMessage, IQuorumClients, ISequencedDocumentMessage, ISnapshotTree, ITreeEntry } from "@fluidframework/protocol-definitions";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { IGarbageCollectionData, IInboundSignalMessage, ISummaryTreeWithStats, ITelemetryContext } from "@fluidframework/runtime-definitions";
|
|
12
|
+
import { CreateChildSummarizerNodeFn, CreateChildSummarizerNodeParam, IContainerRuntimeBase, IDataStore, IFluidDataStoreChannel, IFluidDataStoreContext, IFluidDataStoreContextDetached, IFluidDataStoreRegistry, IFluidParentContext, IGarbageCollectionDetailsBase, IProvideFluidDataStoreFactory, ISummarizeResult, ISummarizerNodeWithGC, SummarizeInternalFn } from "@fluidframework/runtime-definitions/internal";
|
|
13
|
+
import { MonitoringContext } from "@fluidframework/telemetry-utils/internal";
|
|
13
14
|
export declare function createAttributesBlob(pkg: readonly string[], isRootDataStore: boolean): ITreeEntry;
|
|
14
|
-
|
|
15
|
+
/** @internal */
|
|
16
|
+
export interface ISnapshotDetails {
|
|
15
17
|
pkg: readonly string[];
|
|
16
18
|
isRootDataStore: boolean;
|
|
17
19
|
snapshot?: ISnapshotTree;
|
|
18
20
|
sequenceNumber?: number;
|
|
19
21
|
}
|
|
20
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* This is interface that every context should implement.
|
|
24
|
+
* This interface is used for context's parent - ChannelCollection.
|
|
25
|
+
* It should not be exposed to any other users of context.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export interface IFluidDataStoreContextInternal extends IFluidDataStoreContext {
|
|
29
|
+
getAttachData(includeGCData: boolean, telemetryContext?: ITelemetryContext): {
|
|
30
|
+
attachSummary: ISummaryTreeWithStats;
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
34
|
+
realize(): Promise<IFluidDataStoreChannel>;
|
|
35
|
+
isRoot(): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Properties necessary for creating a FluidDataStoreContext
|
|
39
|
+
* @internal
|
|
40
|
+
*/
|
|
21
41
|
export interface IFluidDataStoreContextProps {
|
|
22
42
|
readonly id: string;
|
|
23
43
|
readonly parentContext: IFluidParentContext;
|
|
@@ -27,29 +47,42 @@ export interface IFluidDataStoreContextProps {
|
|
|
27
47
|
readonly pkg?: Readonly<string[]>;
|
|
28
48
|
readonly loadingGroupId?: string;
|
|
29
49
|
}
|
|
30
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Properties necessary for creating a local FluidDataStoreContext
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
31
54
|
export interface ILocalFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
32
55
|
readonly pkg: Readonly<string[]> | undefined;
|
|
33
56
|
readonly snapshotTree: ISnapshotTree | undefined;
|
|
34
|
-
readonly isRootDataStore: boolean | undefined;
|
|
35
57
|
readonly makeLocallyVisibleFn: () => void;
|
|
36
58
|
/**
|
|
37
59
|
* @deprecated 0.16 Issue #1635, #3631
|
|
38
60
|
*/
|
|
39
61
|
readonly createProps?: any;
|
|
40
62
|
}
|
|
41
|
-
/**
|
|
63
|
+
/**
|
|
64
|
+
* Properties necessary for creating a local FluidDataStoreContext
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
42
67
|
export interface ILocalDetachedFluidDataStoreContextProps extends ILocalFluidDataStoreContextProps {
|
|
43
68
|
readonly channelToDataStoreFn: (channel: IFluidDataStoreChannel) => IDataStore;
|
|
44
69
|
}
|
|
45
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Properties necessary for creating a remote FluidDataStoreContext
|
|
72
|
+
* @internal
|
|
73
|
+
*/
|
|
46
74
|
export interface IRemoteFluidDataStoreContextProps extends IFluidDataStoreContextProps {
|
|
47
75
|
readonly snapshotTree: ISnapshotTree | undefined;
|
|
48
76
|
}
|
|
77
|
+
/** @internal */
|
|
78
|
+
export interface IFluidDataStoreContextEvents extends IEvent {
|
|
79
|
+
(event: "attaching" | "attached", listener: () => void): any;
|
|
80
|
+
}
|
|
49
81
|
/**
|
|
50
82
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
83
|
+
* @internal
|
|
51
84
|
*/
|
|
52
|
-
export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidDataStoreContextEvents> implements
|
|
85
|
+
export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IFluidDataStoreContextEvents> implements IFluidDataStoreContextInternal, IFluidParentContext, IDisposable {
|
|
53
86
|
private readonly existing;
|
|
54
87
|
readonly isLocalDataStore: boolean;
|
|
55
88
|
private readonly makeLocallyVisibleFn;
|
|
@@ -78,7 +111,7 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
78
111
|
readonly gcThrowOnTombstoneUsage: boolean;
|
|
79
112
|
readonly gcTombstoneEnforcementAllowed: boolean;
|
|
80
113
|
/** If true, this means that this data store context and its children have been removed from the runtime */
|
|
81
|
-
|
|
114
|
+
protected deleted: boolean;
|
|
82
115
|
get attachState(): AttachState;
|
|
83
116
|
get IFluidDataStoreRegistry(): IFluidDataStoreRegistry | undefined;
|
|
84
117
|
private baseSnapshotSequenceNumber;
|
|
@@ -88,7 +121,7 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
88
121
|
* 2. is root as part of the base snapshot that the datastore loaded from
|
|
89
122
|
* @returns whether a datastore is root
|
|
90
123
|
*/
|
|
91
|
-
isRoot(): Promise<boolean>;
|
|
124
|
+
isRoot(aliasedDataStores?: Set<string>): Promise<boolean>;
|
|
92
125
|
/**
|
|
93
126
|
* There are 3 states where isInMemoryRoot needs to be true
|
|
94
127
|
* 1. when a datastore becomes aliased. This can happen for both remote and local datastores
|
|
@@ -133,9 +166,10 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
133
166
|
*/
|
|
134
167
|
delete(): void;
|
|
135
168
|
setTombstone(tombstone: boolean): void;
|
|
169
|
+
abstract setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
136
170
|
private rejectDeferredRealize;
|
|
137
171
|
realize(): Promise<IFluidDataStoreChannel>;
|
|
138
|
-
protected factoryFromPackagePath(): Promise<import("@fluidframework/runtime-definitions").IFluidDataStoreFactory>;
|
|
172
|
+
protected factoryFromPackagePath(): Promise<import("@fluidframework/runtime-definitions/internal").IFluidDataStoreFactory>;
|
|
139
173
|
private realizeCore;
|
|
140
174
|
/**
|
|
141
175
|
* Notifies this object about changes in the connection state.
|
|
@@ -235,15 +269,17 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
235
269
|
/**
|
|
236
270
|
* Submits the signal to be sent to other clients.
|
|
237
271
|
* @param type - Type of the signal.
|
|
238
|
-
* @param content - Content of the signal.
|
|
272
|
+
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
239
273
|
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
240
274
|
*/
|
|
241
|
-
submitSignal(type: string, content:
|
|
275
|
+
submitSignal(type: string, content: unknown, targetClientId?: string): void;
|
|
242
276
|
/**
|
|
243
277
|
* This is called by the data store channel when it becomes locally visible indicating that it is ready to become
|
|
244
278
|
* globally visible now.
|
|
245
279
|
*/
|
|
246
280
|
makeLocallyVisible(): void;
|
|
281
|
+
protected processPendingOps(channel: IFluidDataStoreChannel): void;
|
|
282
|
+
protected completeBindingRuntime(channel: IFluidDataStoreChannel): void;
|
|
247
283
|
protected bindRuntime(channel: IFluidDataStoreChannel, existing: boolean): Promise<void>;
|
|
248
284
|
getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;
|
|
249
285
|
/**
|
|
@@ -281,10 +317,12 @@ export declare abstract class FluidDataStoreContext extends TypedEventEmitter<IF
|
|
|
281
317
|
deleteChildSummarizerNode(id: string): void;
|
|
282
318
|
uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
|
|
283
319
|
}
|
|
320
|
+
/** @internal */
|
|
284
321
|
export declare class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
285
322
|
private snapshotFetchRequired;
|
|
286
323
|
private readonly runtime;
|
|
287
324
|
constructor(props: IRemoteFluidDataStoreContextProps);
|
|
325
|
+
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
288
326
|
private readonly initialSnapshotDetailsP;
|
|
289
327
|
getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
290
328
|
/**
|
|
@@ -297,6 +335,7 @@ export declare class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
297
335
|
}
|
|
298
336
|
/**
|
|
299
337
|
* Base class for detached & attached context classes
|
|
338
|
+
* @internal
|
|
300
339
|
*/
|
|
301
340
|
export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
302
341
|
private readonly snapshotTree;
|
|
@@ -305,7 +344,7 @@ export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContex
|
|
|
305
344
|
*/
|
|
306
345
|
readonly createProps?: any;
|
|
307
346
|
constructor(props: ILocalFluidDataStoreContextProps);
|
|
308
|
-
|
|
347
|
+
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
|
|
309
348
|
/**
|
|
310
349
|
* @see FluidDataStoreContext.getAttachData
|
|
311
350
|
*/
|
|
@@ -329,6 +368,7 @@ export declare class LocalFluidDataStoreContextBase extends FluidDataStoreContex
|
|
|
329
368
|
* Various workflows (snapshot creation, requests) result in .realize() being called
|
|
330
369
|
* on context, resulting in instantiation and attachment of runtime.
|
|
331
370
|
* Runtime is created using data store factory that is associated with this context.
|
|
371
|
+
* @internal
|
|
332
372
|
*/
|
|
333
373
|
export declare class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
334
374
|
constructor(props: ILocalFluidDataStoreContextProps);
|
|
@@ -345,5 +385,4 @@ export declare class LocalDetachedFluidDataStoreContext extends LocalFluidDataSt
|
|
|
345
385
|
attachRuntime(registry: IProvideFluidDataStoreFactory, dataStoreChannel: IFluidDataStoreChannel): Promise<IDataStore>;
|
|
346
386
|
getInitialSnapshotDetails(): Promise<ISnapshotDetails>;
|
|
347
387
|
}
|
|
348
|
-
export {};
|
|
349
388
|
//# sourceMappingURL=dataStoreContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"dataStoreContext.d.ts","sourceRoot":"","sources":["../src/dataStoreContext.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EACN,WAAW,EACX,WAAW,EACX,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,SAAS,EAET,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,aAAa,EACb,UAAU,EACV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACN,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,2BAA2B,EAC3B,8BAA8B,EAE9B,qBAAqB,EACrB,UAAU,EACV,sBAAsB,EACtB,sBAAsB,EACtB,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACnB,6BAA6B,E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BAAgB,CAAC;CAQnE"}
|
package/lib/dataStoreContext.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { AttachState } from "@fluidframework/container-definitions";
|
|
6
5
|
import { TypedEventEmitter } from "@fluid-internal/client-utils";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { AttachState } from "@fluidframework/container-definitions";
|
|
7
|
+
import { assert, LazyPromise, unreachableCase } from "@fluidframework/core-utils/internal";
|
|
8
|
+
import { BlobTreeEntry, readAndParse } from "@fluidframework/driver-utils/internal";
|
|
9
|
+
import { channelsTreeName, gcDataBlobKey, } from "@fluidframework/runtime-definitions/internal";
|
|
10
|
+
import { addBlobToSummary } from "@fluidframework/runtime-utils/internal";
|
|
11
|
+
import { DataCorruptionError, DataProcessingError, LoggingError, ThresholdCounter, createChildMonitoringContext, extractSafePropertiesFromMessage, generateStack, tagCodeArtifacts, } from "@fluidframework/telemetry-utils/internal";
|
|
13
12
|
import { detectOutboundRoutesViaDDSKey, sendGCUnexpectedUsageEvent } from "./gc/index.js";
|
|
13
|
+
import { dataStoreAttributesBlobName, getAttributesFormatVersion, getFluidDataStoreAttributes, hasIsolatedChannels, summarizerClientType, wrapSummaryInChannelsTree, } from "./summary/index.js";
|
|
14
14
|
function createAttributes(pkg, isRootDataStore) {
|
|
15
15
|
const stringifiedPkg = JSON.stringify(pkg);
|
|
16
16
|
return {
|
|
@@ -25,6 +25,7 @@ export function createAttributesBlob(pkg, isRootDataStore) {
|
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Represents the context for the store. This context is passed to the store runtime.
|
|
28
|
+
* @internal
|
|
28
29
|
*/
|
|
29
30
|
export class FluidDataStoreContext extends TypedEventEmitter {
|
|
30
31
|
get packagePath() {
|
|
@@ -77,7 +78,6 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
77
78
|
return this._attachState;
|
|
78
79
|
}
|
|
79
80
|
get IFluidDataStoreRegistry() {
|
|
80
|
-
assert(this.channel !== undefined, 0x8f3 /* This should be called after the channel is created, when the registry is populated */);
|
|
81
81
|
return this.registry;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
@@ -86,8 +86,18 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
86
86
|
* 2. is root as part of the base snapshot that the datastore loaded from
|
|
87
87
|
* @returns whether a datastore is root
|
|
88
88
|
*/
|
|
89
|
-
async isRoot() {
|
|
90
|
-
|
|
89
|
+
async isRoot(aliasedDataStores) {
|
|
90
|
+
if (this.isInMemoryRoot()) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
// This if is a performance optimization.
|
|
94
|
+
// We know that if the base snapshot is omitted, then the isRootDataStore flag is not set.
|
|
95
|
+
// That means we can skip the expensive call to getInitialSnapshotDetails for virtualized datastores,
|
|
96
|
+
// and get the information from the alias map directly.
|
|
97
|
+
if (aliasedDataStores !== undefined && this.baseSnapshot?.omitted === true) {
|
|
98
|
+
return aliasedDataStores.has(this.id);
|
|
99
|
+
}
|
|
100
|
+
return (await this.getInitialSnapshotDetails()).isRootDataStore;
|
|
91
101
|
}
|
|
92
102
|
/**
|
|
93
103
|
* There are 3 states where isInMemoryRoot needs to be true
|
|
@@ -471,7 +481,7 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
471
481
|
/**
|
|
472
482
|
* Submits the signal to be sent to other clients.
|
|
473
483
|
* @param type - Type of the signal.
|
|
474
|
-
* @param content - Content of the signal.
|
|
484
|
+
* @param content - Content of the signal. Should be a JSON serializable object or primitive.
|
|
475
485
|
* @param targetClientId - When specified, the signal is only sent to the provided client id.
|
|
476
486
|
*/
|
|
477
487
|
submitSignal(type, content, targetClientId) {
|
|
@@ -487,40 +497,29 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
487
497
|
assert(this.channel !== undefined, 0x2cf /* "undefined channel on datastore context" */);
|
|
488
498
|
this.makeLocallyVisibleFn();
|
|
489
499
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
// Apply all pending ops
|
|
500
|
-
for (const op of pending) {
|
|
501
|
-
// Only process ops whose seq number is greater than snapshot sequence number from which it loaded.
|
|
502
|
-
const seqNumber = this.baseSnapshotSequenceNumber ?? -1;
|
|
503
|
-
if (op.sequenceNumber > seqNumber) {
|
|
504
|
-
channel.process(op, false, undefined /* localOpMetadata */);
|
|
505
|
-
}
|
|
500
|
+
processPendingOps(channel) {
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
502
|
+
const pending = this.pending;
|
|
503
|
+
// Apply all pending ops
|
|
504
|
+
for (const op of pending) {
|
|
505
|
+
// Only process ops whose seq number is greater than snapshot sequence number from which it loaded.
|
|
506
|
+
const seqNumber = this.baseSnapshotSequenceNumber ?? -1;
|
|
507
|
+
if (op.sequenceNumber > seqNumber) {
|
|
508
|
+
channel.process(op, false, undefined /* localOpMetadata */);
|
|
506
509
|
}
|
|
507
|
-
this.thresholdOpsCounter.send("ProcessPendingOps", pending.length);
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
assert(this.pending?.length === 0, 0x8f4 /* no pending ops */);
|
|
511
|
-
// Execute data store's entry point to make sure that for a local (aka detached from container) data store, the
|
|
512
|
-
// entryPoint initialization function is called before the data store gets attached and potentially connected to
|
|
513
|
-
// the delta stream, so it gets a chance to do things while the data store is still "purely local".
|
|
514
|
-
// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method
|
|
515
|
-
// of data store factories tends to construct the data object (at least kick off an async method that returns
|
|
516
|
-
// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
|
|
517
|
-
// before the data store is attached.
|
|
518
|
-
await channel.entryPoint.get();
|
|
519
510
|
}
|
|
520
511
|
this.pending = undefined;
|
|
512
|
+
this.thresholdOpsCounter.send("ProcessPendingOps", pending.length);
|
|
513
|
+
}
|
|
514
|
+
completeBindingRuntime(channel) {
|
|
521
515
|
// And now mark the runtime active
|
|
522
516
|
this.loaded = true;
|
|
523
517
|
this.channel = channel;
|
|
518
|
+
// Channel does not know when it's "live" (as in - starts to receive events in the system)
|
|
519
|
+
// It may read current state of the system when channel was created, but it was not getting any updates
|
|
520
|
+
// through creation process and could have missed events. So update it on current state.
|
|
521
|
+
// Once this.loaded is set (above), it will stat receiving events.
|
|
522
|
+
channel.setConnectionState(this.connected, this.clientId);
|
|
524
523
|
// Freeze the package path to ensure that someone doesn't modify it when it is
|
|
525
524
|
// returned in packagePath().
|
|
526
525
|
Object.freeze(this.pkg);
|
|
@@ -533,6 +532,25 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
533
532
|
*/
|
|
534
533
|
this.updateChannelUsedRoutes();
|
|
535
534
|
}
|
|
535
|
+
async bindRuntime(channel, existing) {
|
|
536
|
+
if (this.channel) {
|
|
537
|
+
throw new Error("Runtime already bound");
|
|
538
|
+
}
|
|
539
|
+
assert(!this.detachedRuntimeCreation, 0x148 /* "Detached runtime creation on runtime bind" */);
|
|
540
|
+
assert(this.pkg !== undefined, 0x14a /* "Undefined package path" */);
|
|
541
|
+
if (!existing) {
|
|
542
|
+
// Execute data store's entry point to make sure that for a local (aka detached from container) data store, the
|
|
543
|
+
// entryPoint initialization function is called before the data store gets attached and potentially connected to
|
|
544
|
+
// the delta stream, so it gets a chance to do things while the data store is still "purely local".
|
|
545
|
+
// This preserves the behavior from before we introduced entryPoints, where the instantiateDataStore method
|
|
546
|
+
// of data store factories tends to construct the data object (at least kick off an async method that returns
|
|
547
|
+
// it); that code moved to the entryPoint initialization function, so we want to ensure it still executes
|
|
548
|
+
// before the data store is attached.
|
|
549
|
+
await channel.entryPoint.get();
|
|
550
|
+
}
|
|
551
|
+
this.processPendingOps(channel);
|
|
552
|
+
this.completeBindingRuntime(channel);
|
|
553
|
+
}
|
|
536
554
|
async getAbsoluteUrl(relativeUrl) {
|
|
537
555
|
if (this.attachState !== AttachState.Attached) {
|
|
538
556
|
return undefined;
|
|
@@ -632,6 +650,7 @@ export class FluidDataStoreContext extends TypedEventEmitter {
|
|
|
632
650
|
}
|
|
633
651
|
}
|
|
634
652
|
FluidDataStoreContext.pendingOpsCountThreshold = 1000;
|
|
653
|
+
/** @internal */
|
|
635
654
|
export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
636
655
|
constructor(props) {
|
|
637
656
|
super(props, true /* existing */, false /* isLocalDataStore */, () => {
|
|
@@ -692,6 +711,17 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
692
711
|
this.summarizerNode.updateBaseSummaryState(props.snapshotTree);
|
|
693
712
|
}
|
|
694
713
|
}
|
|
714
|
+
/*
|
|
715
|
+
This API should not be called for RemoteFluidDataStoreContext. But here is one scenario where it's not the case:
|
|
716
|
+
The scenario (hit by stashedOps.spec.ts, "resends attach op" UT is the following (as far as I understand):
|
|
717
|
+
1. data store is being attached in attached container
|
|
718
|
+
2. container state is serialized (stashed ops feature)
|
|
719
|
+
3. new container instance is rehydrated (from stashed ops)
|
|
720
|
+
- As result, we create RemoteFluidDataStoreContext for this data store that is actually in "attaching" state (as of # 2).
|
|
721
|
+
But its state is set to attached when loading container from stashed ops
|
|
722
|
+
4. attach op for this data store is processed - setAttachState() is called.
|
|
723
|
+
*/
|
|
724
|
+
setAttachState(attachState) { }
|
|
695
725
|
async getInitialSnapshotDetails() {
|
|
696
726
|
return this.initialSnapshotDetailsP;
|
|
697
727
|
}
|
|
@@ -704,10 +734,11 @@ export class RemoteFluidDataStoreContext extends FluidDataStoreContext {
|
|
|
704
734
|
}
|
|
705
735
|
/**
|
|
706
736
|
* Base class for detached & attached context classes
|
|
737
|
+
* @internal
|
|
707
738
|
*/
|
|
708
739
|
export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
709
740
|
constructor(props) {
|
|
710
|
-
super(props, props.snapshotTree !== undefined
|
|
741
|
+
super(props, props.snapshotTree !== undefined /* existing */, true /* isLocalDataStore */, props.makeLocallyVisibleFn);
|
|
711
742
|
this.initialSnapshotDetailsP = new LazyPromise(async () => {
|
|
712
743
|
let snapshot = this.snapshotTree;
|
|
713
744
|
let attributes;
|
|
@@ -741,21 +772,46 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
741
772
|
// Summarizer client should not create local data stores.
|
|
742
773
|
this.identifyLocalChangeInSummarizer("DataStoreCreatedInSummarizer");
|
|
743
774
|
this.snapshotTree = props.snapshotTree;
|
|
744
|
-
if (props.isRootDataStore === true) {
|
|
745
|
-
this.setInMemoryRoot();
|
|
746
|
-
}
|
|
747
775
|
this.createProps = props.createProps;
|
|
748
|
-
this.attachListeners();
|
|
749
776
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
777
|
+
setAttachState(attachState) {
|
|
778
|
+
switch (attachState) {
|
|
779
|
+
case AttachState.Attaching:
|
|
780
|
+
assert(this.attachState === AttachState.Detached, 0x14d /* "Should move from detached to attaching" */);
|
|
781
|
+
this._attachState = AttachState.Attaching;
|
|
782
|
+
if (this.channel?.setAttachState) {
|
|
783
|
+
this.channel.setAttachState(attachState);
|
|
784
|
+
}
|
|
785
|
+
else if (this.channel) {
|
|
786
|
+
// back-compat! To be removed in the future
|
|
787
|
+
// Added in "2.0.0-rc.2.0.0" timeframe.
|
|
788
|
+
this.emit("attaching");
|
|
789
|
+
}
|
|
790
|
+
break;
|
|
791
|
+
case AttachState.Attached:
|
|
792
|
+
// We can get called into here twice, as result of both container and data store being attached, if
|
|
793
|
+
// those processes overlapped, for example, in a flow like that one:
|
|
794
|
+
// 1. Container attach started
|
|
795
|
+
// 2. data store attachment started
|
|
796
|
+
// 3. container attached
|
|
797
|
+
// 4. data store attached.
|
|
798
|
+
if (this.attachState !== AttachState.Attached) {
|
|
799
|
+
assert(this.attachState === AttachState.Attaching, 0x14e /* "Should move from attaching to attached" */);
|
|
800
|
+
this._attachState = AttachState.Attached;
|
|
801
|
+
this.channel?.setAttachState?.(attachState);
|
|
802
|
+
if (this.channel?.setAttachState) {
|
|
803
|
+
this.channel.setAttachState(attachState);
|
|
804
|
+
}
|
|
805
|
+
else if (this.channel) {
|
|
806
|
+
// back-compat! To be removed in the future
|
|
807
|
+
// Added in "2.0.0-rc.2.0.0" timeframe.
|
|
808
|
+
this.emit("attached");
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
break;
|
|
812
|
+
default:
|
|
813
|
+
unreachableCase(attachState, "unreached");
|
|
814
|
+
}
|
|
759
815
|
}
|
|
760
816
|
/**
|
|
761
817
|
* @see FluidDataStoreContext.getAttachData
|
|
@@ -810,6 +866,7 @@ export class LocalFluidDataStoreContextBase extends FluidDataStoreContext {
|
|
|
810
866
|
* Various workflows (snapshot creation, requests) result in .realize() being called
|
|
811
867
|
* on context, resulting in instantiation and attachment of runtime.
|
|
812
868
|
* Runtime is created using data store factory that is associated with this context.
|
|
869
|
+
* @internal
|
|
813
870
|
*/
|
|
814
871
|
export class LocalFluidDataStoreContext extends LocalFluidDataStoreContextBase {
|
|
815
872
|
constructor(props) {
|