@fluidframework/container-runtime 2.0.0-dev.6.4.0.192049 → 2.0.0-dev.7.2.0.204906
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +119 -0
- package/api-extractor.json +1 -1
- package/api-report/container-runtime.api.md +866 -0
- package/dist/blobManager.d.ts +4 -6
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +56 -78
- package/dist/blobManager.js.map +1 -1
- package/dist/connectionTelemetry.d.ts.map +1 -1
- package/dist/connectionTelemetry.js +75 -42
- package/dist/connectionTelemetry.js.map +1 -1
- package/dist/container-runtime-alpha.d.ts +1744 -0
- package/dist/container-runtime-beta.d.ts +1744 -0
- package/dist/container-runtime-public.d.ts +1744 -0
- package/dist/container-runtime-untrimmed.d.ts +1805 -0
- package/dist/containerHandleContext.js +3 -3
- package/dist/containerHandleContext.js.map +1 -1
- package/dist/containerRuntime.d.ts +94 -102
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +478 -454
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.js +11 -11
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts +2 -4
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +56 -59
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreRegistry.d.ts +3 -0
- package/dist/dataStoreRegistry.d.ts.map +1 -1
- package/dist/dataStoreRegistry.js +6 -3
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts +0 -2
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +3 -8
- package/dist/dataStores.js.map +1 -1
- package/dist/deltaManagerProxyBase.js +4 -4
- package/dist/deltaManagerProxyBase.js.map +1 -1
- package/dist/deltaManagerSummarizerProxy.js +6 -6
- package/dist/deltaManagerSummarizerProxy.js.map +1 -1
- package/dist/deltaScheduler.js.map +1 -1
- package/dist/error.d.ts.map +1 -1
- package/dist/error.js.map +1 -1
- package/dist/gc/garbageCollection.d.ts +6 -0
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +36 -25
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts +1 -0
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +13 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +48 -28
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js +10 -7
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
- package/dist/gc/gcSummaryDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts +3 -4
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +7 -8
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/gc/gcUnreferencedStateTracker.js +3 -3
- package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/dist/gc/index.d.ts +2 -2
- package/dist/gc/index.d.ts.map +1 -1
- package/dist/gc/index.js +3 -7
- package/dist/gc/index.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +3 -3
- package/dist/id-compressor/identifiers.d.ts.map +1 -1
- package/dist/id-compressor/utilities.d.ts +3 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -1
- package/dist/id-compressor/utilities.js +3 -0
- package/dist/id-compressor/utilities.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/messageTypes.d.ts +137 -0
- package/dist/messageTypes.d.ts.map +1 -0
- package/dist/messageTypes.js +32 -0
- package/dist/messageTypes.js.map +1 -0
- package/dist/opLifecycle/batchManager.js +6 -6
- package/dist/opLifecycle/batchManager.js.map +1 -1
- package/dist/opLifecycle/definitions.d.ts +7 -3
- package/dist/opLifecycle/definitions.d.ts.map +1 -1
- package/dist/opLifecycle/definitions.js.map +1 -1
- package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opDecompressor.js +0 -4
- package/dist/opLifecycle/opDecompressor.js.map +1 -1
- package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/dist/opLifecycle/opGroupingManager.js.map +1 -1
- package/dist/opLifecycle/opSplitter.js +3 -3
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +7 -2
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +38 -25
- package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/dist/packageVersion.d.ts +1 -1
- package/dist/packageVersion.js +1 -1
- package/dist/packageVersion.js.map +1 -1
- package/dist/pendingStateManager.d.ts +4 -20
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +36 -46
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.js +6 -2
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +7 -4
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +54 -54
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/dist/summary/runWhileConnectedCoordinator.js +7 -6
- package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +40 -38
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +2 -0
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +18 -8
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.js +6 -6
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerHeuristics.js +9 -9
- package/dist/summary/summarizerHeuristics.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNode.js +8 -8
- package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +107 -22
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +18 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js +23 -21
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryFormat.d.ts +15 -6
- package/dist/summary/summaryFormat.d.ts.map +1 -1
- package/dist/summary/summaryFormat.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +3 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +2 -2
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +10 -10
- package/dist/summary/summaryManager.js.map +1 -1
- package/dist/throttler.js +16 -16
- package/dist/throttler.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib/blobManager.d.ts +4 -6
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +58 -80
- package/lib/blobManager.js.map +1 -1
- package/lib/connectionTelemetry.d.ts.map +1 -1
- package/lib/connectionTelemetry.js +76 -43
- package/lib/connectionTelemetry.js.map +1 -1
- package/lib/containerHandleContext.js +3 -3
- package/lib/containerHandleContext.js.map +1 -1
- package/lib/containerRuntime.d.ts +94 -102
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +437 -418
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.js +11 -11
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts +2 -4
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +57 -60
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreRegistry.d.ts +3 -0
- package/lib/dataStoreRegistry.d.ts.map +1 -1
- package/lib/dataStoreRegistry.js +6 -3
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts +0 -2
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +4 -9
- package/lib/dataStores.js.map +1 -1
- package/lib/deltaManagerProxyBase.js +4 -4
- package/lib/deltaManagerProxyBase.js.map +1 -1
- package/lib/deltaManagerSummarizerProxy.js +6 -6
- package/lib/deltaManagerSummarizerProxy.js.map +1 -1
- package/lib/deltaScheduler.js.map +1 -1
- package/lib/error.d.ts.map +1 -1
- package/lib/error.js.map +1 -1
- package/lib/gc/garbageCollection.d.ts +6 -0
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +36 -25
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts +1 -0
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +15 -5
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +48 -28
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js +9 -6
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
- package/lib/gc/gcSummaryDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts +3 -4
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +7 -8
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/gc/gcUnreferencedStateTracker.js +3 -3
- package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
- package/lib/gc/index.d.ts +2 -2
- package/lib/gc/index.d.ts.map +1 -1
- package/lib/gc/index.js +2 -2
- package/lib/gc/index.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +3 -3
- package/lib/id-compressor/identifiers.d.ts.map +1 -1
- package/lib/id-compressor/utilities.d.ts +3 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -1
- package/lib/id-compressor/utilities.js +3 -0
- package/lib/id-compressor/utilities.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/messageTypes.d.ts +137 -0
- package/lib/messageTypes.d.ts.map +1 -0
- package/lib/messageTypes.js +29 -0
- package/lib/messageTypes.js.map +1 -0
- package/lib/opLifecycle/batchManager.js +6 -6
- package/lib/opLifecycle/batchManager.js.map +1 -1
- package/lib/opLifecycle/definitions.d.ts +7 -3
- package/lib/opLifecycle/definitions.d.ts.map +1 -1
- package/lib/opLifecycle/definitions.js.map +1 -1
- package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opDecompressor.js +0 -4
- package/lib/opLifecycle/opDecompressor.js.map +1 -1
- package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
- package/lib/opLifecycle/opGroupingManager.js.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -1
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +7 -2
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -3
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +37 -24
- package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
- package/lib/packageVersion.d.ts +1 -1
- package/lib/packageVersion.js +1 -1
- package/lib/packageVersion.js.map +1 -1
- package/lib/pendingStateManager.d.ts +4 -20
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +35 -45
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.js +6 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +7 -4
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +54 -54
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
- package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
- package/lib/summary/runWhileConnectedCoordinator.js +7 -6
- package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +40 -38
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +2 -0
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +19 -9
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.js +6 -6
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerHeuristics.js +9 -9
- package/lib/summary/summarizerHeuristics.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNode.js +8 -8
- package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
- package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
- package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +107 -22
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +18 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js +23 -21
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryFormat.d.ts +15 -6
- package/lib/summary/summaryFormat.d.ts.map +1 -1
- package/lib/summary/summaryFormat.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +3 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +2 -2
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +9 -9
- package/lib/summary/summaryManager.js.map +1 -1
- package/lib/throttler.js +16 -16
- package/lib/throttler.js.map +1 -1
- package/package.json +32 -29
- package/src/blobManager.ts +67 -92
- package/src/connectionTelemetry.ts +97 -52
- package/src/containerRuntime.ts +351 -351
- package/src/dataStore.ts +3 -3
- package/src/dataStoreContext.ts +9 -13
- package/src/dataStoreRegistry.ts +3 -0
- package/src/dataStores.ts +5 -17
- package/src/error.ts +4 -1
- package/src/gc/garbageCollection.ts +25 -12
- package/src/gc/gcConfigs.ts +25 -7
- package/src/gc/gcDefinitions.ts +49 -29
- package/src/gc/gcSummaryDefinitions.ts +1 -1
- package/src/gc/gcTelemetry.ts +8 -8
- package/src/gc/index.ts +2 -6
- package/src/id-compressor/utilities.ts +3 -0
- package/src/index.ts +21 -5
- package/src/messageTypes.ts +228 -0
- package/src/opLifecycle/README.md +93 -68
- package/src/opLifecycle/definitions.ts +5 -1
- package/src/opLifecycle/opDecompressor.ts +0 -8
- package/src/opLifecycle/opGroupingManager.ts +2 -4
- package/src/opLifecycle/opSplitter.ts +2 -2
- package/src/opLifecycle/outbox.ts +3 -0
- package/src/opLifecycle/remoteMessageProcessor.ts +54 -33
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +31 -52
- package/src/scheduleManager.ts +2 -0
- package/src/summary/orderedClientElection.ts +4 -1
- package/src/summary/runWhileConnectedCoordinator.ts +5 -1
- package/src/summary/runningSummarizer.ts +3 -1
- package/src/summary/summarizer.ts +21 -7
- package/src/summary/summarizerNode/summarizerNode.ts +1 -1
- package/src/summary/summarizerTypes.ts +96 -11
- package/src/summary/summaryCollection.ts +19 -1
- package/src/summary/summaryFormat.ts +11 -1
- package/src/summary/summaryGenerator.ts +3 -3
- package/src/summary/summaryManager.ts +2 -2
- package/src/gc/gcEarlyAdoption.md +0 -145
package/src/index.ts
CHANGED
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
export {
|
|
7
|
-
ContainerMessageType,
|
|
8
|
-
ContainerRuntimeMessage,
|
|
9
|
-
IContainerRuntimeMessageCompatDetails,
|
|
10
|
-
CompatModeBehavior,
|
|
11
7
|
ISummaryRuntimeOptions,
|
|
12
8
|
ISummaryBaseConfiguration,
|
|
13
9
|
ISummaryConfigurationHeuristics,
|
|
@@ -27,9 +23,25 @@ export {
|
|
|
27
23
|
DefaultSummaryConfiguration,
|
|
28
24
|
ICompressionRuntimeOptions,
|
|
29
25
|
CompressionAlgorithms,
|
|
26
|
+
TEST_requestSummarizer,
|
|
30
27
|
} from "./containerRuntime";
|
|
28
|
+
export {
|
|
29
|
+
ContainerMessageType,
|
|
30
|
+
ContainerRuntimeMessage,
|
|
31
|
+
IContainerRuntimeMessageCompatDetails,
|
|
32
|
+
CompatModeBehavior,
|
|
33
|
+
RecentlyAddedContainerRuntimeMessageDetails,
|
|
34
|
+
} from "./messageTypes";
|
|
35
|
+
export { IBlobManagerLoadInfo } from "./blobManager";
|
|
31
36
|
export { FluidDataStoreRegistry } from "./dataStoreRegistry";
|
|
32
|
-
export {
|
|
37
|
+
export {
|
|
38
|
+
GCNodeType,
|
|
39
|
+
IGCMetadata,
|
|
40
|
+
GCFeatureMatrix,
|
|
41
|
+
GCVersion,
|
|
42
|
+
IGCRuntimeOptions,
|
|
43
|
+
IGCStats,
|
|
44
|
+
} from "./gc";
|
|
33
45
|
export {
|
|
34
46
|
IAckedSummary,
|
|
35
47
|
ISummarizer,
|
|
@@ -45,6 +57,8 @@ export {
|
|
|
45
57
|
IBroadcastSummaryResult,
|
|
46
58
|
ICancellationToken,
|
|
47
59
|
IConnectableRuntime,
|
|
60
|
+
IContainerRuntimeMetadata,
|
|
61
|
+
ICreateContainerMetadata,
|
|
48
62
|
IEnqueueSummarizeOptions,
|
|
49
63
|
IGenerateSummaryTreeResult,
|
|
50
64
|
IGeneratedSummaryStats,
|
|
@@ -53,6 +67,7 @@ export {
|
|
|
53
67
|
IRefreshSummaryAckOptions,
|
|
54
68
|
ISubmitSummaryOpResult,
|
|
55
69
|
ISubmitSummaryOptions,
|
|
70
|
+
ISerializedElection,
|
|
56
71
|
ISummarizeOptions,
|
|
57
72
|
ISummarizerEvents,
|
|
58
73
|
ISummarizerInternalsProvider,
|
|
@@ -65,6 +80,7 @@ export {
|
|
|
65
80
|
ISummary,
|
|
66
81
|
ISummaryCollectionOpEvents,
|
|
67
82
|
ISummaryAckMessage,
|
|
83
|
+
ISummaryMetadataMessage,
|
|
68
84
|
ISummaryNackMessage,
|
|
69
85
|
ISummaryOpMessage,
|
|
70
86
|
OpActionEventListener,
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
7
|
+
import {
|
|
8
|
+
IEnvelope,
|
|
9
|
+
InboundAttachMessage,
|
|
10
|
+
IAttachMessage,
|
|
11
|
+
IdCreationRangeWithStashedState,
|
|
12
|
+
IdCreationRange,
|
|
13
|
+
} from "@fluidframework/runtime-definitions";
|
|
14
|
+
import { IDataStoreAliasMessage } from "./dataStore";
|
|
15
|
+
import { IChunkedOp } from "./opLifecycle";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export enum ContainerMessageType {
|
|
21
|
+
// An op to be delivered to store
|
|
22
|
+
FluidDataStoreOp = "component",
|
|
23
|
+
|
|
24
|
+
// Creates a new store
|
|
25
|
+
Attach = "attach",
|
|
26
|
+
|
|
27
|
+
// Chunked operation.
|
|
28
|
+
ChunkedOp = "chunkedOp",
|
|
29
|
+
|
|
30
|
+
// Signifies that a blob has been attached and should not be garbage collected by storage
|
|
31
|
+
BlobAttach = "blobAttach",
|
|
32
|
+
|
|
33
|
+
// Ties our new clientId to our old one on reconnect
|
|
34
|
+
Rejoin = "rejoin",
|
|
35
|
+
|
|
36
|
+
// Sets the alias of a root data store
|
|
37
|
+
Alias = "alias",
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* An op containing an IdRange of Ids allocated using the runtime's IdCompressor since
|
|
41
|
+
* the last allocation op was sent.
|
|
42
|
+
* See the [IdCompressor README](./id-compressor/README.md) for more details.
|
|
43
|
+
*/
|
|
44
|
+
IdAllocation = "idAllocation",
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* How should an older client handle an unrecognized remote op type?
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export type CompatModeBehavior =
|
|
53
|
+
/** Ignore the op. It won't be persisted if this client summarizes */
|
|
54
|
+
| "Ignore"
|
|
55
|
+
/** Fail processing immediately. (The container will close) */
|
|
56
|
+
| "FailToProcess";
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* All the info an older client would need to know how to handle an unrecognized remote op type
|
|
60
|
+
*
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export interface IContainerRuntimeMessageCompatDetails {
|
|
64
|
+
/** How should an older client handle an unrecognized remote op type? */
|
|
65
|
+
behavior: CompatModeBehavior;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime.
|
|
70
|
+
* Message type are differentiated via a `type` string and contain different contents depending on their type.
|
|
71
|
+
*
|
|
72
|
+
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
73
|
+
* This way stringified values can be compared.
|
|
74
|
+
*/
|
|
75
|
+
interface TypedContainerRuntimeMessage<TType extends ContainerMessageType, TContents> {
|
|
76
|
+
/** Type of the op, within the ContainerRuntime's domain */
|
|
77
|
+
type: TType;
|
|
78
|
+
/** Domain-specific contents, interpreted according to the type */
|
|
79
|
+
contents: TContents;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Additional details expected for any recently added message.
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
export interface RecentlyAddedContainerRuntimeMessageDetails {
|
|
87
|
+
/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
|
|
88
|
+
compatDetails: IContainerRuntimeMessageCompatDetails;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type ContainerRuntimeDataStoreOpMessage = TypedContainerRuntimeMessage<
|
|
92
|
+
ContainerMessageType.FluidDataStoreOp,
|
|
93
|
+
IEnvelope
|
|
94
|
+
>;
|
|
95
|
+
export type InboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<
|
|
96
|
+
ContainerMessageType.Attach,
|
|
97
|
+
InboundAttachMessage
|
|
98
|
+
>;
|
|
99
|
+
export type OutboundContainerRuntimeAttachMessage = TypedContainerRuntimeMessage<
|
|
100
|
+
ContainerMessageType.Attach,
|
|
101
|
+
IAttachMessage
|
|
102
|
+
>;
|
|
103
|
+
export type ContainerRuntimeChunkedOpMessage = TypedContainerRuntimeMessage<
|
|
104
|
+
ContainerMessageType.ChunkedOp,
|
|
105
|
+
IChunkedOp
|
|
106
|
+
>;
|
|
107
|
+
export type ContainerRuntimeBlobAttachMessage = TypedContainerRuntimeMessage<
|
|
108
|
+
ContainerMessageType.BlobAttach,
|
|
109
|
+
undefined
|
|
110
|
+
>;
|
|
111
|
+
export type ContainerRuntimeRejoinMessage = TypedContainerRuntimeMessage<
|
|
112
|
+
ContainerMessageType.Rejoin,
|
|
113
|
+
undefined
|
|
114
|
+
>;
|
|
115
|
+
export type ContainerRuntimeAliasMessage = TypedContainerRuntimeMessage<
|
|
116
|
+
ContainerMessageType.Alias,
|
|
117
|
+
IDataStoreAliasMessage
|
|
118
|
+
>;
|
|
119
|
+
export type LocalContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<
|
|
120
|
+
ContainerMessageType.IdAllocation,
|
|
121
|
+
IdCreationRangeWithStashedState
|
|
122
|
+
>;
|
|
123
|
+
export type ContainerRuntimeIdAllocationMessage = TypedContainerRuntimeMessage<
|
|
124
|
+
ContainerMessageType.IdAllocation,
|
|
125
|
+
IdCreationRange & { stashedState?: never }
|
|
126
|
+
>;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Represents an unrecognized {@link TypedContainerRuntimeMessage}, e.g. a message from a future version of the container runtime.
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
export interface UnknownContainerRuntimeMessage
|
|
133
|
+
extends Partial<RecentlyAddedContainerRuntimeMessageDetails> {
|
|
134
|
+
/** Invalid type of the op, within the ContainerRuntime's domain. This value should never exist at runtime.
|
|
135
|
+
* This is useful for type narrowing but should never be used as an actual message type at runtime.
|
|
136
|
+
* Actual value will not be "__unknown...", but the type `Exclude<string, ContainerMessageType>` is not supported.
|
|
137
|
+
*/
|
|
138
|
+
type: "__unknown_container_message_type__never_use_as_value__";
|
|
139
|
+
|
|
140
|
+
/** Domain-specific contents, but not decipherable by an unknown op. */
|
|
141
|
+
contents: unknown;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* A {@link TypedContainerRuntimeMessage} that is received from the server and will be processed by the container runtime.
|
|
146
|
+
*/
|
|
147
|
+
export type InboundContainerRuntimeMessage =
|
|
148
|
+
| ContainerRuntimeDataStoreOpMessage
|
|
149
|
+
| InboundContainerRuntimeAttachMessage
|
|
150
|
+
| ContainerRuntimeChunkedOpMessage
|
|
151
|
+
| ContainerRuntimeBlobAttachMessage
|
|
152
|
+
| ContainerRuntimeRejoinMessage
|
|
153
|
+
| ContainerRuntimeAliasMessage
|
|
154
|
+
| ContainerRuntimeIdAllocationMessage
|
|
155
|
+
// Inbound messages may include unknown types from other clients, so we include that as a special case here
|
|
156
|
+
| UnknownContainerRuntimeMessage;
|
|
157
|
+
|
|
158
|
+
/** A {@link TypedContainerRuntimeMessage} that has been generated by the container runtime but is not yet being sent to the server. */
|
|
159
|
+
export type LocalContainerRuntimeMessage =
|
|
160
|
+
| ContainerRuntimeDataStoreOpMessage
|
|
161
|
+
| OutboundContainerRuntimeAttachMessage
|
|
162
|
+
| ContainerRuntimeChunkedOpMessage
|
|
163
|
+
| ContainerRuntimeBlobAttachMessage
|
|
164
|
+
| ContainerRuntimeRejoinMessage
|
|
165
|
+
| ContainerRuntimeAliasMessage
|
|
166
|
+
| LocalContainerRuntimeIdAllocationMessage
|
|
167
|
+
// In rare cases (e.g. related to stashed ops) we could have a local message of an unknown type
|
|
168
|
+
| UnknownContainerRuntimeMessage;
|
|
169
|
+
|
|
170
|
+
/** A {@link TypedContainerRuntimeMessage} that is being sent to the server from the container runtime. */
|
|
171
|
+
export type OutboundContainerRuntimeMessage =
|
|
172
|
+
| ContainerRuntimeDataStoreOpMessage
|
|
173
|
+
| OutboundContainerRuntimeAttachMessage
|
|
174
|
+
| ContainerRuntimeChunkedOpMessage
|
|
175
|
+
| ContainerRuntimeBlobAttachMessage
|
|
176
|
+
| ContainerRuntimeRejoinMessage
|
|
177
|
+
| ContainerRuntimeAliasMessage
|
|
178
|
+
| ContainerRuntimeIdAllocationMessage;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* An unpacked ISequencedDocumentMessage with the inner TypedContainerRuntimeMessage type/contents/etc
|
|
182
|
+
* promoted up to the outer object
|
|
183
|
+
*/
|
|
184
|
+
export type InboundSequencedContainerRuntimeMessage = Omit<
|
|
185
|
+
ISequencedDocumentMessage,
|
|
186
|
+
"type" | "contents"
|
|
187
|
+
> &
|
|
188
|
+
InboundContainerRuntimeMessage;
|
|
189
|
+
|
|
190
|
+
/** Essentially ISequencedDocumentMessage except that `type` is not `string` to enable narrowing
|
|
191
|
+
* as `Exclude<string, InboundContainerRuntimeMessage['type']>` is not supported.
|
|
192
|
+
* There should never be a runtime value of "__not_a_...".
|
|
193
|
+
* Currently additionally replaces `contents` type until protocol-definitions update is taken with `unknown` instead of `any`.
|
|
194
|
+
*/
|
|
195
|
+
type InboundSequencedNonContainerRuntimeMessage = Omit<
|
|
196
|
+
ISequencedDocumentMessage,
|
|
197
|
+
"type" | "contents"
|
|
198
|
+
> & { type: "__not_a_container_runtime_message_type__"; contents: unknown };
|
|
199
|
+
|
|
200
|
+
export type InboundSequencedContainerRuntimeMessageOrSystemMessage =
|
|
201
|
+
| InboundSequencedContainerRuntimeMessage
|
|
202
|
+
| InboundSequencedNonContainerRuntimeMessage;
|
|
203
|
+
|
|
204
|
+
/** A [loose] InboundSequencedContainerRuntimeMessage that is recent and may contain compat details.
|
|
205
|
+
* It exists solely to to provide access to those details.
|
|
206
|
+
*/
|
|
207
|
+
export type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDocumentMessage &
|
|
208
|
+
Partial<RecentlyAddedContainerRuntimeMessageDetails>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The unpacked runtime message / details to be handled or dispatched by the ContainerRuntime
|
|
212
|
+
*
|
|
213
|
+
* IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
|
|
214
|
+
* This way stringified values can be compared.
|
|
215
|
+
*
|
|
216
|
+
* @deprecated this is an internal type which should not be used outside of the package.
|
|
217
|
+
* Internally, it is superseded by `TypedContainerRuntimeMessage`.
|
|
218
|
+
*
|
|
219
|
+
* @internal
|
|
220
|
+
*/
|
|
221
|
+
export interface ContainerRuntimeMessage {
|
|
222
|
+
/** Type of the op, within the ContainerRuntime's domain */
|
|
223
|
+
type: ContainerMessageType;
|
|
224
|
+
/** Domain-specific contents, interpreted according to the type */
|
|
225
|
+
contents: any;
|
|
226
|
+
/** Info describing how to handle this op in case the type is unrecognized (default: fail to process) */
|
|
227
|
+
compatDetails?: IContainerRuntimeMessageCompatDetails;
|
|
228
|
+
}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Configs and feature gates for solving the 1MB limit.
|
|
2
2
|
|
|
3
|
+
## Table of contents
|
|
4
|
+
|
|
5
|
+
- [Introduction](#introduction)
|
|
6
|
+
- [How batching works](#how-batching-works)
|
|
7
|
+
- [Compression](#compression)
|
|
8
|
+
- [Grouped batching](#grouped-batching)
|
|
9
|
+
- [Risks](#risks)
|
|
10
|
+
- [Chunking for compression](#chunking-for-compression)
|
|
11
|
+
- [Disabling in case of emergency](#disabling-in-case-of-emergency)
|
|
12
|
+
- [Example configs](#example-configs)
|
|
13
|
+
- [Note about performance and latency](#note-about-performance-and-latency)
|
|
14
|
+
- [How it works](#how-it-works)
|
|
15
|
+
- [How grouped batching works](#how-grouped-batching-works)
|
|
16
|
+
|
|
3
17
|
## Introduction
|
|
4
18
|
|
|
5
19
|
There is a current limitation regarding the size of the payload a Fluid client can send and receive. [The limit is 1MB per payload](https://github.com/microsoft/FluidFramework/issues/9023) and it is currently enforced explicitly with the `BatchTooLarge` error which closes the container.
|
|
@@ -8,17 +22,35 @@ There are two features which can be used to work around this size limit, batch c
|
|
|
8
22
|
|
|
9
23
|
By default, the runtime is configured with a max batch size of `716800` bytes, which is lower than the 1MB limit. The reason for the lower value is to account for possible overhead from the op envelope and metadata.
|
|
10
24
|
|
|
11
|
-
|
|
25
|
+
### How batching works
|
|
12
26
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
Batching in the context of Fluid ops is a way in which the framework accumulates and applies ops. A batch is a group of ops accumulated within a single JS turn, which will be broadcasted in the same order to all the other connected clients and applied synchronously. Additional logic and validation ensure that batches are never interleaved, nested or interrupted and they are processed in isolation without interleaving of ops from other clients.
|
|
28
|
+
|
|
29
|
+
The way batches are formed is governed by the `FlushMode` setting of the `ContainerRuntimeOptions` and it is immutable for the entire lifetime of the runtime and subsequently the container.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
export enum FlushMode {
|
|
33
|
+
/**
|
|
34
|
+
* In Immediate flush mode the runtime will immediately send all operations to the driver layer.
|
|
35
|
+
*/
|
|
36
|
+
Immediate,
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* When in TurnBased flush mode the runtime will buffer operations in the current turn and send them as a single
|
|
40
|
+
* batch at the end of the turn. The flush call on the runtime can be used to force send the current batch.
|
|
41
|
+
*/
|
|
42
|
+
TurnBased,
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
What this means is that `FlushMode.Immediate` will send each op in its own payload to the server, while `FlushMode.TurnBased` will accumulate all ops in a single JS turn and send them together in the same payload. Technically, `FlushMode.Immediate` can be simulated with `FlushMode.TurnBased` by interrupting the JS turn after producing only one op (for example by pausing the execution to wait on a promise). Therefore, for all intents and purposes, `FlushMode.Immediate` enables all batches to have only one op.
|
|
47
|
+
|
|
48
|
+
**By default, Fluid uses `FlushMode.TurnBased`** as:
|
|
49
|
+
|
|
50
|
+
- it is more efficient from an I/O perspective (batching ops overall decrease the number of payloads sent to the server)
|
|
51
|
+
- reduces concurrency related bugs, as it ensures that all ops generated within the same JS turn are also applied by all other clients within a single JS turn. Clients using the same pattern can safely assume ops will be applied exactly as they are observed locally. The alternative would be for ops to be both produced and applied with interruptions (which may involve processing input or rendering), invalidating the state based off which the changes were produced.
|
|
52
|
+
|
|
53
|
+
As `FlushMode.TurnBased` accumulates ops, it is the most vulnerable to run into the 1MB socket limit.
|
|
22
54
|
|
|
23
55
|
## Compression
|
|
24
56
|
|
|
@@ -29,6 +61,8 @@ By default, the runtime is configured with a max batch size of `716800` bytes, w
|
|
|
29
61
|
- `minimumBatchSizeInBytes` – the minimum size of the batch for which compression should kick in. If the payload is too small, compression may not yield too many benefits. To target the original 1MB issue, a good value here would be to match the default maxBatchSizeInBytes (972800), however, experimentally, a good lower value could be at around 614400 bytes. Setting this value to `Number.POSITIVE_INFINITY` will disable compression.
|
|
30
62
|
- `compressionAlgorithm` – currently, only `lz4` is supported.
|
|
31
63
|
|
|
64
|
+
Compression is relevant for both `FlushMode.TurnBased` and `FlushMode.Immediate` as it only targets the contents of the ops and not the number of ops in a batch. Compression is opaque to the server and implementations of the Fluid protocol do not need to alter their behavior to support this client feature.
|
|
65
|
+
|
|
32
66
|
## Grouped batching
|
|
33
67
|
|
|
34
68
|
**Note: This feature is currently considered experimental and is not ready for production usage.**
|
|
@@ -71,6 +105,8 @@ If all prerequisites in the previous section are met, enabling the feature can b
|
|
|
71
105
|
|
|
72
106
|
In case of emergency grouped batching can be disabled at runtime, using feature gates. If `"Fluid.ContainerRuntime.DisableGroupedBatching"` is set to `true`, it will disable grouped batching if enabled from `IContainerRuntimeOptions` in the code.
|
|
73
107
|
|
|
108
|
+
Grouped batching is only relevant for `FlushMode.TurnBased` as it only targets the number of ops in a batch. Grouped batching is opaque to the server and implementations of the Fluid protocol do not need to alter their behavior to support this client feature.
|
|
109
|
+
|
|
74
110
|
## Chunking for compression
|
|
75
111
|
|
|
76
112
|
**Op chunking for compression targets payloads which exceed the max batch size after compression.** So, only payloads which are already compressed. By default, the feature is enabled.
|
|
@@ -79,6 +115,8 @@ The `IContainerRuntimeOptions.chunkSizeInBytes` property is the only configurati
|
|
|
79
115
|
|
|
80
116
|
This config would govern chunking compressed batches only. We will not be enabling chunking across all types of ops/batches but **only when compression is enabled and when the batch is compressed**, and its payload size is more than `IContainerRuntimeOptions.chunkSizeInBytes`.
|
|
81
117
|
|
|
118
|
+
Chunking is relevant for both `FlushMode.TurnBased` and `FlushMode.Immediate` as it only targets the contents of the ops and not the number of ops in a batch. Chunking is opaque to the server and implementations of the Fluid protocol do not need to alter their behavior to support this client feature.
|
|
119
|
+
|
|
82
120
|
## Disabling in case of emergency
|
|
83
121
|
|
|
84
122
|
If the features are enabled using the configs, they can be disabled at runtime via feature gates as following:
|
|
@@ -102,32 +140,19 @@ By default, the runtime is configured with the following values related to compr
|
|
|
102
140
|
}
|
|
103
141
|
```
|
|
104
142
|
|
|
105
|
-
To use
|
|
143
|
+
To enable grouped batching, use the following property:
|
|
106
144
|
|
|
107
145
|
```
|
|
108
146
|
const runtimeOptions: IContainerRuntimeOptions = {
|
|
109
|
-
|
|
147
|
+
enableGroupedBatching: true,
|
|
110
148
|
}
|
|
111
149
|
```
|
|
112
150
|
|
|
113
|
-
|
|
151
|
+
## Note about performance and latency
|
|
114
152
|
|
|
115
|
-
|
|
116
|
-
const runtimeOptions: IContainerRuntimeOptions = {
|
|
117
|
-
compressionOptions: {
|
|
118
|
-
minimumBatchSizeInBytes: Number.POSITIVE_INFINITY,
|
|
119
|
-
compressionAlgorithm: CompressionAlgorithms.lz4,
|
|
120
|
-
},
|
|
121
|
-
}
|
|
122
|
-
```
|
|
153
|
+
In terms of performance and impact on latency, the results greatly depend on payload size, payload structure, network speed and CPU speed. Therefore, customers must perform the required measurements and adjust the settings according to their scenarios.
|
|
123
154
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
const runtimeOptions: IContainerRuntimeOptions = {
|
|
128
|
-
enableGroupedBatching: true,
|
|
129
|
-
}
|
|
130
|
-
```
|
|
155
|
+
In general, compression offers a trade-off between higher compute costs, lower bandwidth consumption and lower storage requirements, while chunking slightly increases latency due to the overhead of splitting an op, sending the chunks and reconstructing them on each client. Grouped batching heavily decreases the number of ops observed by the server and slightly decreases the bandwidth requirements as it merges all the ops in a batch into a single op and also eliminates the op envelope overhead.
|
|
131
156
|
|
|
132
157
|
## How it works
|
|
133
158
|
|
|
@@ -212,8 +237,6 @@ On the receiving end, the client will accumulate chunks 1 and 2 and keep them in
|
|
|
212
237
|
|
|
213
238
|
## How grouped batching works
|
|
214
239
|
|
|
215
|
-
**Note: There are plans to replace empty ops with something more efficient when doing grouped batching AB#4092**
|
|
216
|
-
|
|
217
240
|
Given the following baseline batch:
|
|
218
241
|
|
|
219
242
|
```
|
|
@@ -223,68 +246,70 @@ Given the following baseline batch:
|
|
|
223
246
|
+---------------+---------------+---------------+---------------+---------------+
|
|
224
247
|
```
|
|
225
248
|
|
|
226
|
-
|
|
249
|
+
Grouped batch:
|
|
227
250
|
|
|
228
251
|
```
|
|
229
|
-
|
|
230
|
-
| Op 1
|
|
231
|
-
|
|
|
232
|
-
|
|
|
233
|
-
|
|
252
|
+
+---------------------------------------------------------------------------------------------------------------------+
|
|
253
|
+
| Op 1 Contents: +----------------+---------------+---------------+---------------+---------------+ |
|
|
254
|
+
| Type: "groupedBatch" | Op 1 | Op 2 | Op 3 | Op 4 | Op 5 | |
|
|
255
|
+
| | Contents: "a" | Contents: "b" | Contents: "c" | Contents: "d" | Contents: "e" | |
|
|
256
|
+
| +----------------+---------------+---------------+---------------+---------------+ |
|
|
257
|
+
+---------------------------------------------------------------------------------------------------------------------+
|
|
234
258
|
```
|
|
235
259
|
|
|
236
|
-
|
|
260
|
+
Compressed batch:
|
|
237
261
|
|
|
238
262
|
```
|
|
239
|
-
|
|
240
|
-
| Op 1 Contents:
|
|
241
|
-
|
|
|
242
|
-
|
|
|
243
|
-
| |
|
|
244
|
-
|
|
|
245
|
-
|
|
263
|
+
+-------------------------------------------------------------------------------------------------------------------------+
|
|
264
|
+
| Op 1 Contents: +------------------------------------------------------------------------------------+ |
|
|
265
|
+
| Compression: 'lz4' | Type: "groupedBatch" | |
|
|
266
|
+
| | +----------------+---------------+---------------+---------------+---------------+ | |
|
|
267
|
+
| | | Op 1 | Op 2 | Op 3 | Op 4 | Op 5 | | |
|
|
268
|
+
| | | Contents: "a" | Contents: "b" | Contents: "c" | Contents: "d" | Contents: "e" | | |
|
|
269
|
+
| | +----------------+---------------+---------------+---------------+---------------+ | |
|
|
270
|
+
| +------------------------------------------------------------------------------------+ |
|
|
271
|
+
+-------------------------------------------------------------------------------------------------------------------------+
|
|
246
272
|
```
|
|
247
273
|
|
|
248
274
|
Can produce the following chunks:
|
|
249
275
|
|
|
250
276
|
```
|
|
251
|
-
|
|
252
|
-
| Chunk 1/2 Contents:
|
|
253
|
-
|
|
|
254
|
-
| |
|
|
255
|
-
| |
|
|
256
|
-
|
|
|
257
|
-
|
|
277
|
+
+------------------------------------------------+
|
|
278
|
+
| Chunk 1/2 Contents: +---------------------+ |
|
|
279
|
+
| | +-----------------+ | |
|
|
280
|
+
| | | Contents: "abc" | | |
|
|
281
|
+
| | +-----------------+ | |
|
|
282
|
+
| +---------------------+ |
|
|
283
|
+
+------------------------------------------------+
|
|
258
284
|
```
|
|
259
285
|
|
|
260
286
|
```
|
|
261
|
-
|
|
262
|
-
| Chunk 2/2 Contents:
|
|
263
|
-
|
|
|
264
|
-
| |
|
|
265
|
-
| |
|
|
266
|
-
|
|
|
267
|
-
|
|
287
|
+
+-----------------------------------------------+
|
|
288
|
+
| Chunk 2/2 Contents: +--------------------+ |
|
|
289
|
+
| | +----------------+ | |
|
|
290
|
+
| | | Contents: "de" | | |
|
|
291
|
+
| | +----------------+ | |
|
|
292
|
+
| +--------------------+ |
|
|
293
|
+
+-----------------------------------------------+
|
|
268
294
|
```
|
|
269
295
|
|
|
270
296
|
- Send to service
|
|
271
297
|
- Service acks ops sent
|
|
272
298
|
- Receive chunks from service
|
|
273
|
-
- Recompile to the
|
|
299
|
+
- Recompile to the compression step
|
|
274
300
|
|
|
275
|
-
|
|
301
|
+
Decompressed batch:
|
|
276
302
|
|
|
277
303
|
```
|
|
278
|
-
|
|
279
|
-
| Op 1
|
|
280
|
-
|
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
|
|
284
|
-
+--------------------+-----------------+-----------------+-----------------+-----------------+
|
|
304
|
+
+---------------------------------------------------------------------------------------------------------------------+
|
|
305
|
+
| Op 1 Contents: +----------------+---------------+---------------+---------------+---------------+ |
|
|
306
|
+
| SeqNum: 2 | Op 1 | Op 2 | Op 3 | Op 4 | Op 5 | |
|
|
307
|
+
| Type: "groupedBatch" | Contents: "a" | Contents: "b" | Contents: "c" | Contents: "d" | Contents: "e" | |
|
|
308
|
+
| +----------------+---------------+---------------+---------------+---------------+ |
|
|
309
|
+
+---------------------------------------------------------------------------------------------------------------------+
|
|
285
310
|
```
|
|
286
311
|
|
|
287
|
-
|
|
312
|
+
Ungrouped batch:
|
|
288
313
|
|
|
289
314
|
```
|
|
290
315
|
+-----------------+-----------------+-----------------+-----------------+-----------------+
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
7
7
|
import { ISequencedDocumentMessage, MessageType } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { CompressionAlgorithms
|
|
8
|
+
import { CompressionAlgorithms } from "..";
|
|
9
|
+
import { ContainerMessageType } from "../messageTypes";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Batch message type used internally by the runtime
|
|
@@ -51,6 +52,9 @@ export interface IBatchCheckpoint {
|
|
|
51
52
|
rollback: (action: (message: BatchMessage) => void) => void;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
/**
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
54
58
|
export interface IChunkedOp {
|
|
55
59
|
chunkId: number;
|
|
56
60
|
totalChunks: number;
|
|
@@ -50,14 +50,6 @@ export class OpDecompressor {
|
|
|
50
50
|
) {
|
|
51
51
|
// Beginning of a compressed batch
|
|
52
52
|
assert(this.activeBatch === false, 0x4b8 /* shouldn't have multiple active batches */);
|
|
53
|
-
if (message.compression) {
|
|
54
|
-
// lz4 is the only supported compression algorithm for now
|
|
55
|
-
assert(
|
|
56
|
-
message.compression === CompressionAlgorithms.lz4,
|
|
57
|
-
0x4b9 /* lz4 is currently the only supported compression algorithm */,
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
53
|
this.activeBatch = true;
|
|
62
54
|
|
|
63
55
|
const contents = IsoBuffer.from(
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { assert } from "@fluidframework/core-utils";
|
|
7
7
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
8
|
-
import { ContainerMessageType } from "
|
|
8
|
+
import { ContainerMessageType } from "../messageTypes";
|
|
9
9
|
import { IBatch } from "./definitions";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -22,9 +22,7 @@ interface IGroupedMessage {
|
|
|
22
22
|
compression?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function isGroupContents(
|
|
26
|
-
opContents: IGroupedBatchMessageContents | { type?: unknown } | undefined,
|
|
27
|
-
): opContents is IGroupedBatchMessageContents {
|
|
25
|
+
function isGroupContents(opContents: any): opContents is IGroupedBatchMessageContents {
|
|
28
26
|
return opContents?.type === OpGroupingManager.groupedBatchOp;
|
|
29
27
|
}
|
|
30
28
|
|
|
@@ -12,7 +12,7 @@ import { assert } from "@fluidframework/core-utils";
|
|
|
12
12
|
import { IBatchMessage } from "@fluidframework/container-definitions";
|
|
13
13
|
import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
|
|
14
14
|
import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
|
|
15
|
-
import { ContainerMessageType,
|
|
15
|
+
import { ContainerMessageType, ContainerRuntimeChunkedOpMessage } from "../messageTypes";
|
|
16
16
|
import { estimateSocketSize } from "./batchManager";
|
|
17
17
|
import { BatchMessage, IBatch, IChunkedOp, IMessageProcessingResult } from "./definitions";
|
|
18
18
|
|
|
@@ -210,7 +210,7 @@ const chunkToBatchMessage = (
|
|
|
210
210
|
referenceSequenceNumber: number,
|
|
211
211
|
metadata: Record<string, unknown> | undefined = undefined,
|
|
212
212
|
): BatchMessage => {
|
|
213
|
-
const payload:
|
|
213
|
+
const payload: ContainerRuntimeChunkedOpMessage = {
|
|
214
214
|
type: ContainerMessageType.ChunkedOp,
|
|
215
215
|
contents: chunk,
|
|
216
216
|
};
|
|
@@ -65,10 +65,13 @@ export interface IOutboxParameters {
|
|
|
65
65
|
export function getLongStack<T>(action: () => T, length: number = 50): T {
|
|
66
66
|
const errorObj = Error as any;
|
|
67
67
|
if (
|
|
68
|
+
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
|
|
69
|
+
// ?? is not logically equivalent when the first clause returns false.
|
|
68
70
|
(
|
|
69
71
|
Object.getOwnPropertyDescriptor(errorObj, "stackTraceLimit") ||
|
|
70
72
|
Object.getOwnPropertyDescriptor(Object.getPrototypeOf(errorObj), "stackTraceLimit")
|
|
71
73
|
)?.writable !== true
|
|
74
|
+
/* eslint-enable @typescript-eslint/prefer-nullish-coalescing */
|
|
72
75
|
) {
|
|
73
76
|
return action();
|
|
74
77
|
}
|