@fluidframework/container-runtime 2.0.0-rc.1.0.3 → 2.0.0-rc.2.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/{.eslintrc.js → .eslintrc.cjs} +5 -5
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +54 -0
- package/README.md +45 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +68 -30
- package/dist/batchTracker.d.ts +1 -2
- package/dist/batchTracker.d.ts.map +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.js.map +1 -1
- package/dist/channelCollection.d.ts +223 -0
- package/dist/channelCollection.d.ts.map +1 -0
- package/dist/{dataStores.js → channelCollection.js} +399 -83
- package/dist/channelCollection.js.map +1 -0
- package/dist/connectionTelemetry.d.ts +11 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +42 -4
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +98 -40
- package/dist/container-runtime-beta.d.ts +27 -9
- package/dist/container-runtime-public.d.ts +27 -9
- package/dist/container-runtime-untrimmed.d.ts +123 -40
- package/dist/containerHandleContext.d.ts +1 -1
- package/dist/containerHandleContext.d.ts.map +1 -1
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +79 -55
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +541 -411
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts +2 -3
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +12 -11
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +71 -30
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +182 -141
- 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.map +1 -1
- package/dist/deltaManagerSummarizerProxy.d.ts +29 -4
- package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +91 -5
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +22 -5
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +134 -75
- 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 +21 -21
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +29 -6
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +5 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcHelpers.d.ts +2 -2
- package/dist/gc/gcHelpers.d.ts.map +1 -1
- package/dist/gc/gcHelpers.js.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -1
- package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
- package/dist/gc/gcSummaryStateTracker.d.ts +12 -5
- package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
- package/dist/gc/gcSummaryStateTracker.js +18 -6
- package/dist/gc/gcSummaryStateTracker.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +7 -7
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +20 -20
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts +6 -1
- package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +22 -11
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +8 -8
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +40 -38
- package/dist/gc/index.js.map +1 -1
- package/dist/index.d.ts +8 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -40
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +4 -4
- package/dist/messageTypes.d.ts.map +1 -1
- package/dist/messageTypes.js.map +1 -1
- package/dist/opLifecycle/batchManager.d.ts +2 -2
- package/dist/opLifecycle/batchManager.d.ts.map +1 -1
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +2 -2
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/index.d.ts +8 -8
- package/dist/opLifecycle/index.d.ts.map +1 -1
- package/dist/opLifecycle/index.js +18 -18
- package/dist/opLifecycle/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +4 -4
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +3 -3
- 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 +1 -10
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +5 -5
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +7 -7
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +20 -12
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +4 -4
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +2 -2
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/package.json +3 -0
- 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 +2 -1
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +18 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts +1 -2
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +5 -5
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +12 -12
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +43 -43
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.js +8 -8
- 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.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +11 -10
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +114 -81
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +4 -4
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +6 -6
- 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 +3 -3
- package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/index.d.ts +3 -3
- package/dist/summary/summarizerNode/index.d.ts.map +1 -1
- package/dist/summary/summarizerNode/index.js +4 -4
- package/dist/summary/summarizerNode/index.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +17 -7
- package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +45 -57
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +10 -19
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +1 -21
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +5 -6
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js +16 -16
- package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +10 -21
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +15 -2
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +6 -5
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +10 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +5 -6
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +4 -5
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/{batchTracker.d.mts → batchTracker.d.ts} +2 -3
- package/lib/batchTracker.d.ts.map +1 -0
- package/lib/{batchTracker.mjs → batchTracker.js} +1 -1
- package/lib/batchTracker.js.map +1 -0
- package/lib/{blobManager.d.mts → blobManager.d.ts} +1 -1
- package/lib/blobManager.d.ts.map +1 -0
- package/lib/{blobManager.mjs → blobManager.js} +1 -1
- package/lib/blobManager.js.map +1 -0
- package/lib/channelCollection.d.ts +223 -0
- package/lib/channelCollection.d.ts.map +1 -0
- package/lib/{dataStores.mjs → channelCollection.js} +384 -71
- package/lib/channelCollection.js.map +1 -0
- package/lib/{connectionTelemetry.d.mts → connectionTelemetry.d.ts} +12 -2
- package/lib/connectionTelemetry.d.ts.map +1 -0
- package/lib/{connectionTelemetry.mjs → connectionTelemetry.js} +43 -5
- package/lib/connectionTelemetry.js.map +1 -0
- package/lib/{container-runtime-alpha.d.mts → container-runtime-alpha.d.ts} +98 -40
- package/lib/{container-runtime-public.d.mts → container-runtime-beta.d.ts} +27 -9
- package/lib/{container-runtime-beta.d.mts → container-runtime-public.d.ts} +27 -9
- package/lib/{container-runtime-untrimmed.d.mts → container-runtime-untrimmed.d.ts} +123 -40
- package/lib/{containerHandleContext.d.mts → containerHandleContext.d.ts} +2 -2
- package/lib/containerHandleContext.d.ts.map +1 -0
- package/lib/{containerHandleContext.mjs → containerHandleContext.js} +1 -1
- package/lib/containerHandleContext.js.map +1 -0
- package/lib/{containerRuntime.d.mts → containerRuntime.d.ts} +84 -56
- package/lib/containerRuntime.d.ts.map +1 -0
- package/lib/{containerRuntime.mjs → containerRuntime.js} +460 -332
- package/lib/containerRuntime.js.map +1 -0
- package/lib/{dataStore.d.mts → dataStore.d.ts} +3 -4
- package/lib/dataStore.d.ts.map +1 -0
- package/lib/{dataStore.mjs → dataStore.js} +13 -12
- package/lib/dataStore.js.map +1 -0
- package/lib/{dataStoreContext.d.mts → dataStoreContext.d.ts} +72 -31
- package/lib/dataStoreContext.d.ts.map +1 -0
- package/lib/{dataStoreContext.mjs → dataStoreContext.js} +174 -133
- package/lib/dataStoreContext.js.map +1 -0
- package/lib/{dataStoreContexts.d.mts → dataStoreContexts.d.ts} +2 -2
- package/lib/dataStoreContexts.d.ts.map +1 -0
- package/lib/{dataStoreContexts.mjs → dataStoreContexts.js} +1 -1
- package/lib/dataStoreContexts.js.map +1 -0
- package/lib/{dataStoreRegistry.d.mts → dataStoreRegistry.d.ts} +1 -1
- package/lib/dataStoreRegistry.d.ts.map +1 -0
- package/lib/{dataStoreRegistry.mjs → dataStoreRegistry.js} +5 -1
- package/lib/dataStoreRegistry.js.map +1 -0
- package/{dist/deltaManagerProxyBase.d.ts → lib/deltaManagerSummarizerProxy.d.ts} +16 -7
- package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -0
- package/lib/deltaManagerSummarizerProxy.js +124 -0
- package/lib/deltaManagerSummarizerProxy.js.map +1 -0
- package/lib/{deltaScheduler.d.mts → deltaScheduler.d.ts} +1 -1
- package/lib/deltaScheduler.d.ts.map +1 -0
- package/lib/{deltaScheduler.mjs → deltaScheduler.js} +1 -1
- package/lib/deltaScheduler.js.map +1 -0
- package/lib/{error.d.mts → error.d.ts} +1 -1
- package/lib/error.d.ts.map +1 -0
- package/lib/{error.mjs → error.js} +1 -1
- package/lib/error.js.map +1 -0
- package/lib/gc/{garbageCollection.d.mts → garbageCollection.d.ts} +23 -6
- package/lib/gc/garbageCollection.d.ts.map +1 -0
- package/lib/gc/{garbageCollection.mjs → garbageCollection.js} +103 -44
- package/lib/gc/garbageCollection.js.map +1 -0
- package/lib/gc/{gcConfigs.d.mts → gcConfigs.d.ts} +3 -3
- package/lib/gc/gcConfigs.d.ts.map +1 -0
- package/lib/gc/{gcConfigs.mjs → gcConfigs.js} +3 -3
- package/lib/gc/gcConfigs.js.map +1 -0
- package/lib/gc/{gcDefinitions.d.mts → gcDefinitions.d.ts} +30 -7
- package/lib/gc/gcDefinitions.d.ts.map +1 -0
- package/lib/gc/{gcDefinitions.mjs → gcDefinitions.js} +5 -1
- package/lib/gc/gcDefinitions.js.map +1 -0
- package/lib/gc/{gcHelpers.d.mts → gcHelpers.d.ts} +3 -3
- package/lib/gc/{gcHelpers.d.mts.map → gcHelpers.d.ts.map} +1 -1
- package/lib/gc/{gcHelpers.mjs → gcHelpers.js} +1 -1
- package/lib/gc/gcHelpers.js.map +1 -0
- package/lib/gc/{gcReferenceGraphAlgorithm.d.mts → gcReferenceGraphAlgorithm.d.ts} +2 -2
- package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +1 -0
- package/lib/gc/{gcReferenceGraphAlgorithm.mjs → gcReferenceGraphAlgorithm.js} +1 -1
- package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -0
- package/lib/gc/{gcSummaryDefinitions.d.mts → gcSummaryDefinitions.d.ts} +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -0
- package/lib/gc/{gcSummaryDefinitions.mjs → gcSummaryDefinitions.js} +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -0
- package/lib/gc/{gcSummaryStateTracker.d.mts → gcSummaryStateTracker.d.ts} +13 -6
- package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -0
- package/lib/gc/{gcSummaryStateTracker.mjs → gcSummaryStateTracker.js} +17 -5
- package/lib/gc/gcSummaryStateTracker.js.map +1 -0
- package/lib/gc/{gcTelemetry.d.mts → gcTelemetry.d.ts} +8 -8
- package/lib/gc/gcTelemetry.d.ts.map +1 -0
- package/lib/gc/{gcTelemetry.mjs → gcTelemetry.js} +5 -5
- package/lib/gc/gcTelemetry.js.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.d.mts → gcUnreferencedStateTracker.d.ts} +7 -2
- package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -0
- package/lib/gc/{gcUnreferencedStateTracker.mjs → gcUnreferencedStateTracker.js} +12 -2
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -0
- package/lib/gc/{index.d.mts → index.d.ts} +9 -9
- package/lib/gc/index.d.ts.map +1 -0
- package/lib/gc/{index.mjs → index.js} +8 -8
- package/lib/gc/index.js.map +1 -0
- package/lib/{index.d.mts → index.d.ts} +9 -21
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -0
- package/lib/{messageTypes.d.mts → messageTypes.d.ts} +5 -5
- package/lib/messageTypes.d.ts.map +1 -0
- package/lib/{messageTypes.mjs → messageTypes.js} +1 -1
- package/lib/messageTypes.js.map +1 -0
- package/lib/{metadata.d.mts → metadata.d.ts} +1 -1
- package/lib/metadata.d.ts.map +1 -0
- package/lib/{metadata.mjs → metadata.js} +1 -1
- package/lib/metadata.js.map +1 -0
- package/lib/opLifecycle/{batchManager.d.mts → batchManager.d.ts} +3 -3
- package/lib/opLifecycle/batchManager.d.ts.map +1 -0
- package/lib/opLifecycle/{batchManager.mjs → batchManager.js} +1 -1
- package/lib/opLifecycle/batchManager.js.map +1 -0
- package/lib/opLifecycle/{definitions.d.mts → definitions.d.ts} +3 -3
- package/lib/opLifecycle/definitions.d.ts.map +1 -0
- package/lib/opLifecycle/{definitions.mjs → definitions.js} +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -0
- package/lib/opLifecycle/index.d.ts +13 -0
- package/lib/opLifecycle/index.d.ts.map +1 -0
- package/lib/opLifecycle/index.js +12 -0
- package/lib/opLifecycle/index.js.map +1 -0
- package/lib/opLifecycle/{opCompressor.d.mts → opCompressor.d.ts} +2 -2
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -0
- package/lib/opLifecycle/{opCompressor.mjs → opCompressor.js} +3 -3
- package/lib/opLifecycle/opCompressor.js.map +1 -0
- package/lib/opLifecycle/{opDecompressor.d.mts → opDecompressor.d.ts} +2 -2
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -0
- package/lib/opLifecycle/{opDecompressor.mjs → opDecompressor.js} +2 -2
- package/lib/opLifecycle/opDecompressor.js.map +1 -0
- package/lib/opLifecycle/{opGroupingManager.d.mts → opGroupingManager.d.ts} +2 -2
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -0
- package/lib/opLifecycle/{opGroupingManager.mjs → opGroupingManager.js} +2 -11
- package/lib/opLifecycle/opGroupingManager.js.map +1 -0
- package/lib/opLifecycle/{opSplitter.d.mts → opSplitter.d.ts} +2 -2
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -0
- package/lib/opLifecycle/{opSplitter.mjs → opSplitter.js} +3 -3
- package/lib/opLifecycle/opSplitter.js.map +1 -0
- package/lib/opLifecycle/{outbox.d.mts → outbox.d.ts} +8 -8
- package/lib/opLifecycle/outbox.d.ts.map +1 -0
- package/lib/opLifecycle/{outbox.mjs → outbox.js} +12 -4
- package/lib/opLifecycle/outbox.js.map +1 -0
- package/lib/opLifecycle/{remoteMessageProcessor.d.mts → remoteMessageProcessor.d.ts} +5 -5
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -0
- package/lib/opLifecycle/{remoteMessageProcessor.mjs → remoteMessageProcessor.js} +2 -2
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -0
- package/lib/{opProperties.d.mts → opProperties.d.ts} +1 -1
- package/lib/opProperties.d.ts.map +1 -0
- package/lib/{opProperties.mjs → opProperties.js} +1 -1
- package/lib/opProperties.js.map +1 -0
- package/lib/{packageVersion.d.mts → packageVersion.d.ts} +2 -2
- package/lib/packageVersion.d.ts.map +1 -0
- package/lib/{packageVersion.mjs → packageVersion.js} +2 -2
- package/lib/packageVersion.js.map +1 -0
- package/lib/{pendingStateManager.d.mts → pendingStateManager.d.ts} +3 -2
- package/lib/pendingStateManager.d.ts.map +1 -0
- package/lib/{pendingStateManager.mjs → pendingStateManager.js} +18 -10
- package/lib/pendingStateManager.js.map +1 -0
- package/lib/{scheduleManager.d.mts → scheduleManager.d.ts} +6 -3
- package/lib/scheduleManager.d.ts.map +1 -0
- package/lib/{scheduleManager.mjs → scheduleManager.js} +3 -3
- package/lib/scheduleManager.js.map +1 -0
- package/lib/{storageServiceWithAttachBlobs.d.mts → storageServiceWithAttachBlobs.d.ts} +1 -1
- package/lib/storageServiceWithAttachBlobs.d.ts.map +1 -0
- package/lib/{storageServiceWithAttachBlobs.mjs → storageServiceWithAttachBlobs.js} +1 -1
- package/lib/storageServiceWithAttachBlobs.js.map +1 -0
- package/lib/summary/{index.d.mts → index.d.ts} +13 -13
- package/lib/summary/index.d.ts.map +1 -0
- package/lib/summary/{index.mjs → index.js} +12 -12
- package/lib/summary/index.js.map +1 -0
- package/lib/summary/{orderedClientElection.d.mts → orderedClientElection.d.ts} +5 -1
- package/lib/summary/orderedClientElection.d.ts.map +1 -0
- package/lib/summary/{orderedClientElection.mjs → orderedClientElection.js} +2 -2
- package/lib/summary/orderedClientElection.js.map +1 -0
- package/lib/summary/{runWhileConnectedCoordinator.d.mts → runWhileConnectedCoordinator.d.ts} +2 -2
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -0
- package/lib/summary/{runWhileConnectedCoordinator.mjs → runWhileConnectedCoordinator.js} +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -0
- package/lib/summary/{runningSummarizer.d.mts → runningSummarizer.d.ts} +12 -11
- package/lib/summary/runningSummarizer.d.ts.map +1 -0
- package/lib/summary/{runningSummarizer.mjs → runningSummarizer.js} +108 -75
- package/lib/summary/runningSummarizer.js.map +1 -0
- package/lib/summary/{summarizer.d.mts → summarizer.d.ts} +5 -5
- package/lib/summary/summarizer.d.ts.map +1 -0
- package/lib/summary/{summarizer.mjs → summarizer.js} +4 -4
- package/lib/summary/summarizer.js.map +1 -0
- package/lib/summary/{summarizerClientElection.d.mts → summarizerClientElection.d.ts} +3 -3
- package/lib/summary/summarizerClientElection.d.ts.map +1 -0
- package/lib/summary/{summarizerClientElection.mjs → summarizerClientElection.js} +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -0
- package/lib/summary/{summarizerHeuristics.d.mts → summarizerHeuristics.d.ts} +4 -4
- package/lib/summary/summarizerHeuristics.d.ts.map +1 -0
- package/lib/summary/{summarizerHeuristics.mjs → summarizerHeuristics.js} +1 -1
- package/lib/summary/summarizerHeuristics.js.map +1 -0
- package/lib/summary/summarizerNode/{index.d.mts → index.d.ts} +4 -4
- package/lib/summary/summarizerNode/index.d.ts.map +1 -0
- package/lib/summary/summarizerNode/index.js +7 -0
- package/lib/summary/summarizerNode/index.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.d.mts → summarizerNode.d.ts} +18 -8
- package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNode.mjs → summarizerNode.js} +41 -53
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.d.mts → summarizerNodeUtils.d.ts} +11 -20
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeUtils.mjs → summarizerNodeUtils.js} +1 -20
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.d.mts → summarizerNodeWithGc.d.ts} +6 -7
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -0
- package/lib/summary/summarizerNode/{summarizerNodeWithGc.mjs → summarizerNodeWithGc.js} +12 -12
- package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -0
- package/lib/summary/{summarizerTypes.d.mts → summarizerTypes.d.ts} +11 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -0
- package/lib/summary/{summarizerTypes.mjs → summarizerTypes.js} +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -0
- package/lib/summary/{summaryCollection.d.mts → summaryCollection.d.ts} +1 -1
- package/lib/summary/summaryCollection.d.ts.map +1 -0
- package/lib/summary/{summaryCollection.mjs → summaryCollection.js} +1 -1
- package/lib/summary/summaryCollection.js.map +1 -0
- package/lib/summary/{summaryFormat.d.mts → summaryFormat.d.ts} +16 -3
- package/lib/summary/summaryFormat.d.ts.map +1 -0
- package/lib/summary/{summaryFormat.mjs → summaryFormat.js} +1 -1
- package/lib/summary/summaryFormat.js.map +1 -0
- package/lib/summary/{summaryGenerator.d.mts → summaryGenerator.d.ts} +7 -6
- package/lib/summary/summaryGenerator.d.ts.map +1 -0
- package/lib/summary/{summaryGenerator.mjs → summaryGenerator.js} +11 -2
- package/lib/summary/summaryGenerator.js.map +1 -0
- package/lib/summary/{summaryManager.d.mts → summaryManager.d.ts} +6 -7
- package/lib/summary/summaryManager.d.ts.map +1 -0
- package/lib/summary/{summaryManager.mjs → summaryManager.js} +4 -5
- package/lib/summary/summaryManager.js.map +1 -0
- package/lib/test/batchTracker.spec.js +88 -0
- package/lib/test/batchTracker.spec.js.map +1 -0
- package/lib/test/blobManager.spec.js +835 -0
- package/lib/test/blobManager.spec.js.map +1 -0
- package/lib/test/channelCollection.spec.js +141 -0
- package/lib/test/channelCollection.spec.js.map +1 -0
- package/lib/test/containerRuntime.spec.js +1748 -0
- package/lib/test/containerRuntime.spec.js.map +1 -0
- package/lib/test/dataStoreContext.spec.js +801 -0
- package/lib/test/dataStoreContext.spec.js.map +1 -0
- package/lib/test/dataStoreCreation.spec.js +312 -0
- package/lib/test/dataStoreCreation.spec.js.map +1 -0
- package/lib/test/dataStoreRegistry.spec.js +26 -0
- package/lib/test/dataStoreRegistry.spec.js.map +1 -0
- package/lib/test/fuzz/fuzzUtils.js +66 -0
- package/lib/test/fuzz/fuzzUtils.js.map +1 -0
- package/lib/test/fuzz/summarizer.fuzz.spec.js +31 -0
- package/lib/test/fuzz/summarizer.fuzz.spec.js.map +1 -0
- package/lib/test/fuzz/summarizerFuzzMocks.js +162 -0
- package/lib/test/fuzz/summarizerFuzzMocks.js.map +1 -0
- package/lib/test/fuzz/summarizerFuzzSuite.js +106 -0
- package/lib/test/fuzz/summarizerFuzzSuite.js.map +1 -0
- package/lib/test/gc/garbageCollection.spec.js +1465 -0
- package/lib/test/gc/garbageCollection.spec.js.map +1 -0
- package/lib/test/gc/gcConfigs.spec.js +690 -0
- package/lib/test/gc/gcConfigs.spec.js.map +1 -0
- package/lib/test/gc/gcHelpers.spec.js +110 -0
- package/lib/test/gc/gcHelpers.spec.js.map +1 -0
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js +68 -0
- package/lib/test/gc/gcReferenceGraphAlgorithm.spec.js.map +1 -0
- package/lib/test/gc/gcStats.spec.js +391 -0
- package/lib/test/gc/gcStats.spec.js.map +1 -0
- package/lib/test/gc/gcSummaryStateTracker.spec.js +228 -0
- package/lib/test/gc/gcSummaryStateTracker.spec.js.map +1 -0
- package/lib/test/gc/gcTelemetry.spec.js +530 -0
- package/lib/test/gc/gcTelemetry.spec.js.map +1 -0
- package/lib/test/gc/gcUnitTestHelpers.js +29 -0
- package/lib/test/gc/gcUnitTestHelpers.js.map +1 -0
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js +192 -0
- package/lib/test/gc/gcUnreferencedStateTracker.spec.js.map +1 -0
- package/lib/test/getPendingBlobs.spec.js +193 -0
- package/lib/test/getPendingBlobs.spec.js.map +1 -0
- package/lib/test/hardwareStats.spec.js +93 -0
- package/lib/test/hardwareStats.spec.js.map +1 -0
- package/lib/test/index.js +6 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/opLifecycle/OpGroupingManager.spec.js +225 -0
- package/lib/test/opLifecycle/OpGroupingManager.spec.js.map +1 -0
- package/lib/test/opLifecycle/batchManager.spec.js +189 -0
- package/lib/test/opLifecycle/batchManager.spec.js.map +1 -0
- package/lib/test/opLifecycle/opCompressor.spec.js +74 -0
- package/lib/test/opLifecycle/opCompressor.spec.js.map +1 -0
- package/lib/test/opLifecycle/opDecompressor.spec.js +218 -0
- package/lib/test/opLifecycle/opDecompressor.spec.js.map +1 -0
- package/lib/test/opLifecycle/opSplitter.spec.js +272 -0
- package/lib/test/opLifecycle/opSplitter.spec.js.map +1 -0
- package/lib/test/opLifecycle/outbox.spec.js +675 -0
- package/lib/test/opLifecycle/outbox.spec.js.map +1 -0
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js +196 -0
- package/lib/test/opLifecycle/remoteMessageProcessor.spec.js.map +1 -0
- package/lib/test/pendingStateManager.spec.js +329 -0
- package/lib/test/pendingStateManager.spec.js.map +1 -0
- package/lib/test/scheduleManager.spec.js +270 -0
- package/lib/test/scheduleManager.spec.js.map +1 -0
- package/lib/test/summarizerNode.spec.js +326 -0
- package/lib/test/summarizerNode.spec.js.map +1 -0
- package/lib/test/summarizerNodeWithGc.spec.js +318 -0
- package/lib/test/summarizerNodeWithGc.spec.js.map +1 -0
- package/lib/test/summary/orderedClientElection.spec.js +535 -0
- package/lib/test/summary/orderedClientElection.spec.js.map +1 -0
- package/lib/test/summary/runningSummarizer.spec.js +1349 -0
- package/lib/test/summary/runningSummarizer.spec.js.map +1 -0
- package/lib/test/summary/summarizer.spec.js +29 -0
- package/lib/test/summary/summarizer.spec.js.map +1 -0
- package/lib/test/summary/summarizerClientElection.spec.js +436 -0
- package/lib/test/summary/summarizerClientElection.spec.js.map +1 -0
- package/lib/test/summary/summarizerHeuristics.spec.js +289 -0
- package/lib/test/summary/summarizerHeuristics.spec.js.map +1 -0
- package/lib/test/summary/summaryCollection.spec.js +200 -0
- package/lib/test/summary/summaryCollection.spec.js.map +1 -0
- package/lib/test/summary/summaryManager.spec.js +430 -0
- package/lib/test/summary/summaryManager.spec.js.map +1 -0
- package/lib/test/summary/testQuorumClients.js +34 -0
- package/lib/test/summary/testQuorumClients.js.map +1 -0
- package/lib/test/throttler.spec.js +175 -0
- package/lib/test/throttler.spec.js.map +1 -0
- package/lib/test/types/validateContainerRuntimePrevious.generated.js +180 -0
- package/lib/test/types/validateContainerRuntimePrevious.generated.js.map +1 -0
- package/lib/{throttler.d.mts → throttler.d.ts} +1 -1
- package/lib/throttler.d.ts.map +1 -0
- package/lib/{throttler.mjs → throttler.js} +1 -1
- package/lib/throttler.js.map +1 -0
- package/package.json +99 -88
- package/src/batchTracker.ts +1 -1
- package/src/blobManager.ts +1 -1
- package/src/{dataStores.ts → channelCollection.ts} +520 -84
- package/src/connectionTelemetry.ts +42 -3
- package/src/containerHandleContext.ts +1 -1
- package/src/containerRuntime.ts +661 -464
- package/src/dataStore.ts +13 -15
- package/src/dataStoreContext.ts +257 -184
- package/src/dataStoreContexts.ts +1 -1
- package/src/deltaManagerSummarizerProxy.ts +132 -7
- package/src/gc/garbageCollection.ts +121 -46
- package/src/gc/gcConfigs.ts +3 -3
- package/src/gc/gcDefinitions.ts +30 -7
- package/src/gc/gcHelpers.ts +2 -2
- package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
- package/src/gc/gcSummaryStateTracker.ts +19 -7
- package/src/gc/gcTelemetry.ts +10 -9
- package/src/gc/gcUnreferencedStateTracker.ts +12 -1
- package/src/gc/index.ts +10 -8
- package/src/index.ts +16 -27
- package/src/messageTypes.ts +4 -4
- package/src/opLifecycle/README.md +2 -4
- package/src/opLifecycle/batchManager.ts +2 -2
- package/src/opLifecycle/definitions.ts +2 -2
- package/src/opLifecycle/index.ts +8 -8
- package/src/opLifecycle/opCompressor.ts +3 -3
- package/src/opLifecycle/opDecompressor.ts +3 -3
- package/src/opLifecycle/opGroupingManager.ts +3 -12
- package/src/opLifecycle/opSplitter.ts +3 -3
- package/src/opLifecycle/outbox.ts +29 -9
- package/src/opLifecycle/remoteMessageProcessor.ts +4 -4
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +19 -13
- package/src/scheduleManager.ts +4 -4
- package/src/summary/index.ts +13 -12
- package/src/summary/orderedClientElection.ts +1 -1
- package/src/summary/runWhileConnectedCoordinator.ts +1 -1
- package/src/summary/runningSummarizer.ts +141 -93
- package/src/summary/summarizer.ts +7 -7
- package/src/summary/summarizerClientElection.ts +2 -2
- package/src/summary/summarizerHeuristics.ts +3 -3
- package/src/summary/summarizerNode/index.ts +6 -3
- package/src/summary/summarizerNode/summarizerNode.ts +54 -69
- package/src/summary/summarizerNode/summarizerNodeUtils.ts +16 -34
- package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -17
- package/src/summary/summarizerTypes.ts +12 -24
- package/src/summary/summaryFormat.ts +16 -2
- package/src/summary/summaryGenerator.ts +16 -4
- package/src/summary/summaryManager.ts +6 -7
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +2 -5
- package/dist/dataStores.d.ts +0 -149
- package/dist/dataStores.d.ts.map +0 -1
- package/dist/dataStores.js.map +0 -1
- package/dist/deltaManagerProxyBase.d.ts.map +0 -1
- package/dist/deltaManagerProxyBase.js +0 -77
- package/dist/deltaManagerProxyBase.js.map +0 -1
- package/lib/batchTracker.d.mts.map +0 -1
- package/lib/batchTracker.mjs.map +0 -1
- package/lib/blobManager.d.mts.map +0 -1
- package/lib/blobManager.mjs.map +0 -1
- package/lib/connectionTelemetry.d.mts.map +0 -1
- package/lib/connectionTelemetry.mjs.map +0 -1
- package/lib/containerHandleContext.d.mts.map +0 -1
- package/lib/containerHandleContext.mjs.map +0 -1
- package/lib/containerRuntime.d.mts.map +0 -1
- package/lib/containerRuntime.mjs.map +0 -1
- package/lib/dataStore.d.mts.map +0 -1
- package/lib/dataStore.mjs.map +0 -1
- package/lib/dataStoreContext.d.mts.map +0 -1
- package/lib/dataStoreContext.mjs.map +0 -1
- package/lib/dataStoreContexts.d.mts.map +0 -1
- package/lib/dataStoreContexts.mjs.map +0 -1
- package/lib/dataStoreRegistry.d.mts.map +0 -1
- package/lib/dataStoreRegistry.mjs.map +0 -1
- package/lib/dataStores.d.mts +0 -149
- package/lib/dataStores.d.mts.map +0 -1
- package/lib/dataStores.mjs.map +0 -1
- package/lib/deltaManagerProxyBase.d.mts +0 -35
- package/lib/deltaManagerProxyBase.d.mts.map +0 -1
- package/lib/deltaManagerProxyBase.mjs +0 -73
- package/lib/deltaManagerProxyBase.mjs.map +0 -1
- package/lib/deltaManagerSummarizerProxy.d.mts +0 -19
- package/lib/deltaManagerSummarizerProxy.d.mts.map +0 -1
- package/lib/deltaManagerSummarizerProxy.mjs +0 -38
- package/lib/deltaManagerSummarizerProxy.mjs.map +0 -1
- package/lib/deltaScheduler.d.mts.map +0 -1
- package/lib/deltaScheduler.mjs.map +0 -1
- package/lib/error.d.mts.map +0 -1
- package/lib/error.mjs.map +0 -1
- package/lib/gc/garbageCollection.d.mts.map +0 -1
- package/lib/gc/garbageCollection.mjs.map +0 -1
- package/lib/gc/gcConfigs.d.mts.map +0 -1
- package/lib/gc/gcConfigs.mjs.map +0 -1
- package/lib/gc/gcDefinitions.d.mts.map +0 -1
- package/lib/gc/gcDefinitions.mjs.map +0 -1
- package/lib/gc/gcHelpers.mjs.map +0 -1
- package/lib/gc/gcReferenceGraphAlgorithm.d.mts.map +0 -1
- package/lib/gc/gcReferenceGraphAlgorithm.mjs.map +0 -1
- package/lib/gc/gcSummaryDefinitions.d.mts.map +0 -1
- package/lib/gc/gcSummaryDefinitions.mjs.map +0 -1
- package/lib/gc/gcSummaryStateTracker.d.mts.map +0 -1
- package/lib/gc/gcSummaryStateTracker.mjs.map +0 -1
- package/lib/gc/gcTelemetry.d.mts.map +0 -1
- package/lib/gc/gcTelemetry.mjs.map +0 -1
- package/lib/gc/gcUnreferencedStateTracker.d.mts.map +0 -1
- package/lib/gc/gcUnreferencedStateTracker.mjs.map +0 -1
- package/lib/gc/index.d.mts.map +0 -1
- package/lib/gc/index.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs +0 -24
- package/lib/index.mjs.map +0 -1
- package/lib/messageTypes.d.mts.map +0 -1
- package/lib/messageTypes.mjs.map +0 -1
- package/lib/metadata.d.mts.map +0 -1
- package/lib/metadata.mjs.map +0 -1
- package/lib/opLifecycle/batchManager.d.mts.map +0 -1
- package/lib/opLifecycle/batchManager.mjs.map +0 -1
- package/lib/opLifecycle/definitions.d.mts.map +0 -1
- package/lib/opLifecycle/definitions.mjs.map +0 -1
- package/lib/opLifecycle/index.d.mts +0 -13
- package/lib/opLifecycle/index.d.mts.map +0 -1
- package/lib/opLifecycle/index.mjs +0 -12
- package/lib/opLifecycle/index.mjs.map +0 -1
- package/lib/opLifecycle/opCompressor.d.mts.map +0 -1
- package/lib/opLifecycle/opCompressor.mjs.map +0 -1
- package/lib/opLifecycle/opDecompressor.d.mts.map +0 -1
- package/lib/opLifecycle/opDecompressor.mjs.map +0 -1
- package/lib/opLifecycle/opGroupingManager.d.mts.map +0 -1
- package/lib/opLifecycle/opGroupingManager.mjs.map +0 -1
- package/lib/opLifecycle/opSplitter.d.mts.map +0 -1
- package/lib/opLifecycle/opSplitter.mjs.map +0 -1
- package/lib/opLifecycle/outbox.d.mts.map +0 -1
- package/lib/opLifecycle/outbox.mjs.map +0 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.mts.map +0 -1
- package/lib/opLifecycle/remoteMessageProcessor.mjs.map +0 -1
- package/lib/opProperties.d.mts.map +0 -1
- package/lib/opProperties.mjs.map +0 -1
- package/lib/packageVersion.d.mts.map +0 -1
- package/lib/packageVersion.mjs.map +0 -1
- package/lib/pendingStateManager.d.mts.map +0 -1
- package/lib/pendingStateManager.mjs.map +0 -1
- package/lib/scheduleManager.d.mts.map +0 -1
- package/lib/scheduleManager.mjs.map +0 -1
- package/lib/storageServiceWithAttachBlobs.d.mts.map +0 -1
- package/lib/storageServiceWithAttachBlobs.mjs.map +0 -1
- package/lib/summary/index.d.mts.map +0 -1
- package/lib/summary/index.mjs.map +0 -1
- package/lib/summary/orderedClientElection.d.mts.map +0 -1
- package/lib/summary/orderedClientElection.mjs.map +0 -1
- package/lib/summary/runWhileConnectedCoordinator.d.mts.map +0 -1
- package/lib/summary/runWhileConnectedCoordinator.mjs.map +0 -1
- package/lib/summary/runningSummarizer.d.mts.map +0 -1
- package/lib/summary/runningSummarizer.mjs.map +0 -1
- package/lib/summary/summarizer.d.mts.map +0 -1
- package/lib/summary/summarizer.mjs.map +0 -1
- package/lib/summary/summarizerClientElection.d.mts.map +0 -1
- package/lib/summary/summarizerClientElection.mjs.map +0 -1
- package/lib/summary/summarizerHeuristics.d.mts.map +0 -1
- package/lib/summary/summarizerHeuristics.mjs.map +0 -1
- package/lib/summary/summarizerNode/index.d.mts.map +0 -1
- package/lib/summary/summarizerNode/index.mjs +0 -7
- package/lib/summary/summarizerNode/index.mjs.map +0 -1
- package/lib/summary/summarizerNode/summarizerNode.d.mts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNode.mjs.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.mjs.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts.map +0 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs.map +0 -1
- package/lib/summary/summarizerTypes.d.mts.map +0 -1
- package/lib/summary/summarizerTypes.mjs.map +0 -1
- package/lib/summary/summaryCollection.d.mts.map +0 -1
- package/lib/summary/summaryCollection.mjs.map +0 -1
- package/lib/summary/summaryFormat.d.mts.map +0 -1
- package/lib/summary/summaryFormat.mjs.map +0 -1
- package/lib/summary/summaryGenerator.d.mts.map +0 -1
- package/lib/summary/summaryGenerator.mjs.map +0 -1
- package/lib/summary/summaryManager.d.mts.map +0 -1
- package/lib/summary/summaryManager.mjs.map +0 -1
- package/lib/throttler.d.mts.map +0 -1
- package/lib/throttler.mjs.map +0 -1
- package/src/deltaManagerProxyBase.ts +0 -111
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcTelemetry.js","sourceRoot":"","sources":["../../src/gc/gcTelemetry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EACN,aAAa,EAGb,gBAAgB,GAEhB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACN,UAAU,EACV,iBAAiB,EAEjB,mBAAmB,EACnB,wBAAwB,EACxB,+BAA+B,EAC/B,WAAW,GAEX,MAAM,oBAAoB,CAAC;AA4C5B;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,kBAAkB;IAO9B,YACkB,EAAqB,EACrB,OAAiC,EACjC,kBAA2B,EAC3B,uBAAiD,EACjD,WAA2C,EAC3C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AC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IGarbageCollectionData } from \"@fluidframework/runtime-definitions\";\nimport {\n\tgenerateStack,\n\tITelemetryLoggerExt,\n\tMonitoringContext,\n\ttagCodeArtifacts,\n\ttype ITelemetryGenericEventExt,\n} from \"@fluidframework/telemetry-utils\";\nimport { RuntimeHeaderData } from \"../containerRuntime.js\";\nimport { ICreateContainerMetadata } from \"../summary/index.js\";\nimport {\n\tGCNodeType,\n\tUnreferencedState,\n\tIGarbageCollectorConfigs,\n\tdisableTombstoneKey,\n\tthrowOnTombstoneUsageKey,\n\tthrowOnTombstoneLoadOverrideKey,\n\trunSweepKey,\n\tGCFeatureMatrix,\n} from \"./gcDefinitions.js\";\nimport { UnreferencedStateTracker } from \"./gcUnreferencedStateTracker.js\";\n\ntype NodeUsageType = \"Changed\" | \"Loaded\" | \"Revived\";\n\n/** Properties that are common to IUnreferencedEventProps and INodeUsageProps */\ninterface ICommonProps {\n\tusageType: NodeUsageType;\n\tcompletedGCRuns: number;\n\tisTombstoned: boolean;\n\tlastSummaryTime?: number;\n\theaders?: RuntimeHeaderData;\n}\n\n/** The event that is logged when unreferenced node is used after a certain time. */\ninterface IUnreferencedEventProps extends ICreateContainerMetadata, ICommonProps {\n\tstate: UnreferencedState;\n\tid: {\n\t\tvalue: string;\n\t\ttag: string;\n\t};\n\ttype: GCNodeType;\n\tunrefTime: number;\n\tage: number;\n\t// Expanding GC feature matrix. Without doing this, the configs cannot be logged in telemetry directly.\n\tgcConfigs: Omit<IGarbageCollectorConfigs, \"persistedGcFeatureMatrix\"> & {\n\t\t[K in keyof GCFeatureMatrix]: GCFeatureMatrix[K];\n\t};\n\ttimeout?: number;\n\tfromId?: {\n\t\tvalue: string;\n\t\ttag: string;\n\t};\n}\n\n/** Properties passed to nodeUsed function when a node is used. */\ninterface INodeUsageProps extends ICommonProps {\n\tid: string;\n\tcurrentReferenceTimestampMs: number | undefined;\n\tpackagePath: readonly string[] | undefined;\n\tfromId?: string;\n\tautorecovery?: true;\n}\n\n/**\n * Encapsulates the logic that tracks the various telemetry logged by the Garbage Collector.\n *\n * These events are not logged as errors, just generic events, since there can be false positives:\n *\n * 1. inactiveObject telemetry - When an inactive node is used - A node that has been unreferenced for inactiveTimeoutMs.\n * 2. tombstoneReadyObject telemetry - When a tombstone-ready node is used - A node that has been unreferenced for tombstoneTimeoutMs.\n * 3. sweepReadyObject telemetry - When a sweep-ready node is used - A node that has been unreferenced for tombstoneTimeoutMs + sweepGracePeriodMs.\n *\n * These events are logged as errors since they are based on the core GC logic:\n *\n * 1. Tombstone telemetry - When a tombstoned node is used - A node that has been marked as tombstone.\n * 2. Unknown outbound reference telemetry - When a node is referenced but GC was not notified of it when the new reference appeared.\n *\n * Note: The telemetry for a Deleted node being used is logged elsewhere in this package.\n */\nexport class GCTelemetryTracker {\n\t// Keeps track of unreferenced events that are logged for a node. This is used to limit the log generation to one\n\t// per event per node.\n\tprivate readonly loggedUnreferencedEvents: Set<string> = new Set();\n\t// Queue for unreferenced events that should be logged the next time GC runs.\n\tprivate pendingEventsQueue: IUnreferencedEventProps[] = [];\n\n\tconstructor(\n\t\tprivate readonly mc: MonitoringContext,\n\t\tprivate readonly configs: IGarbageCollectorConfigs,\n\t\tprivate readonly isSummarizerClient: boolean,\n\t\tprivate readonly createContainerMetadata: ICreateContainerMetadata,\n\t\tprivate readonly getNodeType: (nodeId: string) => GCNodeType,\n\t\tprivate readonly getNodeStateTracker: (\n\t\t\tnodeId: string,\n\t\t) => UnreferencedStateTracker | undefined,\n\t\tprivate readonly getNodePackagePath: (\n\t\t\tnodePath: string,\n\t\t) => Promise<readonly string[] | undefined>,\n\t) {}\n\n\t/**\n\t * Returns whether an event should be logged for a node that isn't active anymore. This does not apply to\n\t * tombstoned nodes for which an event is always logged. Some scenarios where we won't log:\n\t * 1. When a DDS is changed. The corresponding data store's event will be logged instead.\n\t * 2. An event is logged only once per container instance per event per node.\n\t */\n\tprivate shouldLogNonActiveEvent(\n\t\tnodeType: GCNodeType,\n\t\tusageType: NodeUsageType,\n\t\tnodeStateTracker: UnreferencedStateTracker,\n\t\tuniqueEventId: string,\n\t) {\n\t\tif (nodeStateTracker.state === UnreferencedState.Active) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (nodeType === GCNodeType.Other) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// For sub data store (DDS) nodes, if they are changed, its data store will also be changed,\n\t\t// so skip logging to make the telemetry less noisy.\n\t\tif (nodeType === GCNodeType.SubDataStore && usageType === \"Changed\") {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Non-tombstone events are logged once per event per node. A unique id is generated by joining\n\t\t// node state (inactive / sweep ready), node's id and usage (loaded / changed / revived).\n\t\tif (this.loggedUnreferencedEvents.has(uniqueEventId)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called when a node is used. If the node is not active or tombstoned, log telemetry indicating object is used\n\t * when it should not have been.\n\t */\n\tpublic nodeUsed(nodeUsageProps: INodeUsageProps) {\n\t\t// If there is no reference timestamp to work with, no ops have been processed after creation. If so, skip\n\t\t// logging as nothing interesting would have happened worth logging.\n\t\tif (nodeUsageProps.currentReferenceTimestampMs === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nodeStateTracker = this.getNodeStateTracker(nodeUsageProps.id);\n\t\tconst nodeType = this.getNodeType(nodeUsageProps.id);\n\t\tconst timeout = (() => {\n\t\t\tswitch (nodeStateTracker?.state) {\n\t\t\t\tcase UnreferencedState.Inactive:\n\t\t\t\t\treturn this.configs.inactiveTimeoutMs;\n\t\t\t\tcase UnreferencedState.TombstoneReady:\n\t\t\t\t\treturn this.configs.tombstoneTimeoutMs;\n\t\t\t\tcase UnreferencedState.SweepReady:\n\t\t\t\t\treturn (\n\t\t\t\t\t\tthis.configs.tombstoneTimeoutMs &&\n\t\t\t\t\t\tthis.configs.tombstoneTimeoutMs + this.configs.sweepGracePeriodMs\n\t\t\t\t\t);\n\t\t\t\tdefault:\n\t\t\t\t\treturn undefined;\n\t\t\t}\n\t\t})();\n\t\tconst {\n\t\t\tusageType,\n\t\t\tcurrentReferenceTimestampMs,\n\t\t\tpackagePath,\n\t\t\tid: untaggedId,\n\t\t\tfromId: untaggedFromId,\n\t\t\t...propsToLog\n\t\t} = nodeUsageProps;\n\t\tconst { persistedGcFeatureMatrix, ...configs } = this.configs;\n\t\tconst unrefEventProps: Omit<IUnreferencedEventProps, \"state\" | \"usageType\"> = {\n\t\t\ttype: nodeType,\n\t\t\tunrefTime: nodeStateTracker?.unreferencedTimestampMs ?? -1,\n\t\t\tage:\n\t\t\t\tnodeStateTracker !== undefined\n\t\t\t\t\t? nodeUsageProps.currentReferenceTimestampMs -\n\t\t\t\t\t nodeStateTracker.unreferencedTimestampMs\n\t\t\t\t\t: -1,\n\t\t\ttimeout,\n\t\t\t...tagCodeArtifacts({ id: untaggedId, fromId: untaggedFromId }),\n\t\t\t...propsToLog,\n\t\t\t...this.createContainerMetadata,\n\t\t\tgcConfigs: { ...configs, ...persistedGcFeatureMatrix },\n\t\t};\n\n\t\t// If the node that is used is tombstoned, log a tombstone telemetry.\n\t\tif (nodeUsageProps.isTombstoned) {\n\t\t\tthis.logTombstoneUsageTelemetry(nodeUsageProps, unrefEventProps, nodeType, usageType);\n\t\t}\n\n\t\t// After logging tombstone telemetry, if the node's unreferenced state is not tracked, there is nothing\n\t\t// else to log.\n\t\tif (nodeStateTracker === undefined) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst state = nodeStateTracker.state;\n\t\tconst uniqueEventId = `${state}-${nodeUsageProps.id}-${nodeUsageProps.usageType}`;\n\n\t\tif (\n\t\t\t!this.shouldLogNonActiveEvent(\n\t\t\t\tnodeType,\n\t\t\t\tnodeUsageProps.usageType,\n\t\t\t\tnodeStateTracker,\n\t\t\t\tuniqueEventId,\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add the unique event id so that we don't generate a log for this event again in this session.\n\t\tthis.loggedUnreferencedEvents.add(uniqueEventId);\n\n\t\t// For summarizer client, queue the event so it is logged the next time GC runs if the event is still valid.\n\t\t// For non-summarizer client, log the event now since GC won't run on it. This may result in false positives\n\t\t// but it's a good signal nonetheless and we can consume it with a grain of salt.\n\t\t// Inactive errors are usages of Objects that are unreferenced for at least a period of 7 days.\n\t\t// SweepReady errors are usages of Objects that will be deleted by GC Sweep!\n\t\tif (this.isSummarizerClient) {\n\t\t\tthis.pendingEventsQueue.push({\n\t\t\t\t...unrefEventProps,\n\t\t\t\tusageType: nodeUsageProps.usageType,\n\t\t\t\tstate,\n\t\t\t});\n\t\t} else {\n\t\t\t// For non-summarizer clients, only log \"Loaded\" type events since these objects may not be loaded in the\n\t\t\t// summarizer clients if they are based off of user actions (such as scrolling to content for these objects)\n\t\t\t// Events generated:\n\t\t\t// InactiveObject_Loaded, SweepReadyObject_Loaded\n\t\t\tif (nodeUsageProps.usageType === \"Loaded\") {\n\t\t\t\tconst { id, fromId, headers, gcConfigs, ...detailedProps } = unrefEventProps;\n\t\t\t\tconst event = {\n\t\t\t\t\teventName: `${state}Object_${nodeUsageProps.usageType}`,\n\t\t\t\t\t...tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join(\"/\") }),\n\t\t\t\t\tstack: generateStack(),\n\t\t\t\t\tid,\n\t\t\t\t\tfromId,\n\t\t\t\t\theaders: { ...headers },\n\t\t\t\t\tdetails: detailedProps,\n\t\t\t\t\tgcConfigs,\n\t\t\t\t};\n\n\t\t\t\t// These are logged as generic events and not errors because there can be false positives. The Tombstone\n\t\t\t\t// and Delete errors are separately logged and are reliable.\n\t\t\t\tthis.mc.logger.sendTelemetryEvent(event);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Logs telemetry when a tombstoned object is changed, revived or loaded.\n\t */\n\tprivate logTombstoneUsageTelemetry(\n\t\tnodeUsageProps: INodeUsageProps,\n\t\tunrefEventProps: Omit<IUnreferencedEventProps, \"state\" | \"usageType\">,\n\t\tnodeType: GCNodeType,\n\t\tusageType: NodeUsageType,\n\t) {\n\t\t// This will log the following events:\n\t\t// GC_Tombstone_DataStore_Requested, GC_Tombstone_DataStore_Changed, GC_Tombstone_DataStore_Revived\n\t\t// GC_Tombstone_SubDataStore_Requested, GC_Tombstone_SubDataStore_Changed, GC_Tombstone_SubDataStore_Revived\n\t\t// GC_Tombstone_Blob_Requested, GC_Tombstone_Blob_Changed, GC_Tombstone_Blob_Revived\n\t\tconst { id, fromId, headers, gcConfigs, ...detailedProps } = unrefEventProps;\n\t\tconst eventUsageName = usageType === \"Loaded\" ? \"Requested\" : usageType;\n\t\tconst event = {\n\t\t\teventName: `GC_Tombstone_${nodeType}_${eventUsageName}`,\n\t\t\tpkg: tagCodeArtifacts({ pkg: nodeUsageProps.packagePath?.join(\"/\") }).pkg,\n\t\t\tstack: generateStack(),\n\t\t\tid,\n\t\t\tfromId,\n\t\t\theaders: { ...headers },\n\t\t\tdetails: detailedProps,\n\t\t\tgcConfigs,\n\t\t\ttombstoneFlags: {\n\t\t\t\tDisableTombstone: this.mc.config.getBoolean(disableTombstoneKey),\n\t\t\t\tThrowOnTombstoneUsage: this.mc.config.getBoolean(throwOnTombstoneUsageKey),\n\t\t\t\tThrowOnTombstoneLoad: this.mc.config.getBoolean(throwOnTombstoneLoadOverrideKey),\n\t\t\t},\n\t\t\tsweepFlags: {\n\t\t\t\tEnableSweepFlag: this.mc.config.getBoolean(runSweepKey),\n\t\t\t},\n\t\t};\n\n\t\tif (\n\t\t\t(usageType === \"Loaded\" &&\n\t\t\t\tthis.configs.throwOnTombstoneLoad &&\n\t\t\t\t!headers?.allowTombstone) ||\n\t\t\t(usageType === \"Changed\" && this.configs.throwOnTombstoneUsage)\n\t\t) {\n\t\t\tthis.mc.logger.sendErrorEvent(event);\n\t\t} else {\n\t\t\tthis.mc.logger.sendTelemetryEvent(event);\n\t\t}\n\t}\n\n\t/**\n\t * Log all new references or outbound routes in the current graph that haven't been explicitly notified to GC.\n\t * The principle is that every new reference or outbound route must be notified to GC via the\n\t * addedOutboundReference method. It it hasn't, its a bug and we want to identify these scenarios.\n\t *\n\t * In more simple terms:\n\t * Missing Explicit References = Current References - Previous References - Explicitly Added References;\n\t *\n\t * @param currentGCData - The GC data (reference graph) from the current GC run.\n\t * @param previousGCData - The GC data (reference graph) from the previous GC run.\n\t * @param explicitReferences - New references added explicity between the previous and the current run.\n\t */\n\tpublic logIfMissingExplicitReferences(\n\t\tcurrentGCData: IGarbageCollectionData,\n\t\tpreviousGCData: IGarbageCollectionData,\n\t\texplicitReferences: Map<string, string[]>,\n\t\tlogger: ITelemetryLoggerExt,\n\t) {\n\t\tfor (const [nodeId, currentOutboundRoutes] of Object.entries(currentGCData.gcNodes)) {\n\t\t\tconst previousRoutes = previousGCData.gcNodes[nodeId] ?? [];\n\t\t\tconst explicitRoutes = explicitReferences.get(nodeId) ?? [];\n\n\t\t\t/**\n\t\t\t * 1. For routes in the current GC data, routes that were not present in previous GC data and did not have\n\t\t\t * explicit references should be added to missing explicit routes list.\n\t\t\t * 2. Only include data store and blob routes since GC only works for these two.\n\t\t\t * Note: Due to a bug with de-duped blobs, only adding data store routes for now.\n\t\t\t * 3. Ignore DDS routes to their parent datastores since those were added implicitly. So, there won't be\n\t\t\t * explicit routes to them.\n\t\t\t */\n\t\t\tconst missingExplicitRoutes: string[] = [];\n\t\t\tfor (const route of currentOutboundRoutes) {\n\t\t\t\tconst nodeType = this.getNodeType(route);\n\t\t\t\tif (\n\t\t\t\t\t(nodeType === GCNodeType.DataStore || nodeType === GCNodeType.Blob) &&\n\t\t\t\t\t!nodeId.startsWith(route) &&\n\t\t\t\t\t!previousRoutes.includes(route) &&\n\t\t\t\t\t!explicitRoutes.includes(route)\n\t\t\t\t) {\n\t\t\t\t\tmissingExplicitRoutes.push(route);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (missingExplicitRoutes.length > 0) {\n\t\t\t\t// Send as Generic not Error since there are known corner cases where this will fire.\n\t\t\t\t// E.g. If an old client re-references a node via an attach op (that doesn't include GC Data)\n\t\t\t\tlogger.sendTelemetryEvent({\n\t\t\t\t\teventName: \"gcUnknownOutboundReferences\",\n\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\tid: nodeId,\n\t\t\t\t\t\troutes: JSON.stringify(missingExplicitRoutes),\n\t\t\t\t\t}),\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Log events that are pending in pendingEventsQueue. This is called after GC runs in the summarizer client\n\t * so that the state of an unreferenced node is updated.\n\t */\n\tpublic async logPendingEvents(logger: ITelemetryLoggerExt) {\n\t\t// Events sent come only from the summarizer client. In between summaries, events are pushed to a queue and at\n\t\t// summary time they are then logged.\n\t\t// Events generated:\n\t\t// InactiveObject_Loaded, InactiveObject_Changed, InactiveObject_Revived\n\t\t// SweepReadyObject_Loaded, SweepReadyObject_Changed, SweepReadyObject_Revived\n\t\tfor (const eventProps of this.pendingEventsQueue) {\n\t\t\t// const { usageType, state, id, fromId, ...propsToLog } = eventProps;\n\t\t\tconst { usageType, state, id, fromId, headers, gcConfigs, ...detailedProps } =\n\t\t\t\teventProps;\n\t\t\t/**\n\t\t\t * Revived event is logged only if the node is active. If the node is not active, the reference to it was\n\t\t\t * from another unreferenced node and this scenario is not interesting to log.\n\t\t\t * Loaded and Changed events are logged only if the node is not active. If the node is active, it was\n\t\t\t * revived and a Revived event will be logged for it.\n\t\t\t */\n\t\t\tconst nodeStateTracker = this.getNodeStateTracker(eventProps.id.value);\n\t\t\tconst active =\n\t\t\t\tnodeStateTracker === undefined ||\n\t\t\t\tnodeStateTracker.state === UnreferencedState.Active;\n\t\t\tif ((usageType === \"Revived\") === active) {\n\t\t\t\tconst pkg = await this.getNodePackagePath(eventProps.id.value);\n\t\t\t\tconst fromPkg = eventProps.fromId\n\t\t\t\t\t? await this.getNodePackagePath(eventProps.fromId.value)\n\t\t\t\t\t: undefined;\n\t\t\t\tconst event = {\n\t\t\t\t\teventName: `${state}Object_${usageType}`,\n\t\t\t\t\tid,\n\t\t\t\t\tfromId,\n\t\t\t\t\theaders: { ...headers },\n\t\t\t\t\tdetails: detailedProps,\n\t\t\t\t\tgcConfigs,\n\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\tpkg: pkg?.join(\"/\"),\n\t\t\t\t\t\tfromPkg: fromPkg?.join(\"/\"),\n\t\t\t\t\t}),\n\t\t\t\t};\n\n\t\t\t\t// These are logged as generic events and not errors because there can be false positives. The Tombstone\n\t\t\t\t// and Delete errors are separately logged and are reliable.\n\t\t\t\tlogger.sendTelemetryEvent(event);\n\t\t\t}\n\t\t}\n\t\tthis.pendingEventsQueue = [];\n\t}\n}\n\n/**\n * Consolidates info / logic for logging when we encounter unexpected usage of GC'd objects. For example, when a\n * tombstoned or deleted object is loaded.\n */\nexport function sendGCUnexpectedUsageEvent(\n\tmc: MonitoringContext,\n\tevent: ITelemetryGenericEventExt & {\n\t\tcategory: \"error\" | \"generic\";\n\t\tgcTombstoneEnforcementAllowed: boolean | undefined;\n\t},\n\tpackagePath: readonly string[] | undefined,\n\terror?: unknown,\n) {\n\tevent.pkg = tagCodeArtifacts({ pkg: packagePath?.join(\"/\") })?.pkg;\n\tevent.tombstoneFlags = JSON.stringify({\n\t\tDisableTombstone: mc.config.getBoolean(disableTombstoneKey),\n\t\tThrowOnTombstoneUsage: mc.config.getBoolean(throwOnTombstoneUsageKey),\n\t\tThrowOnTombstoneLoad: mc.config.getBoolean(throwOnTombstoneLoadOverrideKey),\n\t});\n\tevent.sweepFlags = JSON.stringify({\n\t\tEnableSweepFlag: mc.config.getBoolean(runSweepKey),\n\t});\n\n\tmc.logger.sendTelemetryEvent(event, error);\n}\n"]}
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { UnreferencedState } from "./gcDefinitions.
|
|
5
|
+
import { UnreferencedState } from "./gcDefinitions.js";
|
|
6
|
+
/** The collection of UnreferencedStateTrackers for all unreferenced nodes. Ensures stopTracking is called when deleting */
|
|
7
|
+
export declare class UnreferencedStateTrackerMap extends Map<string, UnreferencedStateTracker> {
|
|
8
|
+
/** Delete the given key, and stop tracking if that node was actually unreferenced */
|
|
9
|
+
delete(key: string): boolean;
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
12
|
* Helper class that tracks the state of an unreferenced node such as the time it was unreferenced and if it can
|
|
8
13
|
* be tombstoned or deleted by the sweep phase.
|
|
@@ -37,4 +42,4 @@ export declare class UnreferencedStateTracker {
|
|
|
37
42
|
/** Stop tracking this node. Reset the unreferenced timers and state, if any. */
|
|
38
43
|
stopTracking(): void;
|
|
39
44
|
}
|
|
40
|
-
//# sourceMappingURL=gcUnreferencedStateTracker.d.
|
|
45
|
+
//# sourceMappingURL=gcUnreferencedStateTracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcUnreferencedStateTracker.d.ts","sourceRoot":"","sources":["../../src/gc/gcUnreferencedStateTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAoBvD,2HAA2H;AAC3H,qBAAa,2BAA4B,SAAQ,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC;IACrF,qFAAqF;IACrF,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAM5B;AAED;;;GAGG;AACH,qBAAa,wBAAwB;aAcnB,uBAAuB,EAAE,MAAM;IAC/C,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAGlC,8GAA8G;IAC9G,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,kGAAkG;IAClG,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IArBpC,OAAO,CAAC,MAAM,CAA+C;IAC7D,IAAW,KAAK,IAAI,iBAAiB,CAEpC;IAED,2EAA2E;IAC3E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4B;IAC1D,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA4B;IAC3D,mEAAmE;IACnE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA4B;gBAGtC,uBAAuB,EAAE,MAAM;IAC/C,+DAA+D;IAC9C,iBAAiB,EAAE,MAAM;IAC1C,kGAAkG;IAClG,2BAA2B,EAAE,MAAM;IACnC,8GAA8G;IAC7F,kBAAkB,EAAE,MAAM,GAAG,SAAS;IACvD,kGAAkG;IACjF,kBAAkB,EAAE,MAAM;IA4CrC,cAAc,CAAC,2BAA2B,EAAE,MAAM;IA4CzD,OAAO,CAAC,WAAW;IAMnB,gFAAgF;IACzE,YAAY;CAInB"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { assert, Timer } from "@fluidframework/core-utils";
|
|
6
6
|
import { validatePrecondition } from "@fluidframework/telemetry-utils";
|
|
7
|
-
import { UnreferencedState } from "./gcDefinitions.
|
|
7
|
+
import { UnreferencedState } from "./gcDefinitions.js";
|
|
8
8
|
/** A wrapper around common-utils Timer that requires the timeout when calling start/restart */
|
|
9
9
|
class TimerWithNoDefaultTimeout extends Timer {
|
|
10
10
|
constructor(callback) {
|
|
@@ -21,6 +21,16 @@ class TimerWithNoDefaultTimeout extends Timer {
|
|
|
21
21
|
super.restart(timeoutMs, this.callback);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
+
/** The collection of UnreferencedStateTrackers for all unreferenced nodes. Ensures stopTracking is called when deleting */
|
|
25
|
+
export class UnreferencedStateTrackerMap extends Map {
|
|
26
|
+
/** Delete the given key, and stop tracking if that node was actually unreferenced */
|
|
27
|
+
delete(key) {
|
|
28
|
+
// Stop tracking so as to clear out any running timers.
|
|
29
|
+
this.get(key)?.stopTracking();
|
|
30
|
+
// Delete the node as we don't need to track it any more.
|
|
31
|
+
return super.delete(key);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
24
34
|
/**
|
|
25
35
|
* Helper class that tracks the state of an unreferenced node such as the time it was unreferenced and if it can
|
|
26
36
|
* be tombstoned or deleted by the sweep phase.
|
|
@@ -111,4 +121,4 @@ export class UnreferencedStateTracker {
|
|
|
111
121
|
this._state = UnreferencedState.Active;
|
|
112
122
|
}
|
|
113
123
|
}
|
|
114
|
-
//# sourceMappingURL=gcUnreferencedStateTracker.
|
|
124
|
+
//# sourceMappingURL=gcUnreferencedStateTracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcUnreferencedStateTracker.js","sourceRoot":"","sources":["../../src/gc/gcUnreferencedStateTracker.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,+FAA+F;AAC/F,MAAM,yBAA0B,SAAQ,KAAK;IAC5C,YAA6B,QAAoB;QAChD,2FAA2F;QAC3F,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE;YACb,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAJyB,aAAQ,GAAR,QAAQ,CAAY;IAKjD,CAAC;IAED,KAAK,CAAC,SAAiB;QACtB,KAAK,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;IAED,OAAO,CAAC,SAAiB;QACxB,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACD;AAED,2HAA2H;AAC3H,MAAM,OAAO,2BAA4B,SAAQ,GAAqC;IACrF,qFAAqF;IACrF,MAAM,CAAC,GAAW;QACjB,uDA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CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,GAAG,sBAAsB,CAC1E,CAAC;YACF,OAAO;SACP;QAED,mFAAmF;QACnF,kEAAkE;QAClE,IAAI,sBAAsB,IAAI,IAAI,CAAC,iBAAiB,EAAE;YACrD,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,QAAQ,CAAC;YAEzC,IAAI,IAAI,CAAC,kBAAkB,KAAK,SAAS,EAAE;gBAC1C,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,GAAG,sBAAsB,CAAC,CAAC;aAC9E;YACD,OAAO;SACP;QAED,qGAAqG;QACrG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,GAAG,sBAAsB,CAAC,CAAC;IAC7E,CAAC;IAEO,WAAW;QAClB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAED,gFAAgF;IACzE,YAAY;QAClB,IAAI,CAAC,WAAW,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACxC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, Timer } from \"@fluidframework/core-utils\";\nimport { validatePrecondition } from \"@fluidframework/telemetry-utils\";\nimport { UnreferencedState } from \"./gcDefinitions.js\";\n\n/** A wrapper around common-utils Timer that requires the timeout when calling start/restart */\nclass TimerWithNoDefaultTimeout extends Timer {\n\tconstructor(private readonly callback: () => void) {\n\t\t// The default timeout/handlers will never be used since start/restart pass overrides below\n\t\tsuper(0, () => {\n\t\t\tthrow new Error(\"DefaultHandler should not be used\");\n\t\t});\n\t}\n\n\tstart(timeoutMs: number) {\n\t\tsuper.start(timeoutMs, this.callback);\n\t}\n\n\trestart(timeoutMs: number): void {\n\t\tsuper.restart(timeoutMs, this.callback);\n\t}\n}\n\n/** The collection of UnreferencedStateTrackers for all unreferenced nodes. Ensures stopTracking is called when deleting */\nexport class UnreferencedStateTrackerMap extends Map<string, UnreferencedStateTracker> {\n\t/** Delete the given key, and stop tracking if that node was actually unreferenced */\n\tdelete(key: string): boolean {\n\t\t// Stop tracking so as to clear out any running timers.\n\t\tthis.get(key)?.stopTracking();\n\t\t// Delete the node as we don't need to track it any more.\n\t\treturn super.delete(key);\n\t}\n}\n\n/**\n * Helper class that tracks the state of an unreferenced node such as the time it was unreferenced and if it can\n * be tombstoned or deleted by the sweep phase.\n */\nexport class UnreferencedStateTracker {\n\tprivate _state: UnreferencedState = UnreferencedState.Active;\n\tpublic get state(): UnreferencedState {\n\t\treturn this._state;\n\t}\n\n\t/** Timer to indicate when an unreferenced object is considered Inactive */\n\tprivate readonly inactiveTimer: TimerWithNoDefaultTimeout;\n\t/** Timer to indicate when an unreferenced object is Tombstone-Ready */\n\tprivate readonly tombstoneTimer: TimerWithNoDefaultTimeout;\n\t/** Timer to indicate when an unreferenced object is Sweep-Ready */\n\tprivate readonly sweepTimer: TimerWithNoDefaultTimeout;\n\n\tconstructor(\n\t\tpublic readonly unreferencedTimestampMs: number,\n\t\t/** The time after which node transitions to Inactive state. */\n\t\tprivate readonly inactiveTimeoutMs: number,\n\t\t/** The current reference timestamp used to track how long this node has been unreferenced for. */\n\t\tcurrentReferenceTimestampMs: number,\n\t\t/** The time after which node transitions to TombstoneReady state; undefined if session expiry is disabled. */\n\t\tprivate readonly tombstoneTimeoutMs: number | undefined,\n\t\t/** The delay from TombstoneReady to SweepReady (only applies if tombstoneTimeoutMs is defined) */\n\t\tprivate readonly sweepGracePeriodMs: number,\n\t) {\n\t\tvalidatePrecondition(\n\t\t\tthis.tombstoneTimeoutMs === undefined ||\n\t\t\t\tthis.tombstoneTimeoutMs >= this.inactiveTimeoutMs,\n\t\t\t\"inactiveTimeoutMs must not be greater than the tombstoneTimeoutMs\",\n\t\t);\n\n\t\tthis.sweepTimer = new TimerWithNoDefaultTimeout(() => {\n\t\t\tthis._state = UnreferencedState.SweepReady;\n\t\t\tassert(\n\t\t\t\t!this.inactiveTimer.hasTimer && !this.tombstoneTimer.hasTimer,\n\t\t\t\t0x863 /* inactiveTimer or tombstoneTimer still running after sweepTimer fired! */,\n\t\t\t);\n\t\t});\n\n\t\tthis.tombstoneTimer = new TimerWithNoDefaultTimeout(() => {\n\t\t\tthis._state = UnreferencedState.TombstoneReady;\n\t\t\tassert(\n\t\t\t\t!this.inactiveTimer.hasTimer,\n\t\t\t\t0x864 /* inactiveTimer still running after tombstoneTimer fired! */,\n\t\t\t); // aka 0x3b1\n\n\t\t\tif (this.sweepGracePeriodMs > 0) {\n\t\t\t\t// After the node becomes tombstone ready, start the sweep timer after which the node will be ready for sweep.\n\t\t\t\tthis.sweepTimer.restart(this.sweepGracePeriodMs);\n\t\t\t} else {\n\t\t\t\tthis._state = UnreferencedState.SweepReady;\n\t\t\t}\n\t\t});\n\n\t\tthis.inactiveTimer = new TimerWithNoDefaultTimeout(() => {\n\t\t\tthis._state = UnreferencedState.Inactive;\n\n\t\t\t// After the node becomes inactive, start the tombstone timer after which the node will be ready for tombstone.\n\t\t\tif (this.tombstoneTimeoutMs !== undefined) {\n\t\t\t\tthis.tombstoneTimer.restart(this.tombstoneTimeoutMs - this.inactiveTimeoutMs);\n\t\t\t}\n\t\t});\n\n\t\tthis.updateTracking(currentReferenceTimestampMs);\n\t}\n\n\t/* Updates the unreferenced state based on the provided timestamp. */\n\tpublic updateTracking(currentReferenceTimestampMs: number) {\n\t\tconst unreferencedDurationMs = currentReferenceTimestampMs - this.unreferencedTimestampMs;\n\n\t\t// Below we will set the appropriate timer (or none). Any running timers are superceded by the new currentReferenceTimestampMs\n\t\tthis.clearTimers();\n\n\t\t// If the node has been unreferenced long enough, update the state to SweepReady.\n\t\tif (\n\t\t\tthis.tombstoneTimeoutMs !== undefined &&\n\t\t\tunreferencedDurationMs >= this.tombstoneTimeoutMs + this.sweepGracePeriodMs\n\t\t) {\n\t\t\tthis._state = UnreferencedState.SweepReady;\n\t\t\treturn;\n\t\t}\n\n\t\t// If the node has been unreferenced long enough, update the state to TombstoneReady.\n\t\t// Also, start a timer for the remainder of the sweep delay.\n\t\tif (\n\t\t\tthis.tombstoneTimeoutMs !== undefined &&\n\t\t\tunreferencedDurationMs >= this.tombstoneTimeoutMs\n\t\t) {\n\t\t\tthis._state = UnreferencedState.TombstoneReady;\n\n\t\t\tthis.sweepTimer.restart(\n\t\t\t\tthis.tombstoneTimeoutMs + this.sweepGracePeriodMs - unreferencedDurationMs,\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\t// If the node has been unreferenced for long enough, update the state to inactive.\n\t\t// Also, start a timer for the remainder of the tombstone timeout.\n\t\tif (unreferencedDurationMs >= this.inactiveTimeoutMs) {\n\t\t\tthis._state = UnreferencedState.Inactive;\n\n\t\t\tif (this.tombstoneTimeoutMs !== undefined) {\n\t\t\t\tthis.tombstoneTimer.restart(this.tombstoneTimeoutMs - unreferencedDurationMs);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// The node is still active. Ensure the inactive timer is running with the proper remaining duration.\n\t\tthis.inactiveTimer.restart(this.inactiveTimeoutMs - unreferencedDurationMs);\n\t}\n\n\tprivate clearTimers() {\n\t\tthis.inactiveTimer.clear();\n\t\tthis.tombstoneTimer.clear();\n\t\tthis.sweepTimer.clear();\n\t}\n\n\t/** Stop tracking this node. Reset the unreferenced timers and state, if any. */\n\tpublic stopTracking() {\n\t\tthis.clearTimers();\n\t\tthis._state = UnreferencedState.Active;\n\t}\n}\n"]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { GarbageCollector } from "./garbageCollection.
|
|
6
|
-
export { nextGCVersion, defaultInactiveTimeoutMs, defaultSweepGracePeriodMs, defaultSessionExpiryDurationMs, GCNodeType, gcTestModeKey, gcDisableDataStoreSweepOptionName, gcDisableThrowOnTombstoneLoadOptionName, gcGenerationOptionName, GCFeatureMatrix, GCVersion, gcVersionUpgradeToV4Key, IGarbageCollectionRuntime, IGarbageCollector, IGarbageCollectorConfigs, IGarbageCollectorCreateParams, IGCMetadata, IGCMetadata_Deprecated, IGCResult, IGCRuntimeOptions, IMarkPhaseStats, ISweepPhaseStats, IGCStats, oneDayMs, runGCKey, runSessionExpiryKey, runSweepKey, stableGCVersion, disableDatastoreSweepKey, detectOutboundRoutesViaDDSKey, UnreferencedState, throwOnTombstoneLoadOverrideKey, GarbageCollectionMessage, ISweepMessage, } from "./gcDefinitions.
|
|
7
|
-
export { cloneGCData, concatGarbageCollectionStates, trimLeadingAndTrailingSlashes, unpackChildNodesGCDetails, } from "./gcHelpers.
|
|
8
|
-
export { runGarbageCollection } from "./gcReferenceGraphAlgorithm.
|
|
9
|
-
export { IGarbageCollectionNodeData, IGarbageCollectionSnapshotData, IGarbageCollectionState, IGarbageCollectionSummaryDetailsLegacy, } from "./gcSummaryDefinitions.
|
|
10
|
-
export { gcStateBlobKey, GCSummaryStateTracker, IGCSummaryTrackingData, } from "./gcSummaryStateTracker.
|
|
11
|
-
export { GCTelemetryTracker, sendGCUnexpectedUsageEvent } from "./gcTelemetry.
|
|
12
|
-
export { UnreferencedStateTracker } from "./gcUnreferencedStateTracker.
|
|
13
|
-
//# sourceMappingURL=index.d.
|
|
5
|
+
export { GarbageCollector } from "./garbageCollection.js";
|
|
6
|
+
export { nextGCVersion, defaultInactiveTimeoutMs, defaultSweepGracePeriodMs, defaultSessionExpiryDurationMs, GCNodeType, gcTestModeKey, gcDisableDataStoreSweepOptionName, gcDisableThrowOnTombstoneLoadOptionName, gcGenerationOptionName, GCFeatureMatrix, GCVersion, gcVersionUpgradeToV4Key, IGarbageCollectionRuntime, IGarbageCollector, IGarbageCollectorConfigs, IGarbageCollectorCreateParams, IGCMetadata, IGCMetadata_Deprecated, IGCResult, IGCRuntimeOptions, IMarkPhaseStats, ISweepPhaseStats, IGCStats, oneDayMs, runGCKey, runSessionExpiryKey, runSweepKey, stableGCVersion, disableAutoRecoveryKey, disableDatastoreSweepKey, detectOutboundRoutesViaDDSKey, UnreferencedState, throwOnTombstoneLoadOverrideKey, GarbageCollectionMessage, GarbageCollectionMessageType, ISweepMessage, } from "./gcDefinitions.js";
|
|
7
|
+
export { cloneGCData, concatGarbageCollectionStates, trimLeadingAndTrailingSlashes, unpackChildNodesGCDetails, } from "./gcHelpers.js";
|
|
8
|
+
export { runGarbageCollection } from "./gcReferenceGraphAlgorithm.js";
|
|
9
|
+
export { IGarbageCollectionNodeData, IGarbageCollectionSnapshotData, IGarbageCollectionState, IGarbageCollectionSummaryDetailsLegacy, } from "./gcSummaryDefinitions.js";
|
|
10
|
+
export { gcStateBlobKey, GCSummaryStateTracker, IGCSummaryTrackingData, } from "./gcSummaryStateTracker.js";
|
|
11
|
+
export { GCTelemetryTracker, sendGCUnexpectedUsageEvent } from "./gcTelemetry.js";
|
|
12
|
+
export { UnreferencedStateTracker } from "./gcUnreferencedStateTracker.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gc/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,UAAU,EACV,aAAa,EACb,iCAAiC,EACjC,uCAAuC,EACvC,sBAAsB,EACtB,eAAe,EACf,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,6BAA6B,EAC7B,WAAW,EACX,sBAAsB,EACtB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,iBAAiB,EACjB,+BAA+B,EAC/B,wBAAwB,EACxB,4BAA4B,EAC5B,aAAa,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACN,0BAA0B,EAC1B,8BAA8B,EAC9B,uBAAuB,EACvB,sCAAsC,GACtC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACN,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { GarbageCollector } from "./garbageCollection.
|
|
6
|
-
export { nextGCVersion, defaultInactiveTimeoutMs, defaultSweepGracePeriodMs, defaultSessionExpiryDurationMs, GCNodeType, gcTestModeKey, gcDisableDataStoreSweepOptionName, gcDisableThrowOnTombstoneLoadOptionName, gcGenerationOptionName, gcVersionUpgradeToV4Key, oneDayMs, runGCKey, runSessionExpiryKey, runSweepKey, stableGCVersion, disableDatastoreSweepKey, detectOutboundRoutesViaDDSKey, UnreferencedState, throwOnTombstoneLoadOverrideKey, } from "./gcDefinitions.
|
|
7
|
-
export { cloneGCData, concatGarbageCollectionStates, trimLeadingAndTrailingSlashes, unpackChildNodesGCDetails, } from "./gcHelpers.
|
|
8
|
-
export { runGarbageCollection } from "./gcReferenceGraphAlgorithm.
|
|
9
|
-
export { gcStateBlobKey, GCSummaryStateTracker, } from "./gcSummaryStateTracker.
|
|
10
|
-
export { GCTelemetryTracker, sendGCUnexpectedUsageEvent } from "./gcTelemetry.
|
|
11
|
-
export { UnreferencedStateTracker } from "./gcUnreferencedStateTracker.
|
|
12
|
-
//# sourceMappingURL=index.
|
|
5
|
+
export { GarbageCollector } from "./garbageCollection.js";
|
|
6
|
+
export { nextGCVersion, defaultInactiveTimeoutMs, defaultSweepGracePeriodMs, defaultSessionExpiryDurationMs, GCNodeType, gcTestModeKey, gcDisableDataStoreSweepOptionName, gcDisableThrowOnTombstoneLoadOptionName, gcGenerationOptionName, gcVersionUpgradeToV4Key, oneDayMs, runGCKey, runSessionExpiryKey, runSweepKey, stableGCVersion, disableAutoRecoveryKey, disableDatastoreSweepKey, detectOutboundRoutesViaDDSKey, UnreferencedState, throwOnTombstoneLoadOverrideKey, GarbageCollectionMessageType, } from "./gcDefinitions.js";
|
|
7
|
+
export { cloneGCData, concatGarbageCollectionStates, trimLeadingAndTrailingSlashes, unpackChildNodesGCDetails, } from "./gcHelpers.js";
|
|
8
|
+
export { runGarbageCollection } from "./gcReferenceGraphAlgorithm.js";
|
|
9
|
+
export { gcStateBlobKey, GCSummaryStateTracker, } from "./gcSummaryStateTracker.js";
|
|
10
|
+
export { GCTelemetryTracker, sendGCUnexpectedUsageEvent } from "./gcTelemetry.js";
|
|
11
|
+
export { UnreferencedStateTracker } from "./gcUnreferencedStateTracker.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gc/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EACN,aAAa,EACb,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,UAAU,EACV,aAAa,EACb,iCAAiC,EACjC,uCAAuC,EACvC,sBAAsB,EAGtB,uBAAuB,EAYvB,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,6BAA6B,EAC7B,iBAAiB,EACjB,+BAA+B,EAE/B,4BAA4B,GAE5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,WAAW,EACX,6BAA6B,EAC7B,6BAA6B,EAC7B,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAOtE,OAAO,EACN,cAAc,EACd,qBAAqB,GAErB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { GarbageCollector } from \"./garbageCollection.js\";\nexport {\n\tnextGCVersion,\n\tdefaultInactiveTimeoutMs,\n\tdefaultSweepGracePeriodMs,\n\tdefaultSessionExpiryDurationMs,\n\tGCNodeType,\n\tgcTestModeKey,\n\tgcDisableDataStoreSweepOptionName,\n\tgcDisableThrowOnTombstoneLoadOptionName,\n\tgcGenerationOptionName,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tgcVersionUpgradeToV4Key,\n\tIGarbageCollectionRuntime,\n\tIGarbageCollector,\n\tIGarbageCollectorConfigs,\n\tIGarbageCollectorCreateParams,\n\tIGCMetadata,\n\tIGCMetadata_Deprecated,\n\tIGCResult,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCStats,\n\toneDayMs,\n\trunGCKey,\n\trunSessionExpiryKey,\n\trunSweepKey,\n\tstableGCVersion,\n\tdisableAutoRecoveryKey,\n\tdisableDatastoreSweepKey,\n\tdetectOutboundRoutesViaDDSKey,\n\tUnreferencedState,\n\tthrowOnTombstoneLoadOverrideKey,\n\tGarbageCollectionMessage,\n\tGarbageCollectionMessageType,\n\tISweepMessage,\n} from \"./gcDefinitions.js\";\nexport {\n\tcloneGCData,\n\tconcatGarbageCollectionStates,\n\ttrimLeadingAndTrailingSlashes,\n\tunpackChildNodesGCDetails,\n} from \"./gcHelpers.js\";\nexport { runGarbageCollection } from \"./gcReferenceGraphAlgorithm.js\";\nexport {\n\tIGarbageCollectionNodeData,\n\tIGarbageCollectionSnapshotData,\n\tIGarbageCollectionState,\n\tIGarbageCollectionSummaryDetailsLegacy,\n} from \"./gcSummaryDefinitions.js\";\nexport {\n\tgcStateBlobKey,\n\tGCSummaryStateTracker,\n\tIGCSummaryTrackingData,\n} from \"./gcSummaryStateTracker.js\";\nexport { GCTelemetryTracker, sendGCUnexpectedUsageEvent } from \"./gcTelemetry.js\";\nexport { UnreferencedStateTracker } from \"./gcUnreferencedStateTracker.js\";\n"]}
|
|
@@ -2,24 +2,12 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
export { ISummaryRuntimeOptions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, IContainerRuntimeOptions, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime,
|
|
6
|
-
export { ContainerMessageType, ContainerRuntimeMessage, IContainerRuntimeMessageCompatDetails, CompatModeBehavior, RecentlyAddedContainerRuntimeMessageDetails, } from "./messageTypes.
|
|
7
|
-
export { IBlobManagerLoadInfo } from "./blobManager.
|
|
8
|
-
export { FluidDataStoreRegistry } from "./dataStoreRegistry.
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
|
|
14
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
15
|
-
*/
|
|
16
|
-
assertIsStableId,
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
19
|
-
*/
|
|
20
|
-
generateStableId,
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Import from `@fluidframework/id-compressor` instead.
|
|
23
|
-
*/
|
|
24
|
-
isStableId, } from "@fluidframework/id-compressor";
|
|
25
|
-
//# sourceMappingURL=index.d.mts.map
|
|
5
|
+
export { ISummaryRuntimeOptions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, IContainerRuntimeOptions, isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, TombstoneResponseHeaderKey, InactiveResponseHeaderKey, ISummaryConfiguration, DefaultSummaryConfiguration, ICompressionRuntimeOptions, CompressionAlgorithms, } from "./containerRuntime.js";
|
|
6
|
+
export { ContainerMessageType, ContainerRuntimeMessage, IContainerRuntimeMessageCompatDetails, CompatModeBehavior, RecentlyAddedContainerRuntimeMessageDetails, UnknownContainerRuntimeMessage, } from "./messageTypes.js";
|
|
7
|
+
export { IBlobManagerLoadInfo } from "./blobManager.js";
|
|
8
|
+
export { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
9
|
+
export { detectOutboundReferences, RuntimeHeaders, ChannelCollectionFactory, AllowTombstoneRequestHeaderKey, AllowInactiveRequestHeaderKey, } from "./channelCollection.js";
|
|
10
|
+
export { GCNodeType, IGCMetadata, GCFeatureMatrix, GCVersion, IGCRuntimeOptions, IMarkPhaseStats, ISweepPhaseStats, IGCStats, } from "./gc/index.js";
|
|
11
|
+
export { IAckedSummary, ISummarizer, ISummarizeResults, ISummaryCancellationToken, neverCancelledSummaryToken, Summarizer, SummarizerStopReason, SummaryCollection, EnqueueSummarizeResult, IAckSummaryResult, IBaseSummarizeResult, IBroadcastSummaryResult, ICancellationToken, IConnectableRuntime, IContainerRuntimeMetadata, ICreateContainerMetadata, IEnqueueSummarizeOptions, IGenerateSummaryTreeResult, IGeneratedSummaryStats, INackSummaryResult, IOnDemandSummarizeOptions, IRefreshSummaryAckOptions, ISubmitSummaryOpResult, ISubmitSummaryOptions, ISerializedElection, ISummarizeOptions, ISummarizerEvents, ISummarizerInternalsProvider, ISummarizerRuntime, ISummarizingWarning, IUploadSummaryResult, SubmitSummaryResult, SummarizeResultPart, IClientSummaryWatcher, ISummary, ISummaryCollectionOpEvents, ISummaryAckMessage, ISummaryMetadataMessage, ISummaryNackMessage, ISummaryOpMessage, OpActionEventListener, OpActionEventName, ICancellableSummarizerController, SubmitSummaryFailureData, SummaryStage, IRetriableFailureResult, ISummarizeEventProps, IdCompressorMode, } from "./summary/index.js";
|
|
12
|
+
export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle/index.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,yBAAyB,EACzB,+BAA+B,EAC/B,sCAAsC,EACtC,sCAAsC,EACtC,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,oBAAoB,EACpB,uBAAuB,EACvB,qCAAqC,EACrC,kBAAkB,EAClB,2CAA2C,EAC3C,8BAA8B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACN,wBAAwB,EACxB,cAAc,EACd,wBAAwB,EACxB,8BAA8B,EAC9B,6BAA6B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,QAAQ,GACR,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,0BAA0B,EAC1B,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,4BAA4B,EAC5B,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,QAAQ,EACR,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gCAAgC,EAChC,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,oBAAoB,EACpB,gBAAgB,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { isRuntimeMessage, RuntimeMessage, agentSchedulerId, ContainerRuntime, TombstoneResponseHeaderKey, InactiveResponseHeaderKey, DefaultSummaryConfiguration, CompressionAlgorithms, } from "./containerRuntime.js";
|
|
6
|
+
export { ContainerMessageType, } from "./messageTypes.js";
|
|
7
|
+
export { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
|
|
8
|
+
export { detectOutboundReferences, RuntimeHeaders, ChannelCollectionFactory, AllowTombstoneRequestHeaderKey, AllowInactiveRequestHeaderKey, } from "./channelCollection.js";
|
|
9
|
+
export { GCNodeType, } from "./gc/index.js";
|
|
10
|
+
export { neverCancelledSummaryToken, Summarizer, SummaryCollection, } from "./summary/index.js";
|
|
11
|
+
export { unpackRuntimeMessage } from "./opLifecycle/index.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAON,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,0BAA0B,EAC1B,yBAAyB,EAEzB,2BAA2B,EAE3B,qBAAqB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,oBAAoB,GAMpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACN,wBAAwB,EACxB,cAAc,EACd,wBAAwB,EACxB,8BAA8B,EAC9B,6BAA6B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACN,UAAU,GAQV,MAAM,eAAe,CAAC;AACvB,OAAO,EAKN,0BAA0B,EAC1B,UAAU,EAEV,iBAAiB,GAyCjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAc,oBAAoB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tISummaryRuntimeOptions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tIContainerRuntimeOptions,\n\tisRuntimeMessage,\n\tRuntimeMessage,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n\tICompressionRuntimeOptions,\n\tCompressionAlgorithms,\n} from \"./containerRuntime.js\";\nexport {\n\tContainerMessageType,\n\tContainerRuntimeMessage,\n\tIContainerRuntimeMessageCompatDetails,\n\tCompatModeBehavior,\n\tRecentlyAddedContainerRuntimeMessageDetails,\n\tUnknownContainerRuntimeMessage,\n} from \"./messageTypes.js\";\nexport { IBlobManagerLoadInfo } from \"./blobManager.js\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport {\n\tdetectOutboundReferences,\n\tRuntimeHeaders,\n\tChannelCollectionFactory,\n\tAllowTombstoneRequestHeaderKey,\n\tAllowInactiveRequestHeaderKey,\n} from \"./channelCollection.js\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCStats,\n} from \"./gc/index.js\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\n\tSummarizerStopReason,\n\tSummaryCollection,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tIBaseSummarizeResult,\n\tIBroadcastSummaryResult,\n\tICancellationToken,\n\tIConnectableRuntime,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIGeneratedSummaryStats,\n\tINackSummaryResult,\n\tIOnDemandSummarizeOptions,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOpResult,\n\tISubmitSummaryOptions,\n\tISerializedElection,\n\tISummarizeOptions,\n\tISummarizerEvents,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSubmitSummaryResult,\n\tSummarizeResultPart,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryCollectionOpEvents,\n\tISummaryAckMessage,\n\tISummaryMetadataMessage,\n\tISummaryNackMessage,\n\tISummaryOpMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n\tICancellableSummarizerController,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureResult,\n\tISummarizeEventProps,\n\tIdCompressorMode,\n} from \"./summary/index.js\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle/index.js\";\n"]}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
6
6
|
import { IEnvelope, InboundAttachMessage, IAttachMessage } from "@fluidframework/runtime-definitions";
|
|
7
7
|
import type { IdCreationRange } from "@fluidframework/id-compressor";
|
|
8
|
-
import { IDataStoreAliasMessage } from "./dataStore.
|
|
9
|
-
import { GarbageCollectionMessage } from "./gc/index.
|
|
10
|
-
import { IChunkedOp } from "./opLifecycle/index.
|
|
8
|
+
import { IDataStoreAliasMessage } from "./dataStore.js";
|
|
9
|
+
import { GarbageCollectionMessage } from "./gc/index.js";
|
|
10
|
+
import { IChunkedOp } from "./opLifecycle/index.js";
|
|
11
11
|
/**
|
|
12
12
|
* @alpha
|
|
13
13
|
*/
|
|
@@ -80,7 +80,7 @@ export type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<Containe
|
|
|
80
80
|
export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<ContainerMessageType.IdAllocation, IdCreationRange>;
|
|
81
81
|
export type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<ContainerMessageType.GC, GarbageCollectionMessage>;
|
|
82
82
|
/**
|
|
83
|
-
* Represents an unrecognized
|
|
83
|
+
* Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime.
|
|
84
84
|
* @internal
|
|
85
85
|
*/
|
|
86
86
|
export interface UnknownContainerRuntimeMessage extends Partial<RecentlyAddedContainerRuntimeMessageDetails> {
|
|
@@ -139,4 +139,4 @@ export interface ContainerRuntimeMessage {
|
|
|
139
139
|
compatDetails?: IContainerRuntimeMessageCompatDetails;
|
|
140
140
|
}
|
|
141
141
|
export {};
|
|
142
|
-
//# sourceMappingURL=messageTypes.d.
|
|
142
|
+
//# sourceMappingURL=messageTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageTypes.d.ts","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACN,SAAS,EACT,oBAAoB,EACpB,cAAc,EACd,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD;;GAEG;AACH,oBAAY,oBAAoB;IAE/B,gBAAgB,cAAc;IAG9B,MAAM,WAAW;IAGjB,SAAS,cAAc;IAGvB,UAAU,eAAe;IAGzB,MAAM,WAAW;IAGjB,KAAK,UAAU;IAEf;;;;OAIG;IACH,YAAY,iBAAiB;IAE7B;;;OAGG;IACH,EAAE,OAAO;CACT;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB;AAC7B,qEAAqE;AACnE,QAAQ;AACV,8DAA8D;GAC5D,eAAe,CAAC;AAEnB;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C;IAC3B,kEAAkE;IAClE,QAAQ,EAAE,GAAG,CAAC;IACd,wGAAwG;IACxG,aAAa,CAAC,EAAE,qCAAqC,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageTypes.js","sourceRoot":"","sources":["../src/messageTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;GAEG;AACH,MAAM,CAAN,IAAY,oBA+BX;AA/BD,WAAY,oBAAoB;IAC/B,iCAAiC;IACjC,sDAA8B,CAAA;IAE9B,sBAAsB;IACtB,yCAAiB,CAAA;IAEjB,qBAAqB;IACrB,+CAAuB,CAAA;IAEvB,yFAAyF;IACzF,iDAAyB,CAAA;IAEzB,oDAAoD;IACpD,yCAAiB,CAAA;IAEjB,sCAAsC;IACtC,uCAAe,CAAA;IAEf;;;;OAIG;IACH,qDAA6B,CAAA;IAE7B;;;OAGG;IACH,iCAAS,CAAA;AACV,CAAC,EA/BW,oBAAoB,KAApB,oBAAoB,QA+B/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIEnvelope,\n\tInboundAttachMessage,\n\tIAttachMessage,\n} from \"@fluidframework/runtime-definitions\";\nimport type { IdCreationRange } from \"@fluidframework/id-compressor\";\nimport { IDataStoreAliasMessage } from \"./dataStore.js\";\nimport { GarbageCollectionMessage } from \"./gc/index.js\";\nimport { IChunkedOp } from \"./opLifecycle/index.js\";\n\n/**\n * @alpha\n */\nexport enum ContainerMessageType {\n\t// An op to be delivered to store\n\tFluidDataStoreOp = \"component\",\n\n\t// Creates a new store\n\tAttach = \"attach\",\n\n\t// Chunked operation.\n\tChunkedOp = \"chunkedOp\",\n\n\t// Signifies that a blob has been attached and should not be garbage collected by storage\n\tBlobAttach = \"blobAttach\",\n\n\t// Ties our new clientId to our old one on reconnect\n\tRejoin = \"rejoin\",\n\n\t// Sets the alias of a root data store\n\tAlias = \"alias\",\n\n\t/**\n\t * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since\n\t * the last allocation op was sent.\n\t * See the [IdCompressor README](./id-compressor/README.md) for more details.\n\t */\n\tIdAllocation = \"idAllocation\",\n\n\t/**\n\t * Garbage collection specific op. This is sent by the summarizer client when GC runs. It's used to synchronize GC\n\t * state across all clients.\n\t */\n\tGC = \"GC\",\n}\n\n/**\n * How should an older client handle an unrecognized remote op type?\n *\n * @internal\n */\nexport type CompatModeBehavior =\n\t/** Ignore the op. It won't be persisted if this client summarizes */\n\t| \"Ignore\"\n\t/** Fail processing immediately. (The container will close) */\n\t| \"FailToProcess\";\n\n/**\n * All the info an older client would need to know how to handle an unrecognized remote op type\n *\n * @internal\n */\nexport interface IContainerRuntimeMessageCompatDetails {\n\t/** How should an older client handle an unrecognized remote op type? */\n\tbehavior: CompatModeBehavior;\n}\n\n/**\n * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.\n * Message type are differentiated via a `type` string and contain different contents depending on their type.\n *\n * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.\n * This way stringified values can be compared.\n */\ninterface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents>\n\textends Partial<RecentlyAddedContainerRuntimeMessageDetails> {\n\t/** Type of the op, within the ContainerRuntime's domain */\n\ttype: TType;\n\t/** Domain-specific contents, interpreted according to the type */\n\tcontents: TContents;\n}\n\n/**\n * Additional details expected for any recently added message.\n * @internal\n */\nexport interface RecentlyAddedContainerRuntimeMessageDetails {\n\t/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */\n\tcompatDetails: IContainerRuntimeMessageCompatDetails;\n}\n\nexport type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.FluidDataStoreOp,\n\tIEnvelope\n>;\nexport type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tInboundAttachMessage\n>;\nexport type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Attach,\n\tIAttachMessage\n>;\nexport type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.ChunkedOp,\n\tIChunkedOp\n>;\nexport type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.BlobAttach,\n\tundefined\n>;\nexport type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Rejoin,\n\tundefined\n>;\nexport type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.Alias,\n\tIDataStoreAliasMessage\n>;\nexport type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.IdAllocation,\n\tIdCreationRange\n>;\nexport type ContainerRuntimeGCMessage = TypedContainerRuntimeMessage<\n\tContainerMessageType.GC,\n\tGarbageCollectionMessage\n>;\n\n/**\n * Represents an unrecognized TypedContainerRuntimeMessage, e.g. a message from a future version of the container runtime.\n * @internal\n */\nexport interface UnknownContainerRuntimeMessage\n\textends Partial<RecentlyAddedContainerRuntimeMessageDetails> {\n\t/** Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.\n\t * This is useful for type narrowing but should never be used as an actual message type at runtime.\n\t * Actual value will not be \"__unknown...\", but the type `Exclude<string, ContainerMessageType>` is not supported.\n\t */\n\ttype: \"__unknown_container_message_type__never_use_as_value__\";\n\n\t/** Domain-specific contents, but not decipherable by an unknown op. */\n\tcontents: unknown;\n}\n\n/**\n * A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.\n */\nexport type InboundContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| InboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t// Inbound messages may include unknown types from other clients, so we include that as a special case here\n\t| UnknownContainerRuntimeMessage;\n\n/** A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime but is not yet being sent to the server. */\nexport type LocalContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| OutboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage\n\t// In rare cases (e.g. related to stashed ops) we could have a local message of an unknown type\n\t| UnknownContainerRuntimeMessage;\n\n/** A {@link TypedContainerRuntimeMessage} that is being sent to the server from the container runtime. */\nexport type OutboundContainerRuntimeMessage =\n\t| ContainerRuntimeDataStoreOpMessage\n\t| OutboundContainerRuntimeAttachMessage\n\t| ContainerRuntimeChunkedOpMessage\n\t| ContainerRuntimeBlobAttachMessage\n\t| ContainerRuntimeRejoinMessage\n\t| ContainerRuntimeAliasMessage\n\t| ContainerRuntimeIdAllocationMessage\n\t| ContainerRuntimeGCMessage;\n\n/**\n * An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc\n * promoted up to the outer object\n */\nexport type InboundSequencedContainerRuntimeMessage = Omit<\n\tISequencedDocumentMessage,\n\t\"type\" | \"contents\"\n> &\n\tInboundContainerRuntimeMessage;\n\n/** Essentially ISequencedDocumentMessage except that `type` is not `string` to enable narrowing\n * as `Exclude<string, InboundContainerRuntimeMessage['type']>` is not supported.\n * There should never be a runtime value of \"__not_a_...\".\n * Currently additionally replaces `contents` type until protocol-definitions update is taken with `unknown` instead of `any`.\n */\ntype InboundSequencedNonContainerRuntimeMessage = Omit<\n\tISequencedDocumentMessage,\n\t\"type\" | \"contents\"\n> & { type: \"__not_a_container_runtime_message_type__\"; contents: unknown };\n\nexport type InboundSequencedContainerRuntimeMessageOrSystemMessage =\n\t| InboundSequencedContainerRuntimeMessage\n\t| InboundSequencedNonContainerRuntimeMessage;\n\n/** A [loose] InboundSequencedContainerRuntimeMessage that is recent and may contain compat details.\n * It exists solely to to provide access to those details.\n */\nexport type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDocumentMessage &\n\tPartial<RecentlyAddedContainerRuntimeMessageDetails>;\n\n/**\n * The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime\n *\n * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.\n * This way stringified values can be compared.\n *\n * @deprecated this is an internal type which should not be used outside of the package.\n * Internally, it is superseded by `TypedContainerRuntimeMessage`.\n *\n * @internal\n */\nexport interface ContainerRuntimeMessage {\n\t/** Type of the op, within the ContainerRuntime's domain */\n\ttype: ContainerMessageType;\n\t/** Domain-specific contents, interpreted according to the type */\n\tcontents: any;\n\t/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */\n\tcompatDetails?: IContainerRuntimeMessageCompatDetails;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Batching makes assumptions about what might be on the metadata. This interface codifies those assumptions, but does not validate them.\n */\nexport interface IBatchMetadata {\n\tbatch?: boolean;\n}\n\n/**\n * Blob handling makes assumptions about what might be on the metadata. This interface codifies those assumptions, but does not validate them.\n */\nexport interface IBlobMetadata {\n\tblobId?: string;\n\tlocalId?: string;\n}\n\n/**\n * The IdCompressor needs to know if this is a replayed savedOp as those need to be skipped in stashed ops scenarios.\n */\nexport interface IIdAllocationMetadata {\n\tsavedOp?: boolean;\n}\n"]}
|
|
@@ -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 { ICompressionRuntimeOptions } from "../containerRuntime.
|
|
6
|
-
import { BatchMessage, IBatch, IBatchCheckpoint } from "./definitions.
|
|
5
|
+
import { ICompressionRuntimeOptions } from "../containerRuntime.js";
|
|
6
|
+
import { BatchMessage, IBatch, IBatchCheckpoint } from "./definitions.js";
|
|
7
7
|
export interface IBatchManagerOptions {
|
|
8
8
|
readonly hardLimit: number;
|
|
9
9
|
readonly softLimit?: number;
|
|
@@ -45,4 +45,4 @@ export declare class BatchManager {
|
|
|
45
45
|
*/
|
|
46
46
|
export declare const estimateSocketSize: (batch: IBatch) => number;
|
|
47
47
|
export declare const sequenceNumbersMatch: (seqNums: BatchSequenceNumbers, otherSeqNums: BatchSequenceNumbers) => boolean;
|
|
48
|
-
//# sourceMappingURL=batchManager.d.
|
|
48
|
+
//# sourceMappingURL=batchManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batchManager.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;CACzD;AAED,MAAM,WAAW,oBAAoB;IACpC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAQD;;GAEG;AACH,qBAAa,YAAY;aA2BI,OAAO,EAAE,oBAAoB;IA1BzD,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,eAAe,CAAS;IAEhC,IAAW,MAAM,WAEhB;IACD,IAAW,kBAAkB,WAE5B;IAED,IAAW,eAAe,IAAI,oBAAoB,CAKjD;IAED,OAAO,KAAK,uBAAuB,GAIlC;IAED,OAAO,CAAC,oBAAoB,CAAqB;gBAErB,OAAO,EAAE,oBAAoB;IAElD,IAAI,CACV,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,OAAO,EAClB,2BAA2B,CAAC,EAAE,MAAM,GAClC,OAAO;IAsCV,IAAW,KAAK,YAEf;IAEM,QAAQ,IAAI,MAAM;IAgBzB;;OAEG;IACI,UAAU,IAAI,gBAAgB;CAerC;AAiBD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,UAAW,MAAM,KAAG,MAElD,CAAC;AAEF,eAAO,MAAM,oBAAoB,YACvB,oBAAoB,gBACf,oBAAoB,KAChC,OASF,CAAC"}
|
|
@@ -130,4 +130,4 @@ export const sequenceNumbersMatch = (seqNums, otherSeqNums) => {
|
|
|
130
130
|
otherSeqNums.clientSequenceNumber === undefined ||
|
|
131
131
|
seqNums.clientSequenceNumber === otherSeqNums.clientSequenceNumber));
|
|
132
132
|
};
|
|
133
|
-
//# sourceMappingURL=batchManager.
|
|
133
|
+
//# sourceMappingURL=batchManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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BAAoB,GAAG,CACnC,OAA6B,EAC7B,YAAkC,EACxB,EAAE;IACZ,OAAO,CACN,CAAC,OAAO,CAAC,uBAAuB,KAAK,SAAS;QAC7C,YAAY,CAAC,uBAAuB,KAAK,SAAS;QAClD,OAAO,CAAC,uBAAuB,KAAK,YAAY,CAAC,uBAAuB,CAAC;QAC1E,CAAC,OAAO,CAAC,oBAAoB,KAAK,SAAS;YAC1C,YAAY,CAAC,oBAAoB,KAAK,SAAS;YAC/C,OAAO,CAAC,oBAAoB,KAAK,YAAY,CAAC,oBAAoB,CAAC,CACpE,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICompressionRuntimeOptions } from \"../containerRuntime.js\";\nimport { BatchMessage, IBatch, IBatchCheckpoint } from \"./definitions.js\";\n\nexport interface IBatchManagerOptions {\n\treadonly hardLimit: number;\n\treadonly softLimit?: number;\n\treadonly compressionOptions?: ICompressionRuntimeOptions;\n}\n\nexport interface BatchSequenceNumbers {\n\treferenceSequenceNumber?: number;\n\tclientSequenceNumber?: number;\n}\n\n/**\n * Estimated size of the stringification overhead for an op accumulated\n * from runtime to loader to the service.\n */\nconst opOverhead = 200;\n\n/**\n * Helper class that manages partial batch & rollback.\n */\nexport class BatchManager {\n\tprivate pendingBatch: BatchMessage[] = [];\n\tprivate batchContentSize = 0;\n\tprivate hasReentrantOps = false;\n\n\tpublic get length() {\n\t\treturn this.pendingBatch.length;\n\t}\n\tpublic get contentSizeInBytes() {\n\t\treturn this.batchContentSize;\n\t}\n\n\tpublic get sequenceNumbers(): BatchSequenceNumbers {\n\t\treturn {\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tclientSequenceNumber: this.clientSequenceNumber,\n\t\t};\n\t}\n\n\tprivate get referenceSequenceNumber(): number | undefined {\n\t\treturn this.pendingBatch.length === 0\n\t\t\t? undefined\n\t\t\t: this.pendingBatch[this.pendingBatch.length - 1].referenceSequenceNumber;\n\t}\n\n\tprivate clientSequenceNumber: number | undefined;\n\n\tconstructor(public readonly options: IBatchManagerOptions) {}\n\n\tpublic push(\n\t\tmessage: BatchMessage,\n\t\treentrant: boolean,\n\t\tcurrentClientSequenceNumber?: number,\n\t): boolean {\n\t\tconst contentSize = this.batchContentSize + (message.contents?.length ?? 0);\n\t\tconst opCount = this.pendingBatch.length;\n\t\tthis.hasReentrantOps = this.hasReentrantOps || reentrant;\n\n\t\t// Attempt to estimate batch size, aka socket message size.\n\t\t// Each op has pretty large envelope, estimating to be 200 bytes.\n\t\t// Also content will be strigified, and that adds a lot of overhead due to a lot of escape characters.\n\t\t// Not taking it into account, as compression work should help there - compressed payload will be\n\t\t// initially stored as base64, and that requires only 2 extra escape characters.\n\t\tconst socketMessageSize = contentSize + opOverhead * opCount;\n\n\t\t// If we were provided soft limit, check for exceeding it.\n\t\t// But only if we have any ops, as the intention here is to flush existing ops (on exceeding this limit)\n\t\t// and start over. That's not an option if we have no ops.\n\t\t// If compression is enabled, the soft and hard limit are ignored and the message will be pushed anyways.\n\t\t// Cases where the message is still too large will be handled by the maxConsecutiveReconnects path.\n\t\tif (\n\t\t\tthis.options.softLimit !== undefined &&\n\t\t\tthis.length > 0 &&\n\t\t\tsocketMessageSize >= this.options.softLimit\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (socketMessageSize >= this.options.hardLimit) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.pendingBatch.length === 0) {\n\t\t\tthis.clientSequenceNumber = currentClientSequenceNumber;\n\t\t}\n\n\t\tthis.batchContentSize = contentSize;\n\t\tthis.pendingBatch.push(message);\n\t\treturn true;\n\t}\n\n\tpublic get empty() {\n\t\treturn this.pendingBatch.length === 0;\n\t}\n\n\tpublic popBatch(): IBatch {\n\t\tconst batch: IBatch = {\n\t\t\tcontent: this.pendingBatch,\n\t\t\tcontentSizeInBytes: this.batchContentSize,\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\thasReentrantOps: this.hasReentrantOps,\n\t\t};\n\n\t\tthis.pendingBatch = [];\n\t\tthis.batchContentSize = 0;\n\t\tthis.clientSequenceNumber = undefined;\n\t\tthis.hasReentrantOps = false;\n\n\t\treturn addBatchMetadata(batch);\n\t}\n\n\t/**\n\t * Capture the pending state at this point\n\t */\n\tpublic checkpoint(): IBatchCheckpoint {\n\t\tconst startPoint = this.pendingBatch.length;\n\t\treturn {\n\t\t\trollback: (process: (message: BatchMessage) => void) => {\n\t\t\t\tfor (let i = this.pendingBatch.length; i > startPoint; ) {\n\t\t\t\t\ti--;\n\t\t\t\t\tconst message = this.pendingBatch[i];\n\t\t\t\t\tthis.batchContentSize -= message.contents?.length ?? 0;\n\t\t\t\t\tprocess(message);\n\t\t\t\t}\n\n\t\t\t\tthis.pendingBatch.length = startPoint;\n\t\t\t},\n\t\t};\n\t}\n}\n\nconst addBatchMetadata = (batch: IBatch): IBatch => {\n\tif (batch.content.length > 1) {\n\t\tbatch.content[0].metadata = {\n\t\t\t...batch.content[0].metadata,\n\t\t\tbatch: true,\n\t\t};\n\t\tbatch.content[batch.content.length - 1].metadata = {\n\t\t\t...batch.content[batch.content.length - 1].metadata,\n\t\t\tbatch: false,\n\t\t};\n\t}\n\n\treturn batch;\n};\n\n/**\n * Estimates the real size in bytes on the socket for a given batch. It assumes that\n * the envelope size (and the size of an empty op) is 200 bytes, taking into account\n * extra overhead from stringification.\n *\n * @param batch - the batch to inspect\n * @returns An estimate of the payload size in bytes which will be produced when the batch is sent over the wire\n */\nexport const estimateSocketSize = (batch: IBatch): number => {\n\treturn batch.contentSizeInBytes + opOverhead * batch.content.length;\n};\n\nexport const sequenceNumbersMatch = (\n\tseqNums: BatchSequenceNumbers,\n\totherSeqNums: BatchSequenceNumbers,\n): boolean => {\n\treturn (\n\t\t(seqNums.referenceSequenceNumber === undefined ||\n\t\t\totherSeqNums.referenceSequenceNumber === undefined ||\n\t\t\tseqNums.referenceSequenceNumber === otherSeqNums.referenceSequenceNumber) &&\n\t\t(seqNums.clientSequenceNumber === undefined ||\n\t\t\totherSeqNums.clientSequenceNumber === undefined ||\n\t\t\tseqNums.clientSequenceNumber === otherSeqNums.clientSequenceNumber)\n\t);\n};\n"]}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
6
6
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
7
|
-
import { CompressionAlgorithms } from "../containerRuntime.
|
|
8
|
-
import { ContainerMessageType } from "../messageTypes.
|
|
7
|
+
import { CompressionAlgorithms } from "../containerRuntime.js";
|
|
8
|
+
import { ContainerMessageType } from "../messageTypes.js";
|
|
9
9
|
/**
|
|
10
10
|
* Batch message type used internally by the runtime
|
|
11
11
|
*/
|
|
@@ -80,4 +80,4 @@ export interface IMessageProcessingResult {
|
|
|
80
80
|
*/
|
|
81
81
|
readonly state: ProcessingState;
|
|
82
82
|
}
|
|
83
|
-
//# sourceMappingURL=definitions.d.
|
|
83
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/definitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG;IAC1C,eAAe,EAAE,OAAO,CAAC;IACzB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,qBAAqB,CAAC;CACpC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,MAAM;IACtB;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,uBAAuB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrD;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,KAAK,IAAI,CAAC;CAC5D;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,WAAW,GAAG,oBAAoB,CAAC;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,yBAAyB,CAAC;IAC5C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/opLifecycle/definitions.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IBatchMessage } from \"@fluidframework/container-definitions\";\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport { CompressionAlgorithms } from \"../containerRuntime.js\";\nimport { ContainerMessageType } from \"../messageTypes.js\";\n\n/**\n * Batch message type used internally by the runtime\n */\nexport type BatchMessage = IBatchMessage & {\n\tlocalOpMetadata: unknown;\n\ttype: ContainerMessageType;\n\treferenceSequenceNumber: number;\n\tcompression?: CompressionAlgorithms;\n};\n\n/**\n * Batch interface used internally by the runtime.\n */\nexport interface IBatch {\n\t/**\n\t * Sum of the in-memory content sizes of all messages in the batch.\n\t * If the batch is compressed, this number reflects the post-compression size.\n\t */\n\treadonly contentSizeInBytes: number;\n\t/**\n\t * All the messages in the batch\n\t */\n\treadonly content: BatchMessage[];\n\t/**\n\t * The reference sequence number for the batch\n\t */\n\treadonly referenceSequenceNumber: number | undefined;\n\t/**\n\t * Wether or not the batch contains at least one op which was produced as the result\n\t * of processing another op. This means that the batch must be rebased before\n\t * submitted, to ensure that all ops have the same reference sequence numbers and a\n\t * consistent view of the data model. This happens when the op is created within a\n\t * 'changed' event handler of a DDS and will have a different reference sequence number\n\t * than the rest of the ops in the batch, meaning that it has a different view of the\n\t * state of the data model, therefore all ops must be resubmitted and rebased to the current\n\t * reference sequence number to be in agreement about the data model state.\n\t */\n\treadonly hasReentrantOps?: boolean;\n}\n\nexport interface IBatchCheckpoint {\n\trollback: (action: (message: BatchMessage) => void) => void;\n}\n\n/**\n * @internal\n */\nexport interface IChunkedOp {\n\tchunkId: number;\n\ttotalChunks: number;\n\tcontents: string;\n\toriginalType: MessageType | ContainerMessageType;\n\toriginalMetadata?: Record<string, unknown>;\n\toriginalCompression?: string;\n}\n\n/**\n * The state of remote message processing:\n * `Processed` - the message can be considered processed\n * `Skipped` - the message was ignored by the processor\n * `Accepted` - the message was processed partially. Eventually, a message\n * will make the processor return `Processed`.\n */\nexport type ProcessingState = \"Processed\" | \"Skipped\" | \"Accepted\";\n\n/**\n * Return type for functions which process remote messages\n */\nexport interface IMessageProcessingResult {\n\t/**\n\t * A shallow copy of the input message if processing happened, or\n\t * the original message otherwise\n\t */\n\treadonly message: ISequencedDocumentMessage;\n\t/**\n\t * Processing result of the input message.\n\t */\n\treadonly state: ProcessingState;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { BatchManager, estimateSocketSize, BatchSequenceNumbers } from "./batchManager.js";
|
|
6
|
+
export { BatchMessage, IBatch, IBatchCheckpoint, IChunkedOp, IMessageProcessingResult, } from "./definitions.js";
|
|
7
|
+
export { Outbox, getLongStack } from "./outbox.js";
|
|
8
|
+
export { OpCompressor } from "./opCompressor.js";
|
|
9
|
+
export { OpDecompressor } from "./opDecompressor.js";
|
|
10
|
+
export { OpSplitter, splitOp } from "./opSplitter.js";
|
|
11
|
+
export { RemoteMessageProcessor, unpackRuntimeMessage } from "./remoteMessageProcessor.js";
|
|
12
|
+
export { OpGroupingManager } from "./opGroupingManager.js";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EACN,YAAY,EACZ,MAAM,EACN,gBAAgB,EAChB,UAAU,EACV,wBAAwB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export { BatchManager, estimateSocketSize } from "./batchManager.js";
|
|
6
|
+
export { Outbox, getLongStack } from "./outbox.js";
|
|
7
|
+
export { OpCompressor } from "./opCompressor.js";
|
|
8
|
+
export { OpDecompressor } from "./opDecompressor.js";
|
|
9
|
+
export { OpSplitter, splitOp } from "./opSplitter.js";
|
|
10
|
+
export { RemoteMessageProcessor, unpackRuntimeMessage } from "./remoteMessageProcessor.js";
|
|
11
|
+
export { OpGroupingManager } from "./opGroupingManager.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/opLifecycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAwB,MAAM,mBAAmB,CAAC;AAQ3F,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { BatchManager, estimateSocketSize, BatchSequenceNumbers } from \"./batchManager.js\";\nexport {\n\tBatchMessage,\n\tIBatch,\n\tIBatchCheckpoint,\n\tIChunkedOp,\n\tIMessageProcessingResult,\n} from \"./definitions.js\";\nexport { Outbox, getLongStack } from \"./outbox.js\";\nexport { OpCompressor } from \"./opCompressor.js\";\nexport { OpDecompressor } from \"./opDecompressor.js\";\nexport { OpSplitter, splitOp } from \"./opSplitter.js\";\nexport { RemoteMessageProcessor, unpackRuntimeMessage } from \"./remoteMessageProcessor.js\";\nexport { OpGroupingManager } from \"./opGroupingManager.js\";\n"]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
6
|
-
import { IBatch } from "./definitions.
|
|
6
|
+
import { IBatch } from "./definitions.js";
|
|
7
7
|
/**
|
|
8
8
|
* Compresses batches of ops. It generates a single compressed op that contains
|
|
9
9
|
* the contents of each op in the batch. It then submits empty ops for each original
|
|
@@ -15,4 +15,4 @@ export declare class OpCompressor {
|
|
|
15
15
|
compressBatch(batch: IBatch): IBatch;
|
|
16
16
|
private serializeBatch;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=opCompressor.d.
|
|
18
|
+
//# sourceMappingURL=opCompressor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opCompressor.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/opCompressor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EAAE,MAAM,EAAgB,MAAM,kBAAkB,CAAC;AAExD;;;;GAIG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAEZ,MAAM,EAAE,oBAAoB;IAIjC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAkD3C,OAAO,CAAC,cAAc;CAsBtB"}
|
|
@@ -6,8 +6,8 @@ import { createChildLogger, UsageError } from "@fluidframework/telemetry-utils";
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils";
|
|
7
7
|
import { IsoBuffer } from "@fluid-internal/client-utils";
|
|
8
8
|
import { compress } from "lz4js";
|
|
9
|
-
import { CompressionAlgorithms } from "../containerRuntime.
|
|
10
|
-
import { estimateSocketSize } from "./batchManager.
|
|
9
|
+
import { CompressionAlgorithms } from "../containerRuntime.js";
|
|
10
|
+
import { estimateSocketSize } from "./batchManager.js";
|
|
11
11
|
/**
|
|
12
12
|
* Compresses batches of ops. It generates a single compressed op that contains
|
|
13
13
|
* the contents of each op in the batch. It then submits empty ops for each original
|
|
@@ -77,4 +77,4 @@ export class OpCompressor {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
//# sourceMappingURL=opCompressor.
|
|
80
|
+
//# sourceMappingURL=opCompressor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opCompressor.js","sourceRoot":"","sources":["../../src/opLifecycle/opCompressor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAGvD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAGxB,YAAY,MAA4B;QACvC,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;IACxE,CAAC;IAEM,aAAa,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BAAiB,CAAC,MAAM;YAC5C,OAAO,EAAE,QAAQ;YACjB,uBAAuB,EAAE,KAAK,CAAC,uBAAuB;SACtD,CAAC;QAEF,IAAI,KAAK,CAAC,kBAAkB,GAAG,MAAM,EAAE;YACtC,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;gBAChC,SAAS,EAAE,iBAAiB;gBAC5B,QAAQ;gBACR,qBAAqB,EAAE,KAAK,CAAC,kBAAkB;gBAC/C,oBAAoB,EAAE,eAAe,CAAC,kBAAkB;gBACxD,OAAO,EAAE,eAAe,CAAC,OAAO,CAAC,MAAM;gBACvC,UAAU,EAAE,kBAAkB,CAAC,eAAe,CAAC;aAC/C,CAAC,CAAC;SACH;QAED,OAAO,eAAe,CAAC;IACxB,CAAC;IAEO,cAAc,CAAC,KAAa;QACnC,IAAI;YACH,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;SACzE;QAAC,OAAO,CAAM,EAAE;YAChB,IAAI,CAAC,CAAC,OAAO,KAAK,uBAAuB,EAAE;gBAC1C,0CAA0C;gBAC1C,wCAAwC;gBACxC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,mBAAmB,CAAC,CAAC;gBAClD,IAAI,CAAC,MAAM,CAAC,cAAc,CACzB;oBACC,SAAS,EAAE,eAAe;oBAC1B,IAAI,EAAE,KAAK,CAAC,kBAAkB;oBAC9B,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM;iBAC5B,EACD,KAAK,CACL,CAAC;gBACF,MAAM,KAAK,CAAC;aACZ;YAED,MAAM,CAAC,CAAC;SACR;IACF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { createChildLogger, UsageError } from \"@fluidframework/telemetry-utils\";\nimport { assert } from \"@fluidframework/core-utils\";\nimport { IsoBuffer } from \"@fluid-internal/client-utils\";\nimport { compress } from \"lz4js\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { CompressionAlgorithms } from \"../containerRuntime.js\";\nimport { estimateSocketSize } from \"./batchManager.js\";\nimport { IBatch, BatchMessage } from \"./definitions.js\";\n\n/**\n * Compresses batches of ops. It generates a single compressed op that contains\n * the contents of each op in the batch. It then submits empty ops for each original\n * op to reserve sequence numbers.\n */\nexport class OpCompressor {\n\tprivate readonly logger;\n\n\tconstructor(logger: ITelemetryBaseLogger) {\n\t\tthis.logger = createChildLogger({ logger, namespace: \"OpCompressor\" });\n\t}\n\n\tpublic compressBatch(batch: IBatch): IBatch {\n\t\tassert(\n\t\t\tbatch.contentSizeInBytes > 0 && batch.content.length > 0,\n\t\t\t0x5a4 /* Batch should not be empty */,\n\t\t);\n\n\t\tconst compressionStart = Date.now();\n\t\tconst contentsAsBuffer = new TextEncoder().encode(this.serializeBatch(batch));\n\t\tconst compressedContents = compress(contentsAsBuffer);\n\t\tconst compressedContent = IsoBuffer.from(compressedContents).toString(\"base64\");\n\t\tconst duration = Date.now() - compressionStart;\n\n\t\tconst messages: BatchMessage[] = [];\n\t\tmessages.push({\n\t\t\t...batch.content[0],\n\t\t\tcontents: JSON.stringify({ packedContents: compressedContent }),\n\t\t\tmetadata: batch.content[0].metadata,\n\t\t\tcompression: CompressionAlgorithms.lz4,\n\t\t});\n\n\t\t// Add empty placeholder messages to reserve the sequence numbers\n\t\tfor (const message of batch.content.slice(1)) {\n\t\t\tmessages.push({\n\t\t\t\ttype: message.type,\n\t\t\t\tlocalOpMetadata: message.localOpMetadata,\n\t\t\t\tmetadata: message.metadata,\n\t\t\t\treferenceSequenceNumber: message.referenceSequenceNumber,\n\t\t\t});\n\t\t}\n\n\t\tconst compressedBatch: IBatch = {\n\t\t\tcontentSizeInBytes: compressedContent.length,\n\t\t\tcontent: messages,\n\t\t\treferenceSequenceNumber: batch.referenceSequenceNumber,\n\t\t};\n\n\t\tif (batch.contentSizeInBytes > 200000) {\n\t\t\tthis.logger.sendPerformanceEvent({\n\t\t\t\teventName: \"CompressedBatch\",\n\t\t\t\tduration,\n\t\t\t\tsizeBeforeCompression: batch.contentSizeInBytes,\n\t\t\t\tsizeAfterCompression: compressedBatch.contentSizeInBytes,\n\t\t\t\topCount: compressedBatch.content.length,\n\t\t\t\tsocketSize: estimateSocketSize(compressedBatch),\n\t\t\t});\n\t\t}\n\n\t\treturn compressedBatch;\n\t}\n\n\tprivate serializeBatch(batch: IBatch): string {\n\t\ttry {\n\t\t\treturn `[${batch.content.map((message) => message.contents).join(\",\")}]`;\n\t\t} catch (e: any) {\n\t\t\tif (e.message === \"Invalid string length\") {\n\t\t\t\t// This is how JSON.stringify signals that\n\t\t\t\t// the content size exceeds its capacity\n\t\t\t\tconst error = new UsageError(\"Payload too large\");\n\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"BatchTooLarge\",\n\t\t\t\t\t\tsize: batch.contentSizeInBytes,\n\t\t\t\t\t\tlength: batch.content.length,\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t\tthrow error;\n\t\t\t}\n\n\t\t\tthrow e;\n\t\t}\n\t}\n}\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
6
6
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
7
|
-
import { IMessageProcessingResult } from "./definitions.
|
|
7
|
+
import { IMessageProcessingResult } from "./definitions.js";
|
|
8
8
|
/**
|
|
9
9
|
* State machine that "unrolls" contents of compressed batches of ops after decompressing them.
|
|
10
10
|
* This class relies on some implicit contracts defined below:
|
|
@@ -22,4 +22,4 @@ export declare class OpDecompressor {
|
|
|
22
22
|
processMessage(message: ISequencedDocumentMessage): IMessageProcessingResult;
|
|
23
23
|
private isCompressed;
|
|
24
24
|
}
|
|
25
|
-
//# sourceMappingURL=opDecompressor.d.
|
|
25
|
+
//# sourceMappingURL=opDecompressor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opDecompressor.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/opDecompressor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAIjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAS5D;;;;;;;GAOG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAEZ,MAAM,EAAE,oBAAoB;IAIjC,cAAc,CAAC,OAAO,EAAE,yBAAyB,GAAG,wBAAwB;IA6FnF,OAAO,CAAC,YAAY;CA2CpB"}
|