@fluidframework/container-runtime 2.0.0-internal.6.1.1 → 2.0.0-internal.6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +4 -3
- package/dist/batchTracker.d.ts +1 -1
- package/dist/batchTracker.js +1 -1
- package/dist/batchTracker.js.map +1 -1
- package/dist/blobManager.d.ts +4 -20
- package/dist/blobManager.d.ts.map +1 -1
- package/dist/blobManager.js +47 -125
- package/dist/blobManager.js.map +1 -1
- package/dist/containerRuntime.d.ts +82 -14
- package/dist/containerRuntime.d.ts.map +1 -1
- package/dist/containerRuntime.js +236 -138
- package/dist/containerRuntime.js.map +1 -1
- package/dist/dataStore.d.ts.map +1 -1
- package/dist/dataStore.js +1 -2
- package/dist/dataStore.js.map +1 -1
- package/dist/dataStoreContext.d.ts.map +1 -1
- package/dist/dataStoreContext.js +4 -5
- package/dist/dataStoreContext.js.map +1 -1
- package/dist/dataStoreContexts.d.ts +1 -2
- package/dist/dataStoreContexts.d.ts.map +1 -1
- package/dist/dataStoreContexts.js.map +1 -1
- package/dist/dataStoreRegistry.js +2 -2
- package/dist/dataStoreRegistry.js.map +1 -1
- package/dist/dataStores.d.ts.map +1 -1
- package/dist/dataStores.js +4 -5
- package/dist/dataStores.js.map +1 -1
- package/dist/error.d.ts +14 -0
- package/dist/error.d.ts.map +1 -0
- package/dist/error.js +21 -0
- package/dist/error.js.map +1 -0
- package/dist/gc/garbageCollection.d.ts +1 -1
- package/dist/gc/garbageCollection.d.ts.map +1 -1
- package/dist/gc/garbageCollection.js +23 -5
- package/dist/gc/garbageCollection.js.map +1 -1
- package/dist/gc/gcConfigs.d.ts.map +1 -1
- package/dist/gc/gcConfigs.js +5 -3
- package/dist/gc/gcConfigs.js.map +1 -1
- package/dist/gc/gcDefinitions.d.ts +2 -0
- package/dist/gc/gcDefinitions.d.ts.map +1 -1
- package/dist/gc/gcDefinitions.js.map +1 -1
- package/dist/gc/gcTelemetry.d.ts.map +1 -1
- package/dist/gc/gcTelemetry.js +2 -0
- package/dist/gc/gcTelemetry.js.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/dist/id-compressor/appendOnlySortedMap.js +25 -67
- package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/dist/id-compressor/finalSpace.d.ts +29 -0
- package/dist/id-compressor/finalSpace.d.ts.map +1 -0
- package/dist/id-compressor/finalSpace.js +62 -0
- package/dist/id-compressor/finalSpace.js.map +1 -0
- package/dist/id-compressor/idCompressor.d.ts +25 -250
- package/dist/id-compressor/idCompressor.d.ts.map +1 -1
- package/dist/id-compressor/idCompressor.js +385 -1149
- package/dist/id-compressor/idCompressor.js.map +1 -1
- package/dist/id-compressor/identifiers.d.ts +32 -0
- package/dist/id-compressor/identifiers.d.ts.map +1 -0
- package/dist/id-compressor/identifiers.js +15 -0
- package/dist/id-compressor/identifiers.js.map +1 -0
- package/dist/id-compressor/index.d.ts +5 -6
- package/dist/id-compressor/index.d.ts.map +1 -1
- package/dist/id-compressor/index.js +20 -26
- package/dist/id-compressor/index.js.map +1 -1
- package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
- package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/dist/id-compressor/persistanceUtilities.js +43 -0
- package/dist/id-compressor/persistanceUtilities.js.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
- package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/dist/id-compressor/sessions.d.ts +115 -0
- package/dist/id-compressor/sessions.d.ts.map +1 -0
- package/dist/id-compressor/sessions.js +305 -0
- package/dist/id-compressor/sessions.js.map +1 -0
- package/dist/id-compressor/utilities.d.ts +49 -0
- package/dist/id-compressor/utilities.d.ts.map +1 -0
- package/dist/id-compressor/utilities.js +166 -0
- package/dist/id-compressor/utilities.js.map +1 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
- package/dist/opLifecycle/opCompressor.js +1 -2
- package/dist/opLifecycle/opCompressor.js.map +1 -1
- package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
- package/dist/opLifecycle/opSplitter.js +2 -3
- package/dist/opLifecycle/opSplitter.js.map +1 -1
- package/dist/opLifecycle/outbox.d.ts +1 -0
- package/dist/opLifecycle/outbox.d.ts.map +1 -1
- package/dist/opLifecycle/outbox.js +10 -11
- package/dist/opLifecycle/outbox.js.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/dist/opLifecycle/remoteMessageProcessor.js +11 -5
- 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 +12 -5
- package/dist/pendingStateManager.d.ts.map +1 -1
- package/dist/pendingStateManager.js +24 -10
- package/dist/pendingStateManager.js.map +1 -1
- package/dist/scheduleManager.d.ts.map +1 -1
- package/dist/scheduleManager.js +4 -5
- package/dist/scheduleManager.js.map +1 -1
- package/dist/summary/index.d.ts +2 -2
- package/dist/summary/index.d.ts.map +1 -1
- package/dist/summary/index.js +2 -1
- package/dist/summary/index.js.map +1 -1
- package/dist/summary/orderedClientElection.d.ts +1 -2
- package/dist/summary/orderedClientElection.d.ts.map +1 -1
- package/dist/summary/orderedClientElection.js +2 -3
- package/dist/summary/orderedClientElection.js.map +1 -1
- package/dist/summary/runningSummarizer.d.ts +27 -4
- package/dist/summary/runningSummarizer.d.ts.map +1 -1
- package/dist/summary/runningSummarizer.js +237 -66
- package/dist/summary/runningSummarizer.js.map +1 -1
- package/dist/summary/summarizer.d.ts +6 -5
- package/dist/summary/summarizer.d.ts.map +1 -1
- package/dist/summary/summarizer.js +70 -67
- package/dist/summary/summarizer.js.map +1 -1
- package/dist/summary/summarizerClientElection.d.ts +1 -1
- package/dist/summary/summarizerClientElection.d.ts.map +1 -1
- package/dist/summary/summarizerClientElection.js.map +1 -1
- package/dist/summary/summarizerTypes.d.ts +38 -25
- package/dist/summary/summarizerTypes.d.ts.map +1 -1
- package/dist/summary/summarizerTypes.js.map +1 -1
- package/dist/summary/summaryCollection.d.ts +1 -2
- package/dist/summary/summaryCollection.d.ts.map +1 -1
- package/dist/summary/summaryCollection.js.map +1 -1
- package/dist/summary/summaryGenerator.d.ts +9 -3
- package/dist/summary/summaryGenerator.d.ts.map +1 -1
- package/dist/summary/summaryGenerator.js +42 -38
- package/dist/summary/summaryGenerator.js.map +1 -1
- package/dist/summary/summaryManager.d.ts +7 -6
- package/dist/summary/summaryManager.d.ts.map +1 -1
- package/dist/summary/summaryManager.js +22 -15
- package/dist/summary/summaryManager.js.map +1 -1
- package/lib/batchTracker.d.ts +1 -1
- package/lib/batchTracker.js +1 -1
- package/lib/batchTracker.js.map +1 -1
- package/lib/blobManager.d.ts +4 -20
- package/lib/blobManager.d.ts.map +1 -1
- package/lib/blobManager.js +46 -124
- package/lib/blobManager.js.map +1 -1
- package/lib/containerRuntime.d.ts +82 -14
- package/lib/containerRuntime.d.ts.map +1 -1
- package/lib/containerRuntime.js +223 -123
- package/lib/containerRuntime.js.map +1 -1
- package/lib/dataStore.d.ts.map +1 -1
- package/lib/dataStore.js +1 -2
- package/lib/dataStore.js.map +1 -1
- package/lib/dataStoreContext.d.ts.map +1 -1
- package/lib/dataStoreContext.js +1 -2
- package/lib/dataStoreContext.js.map +1 -1
- package/lib/dataStoreContexts.d.ts +1 -2
- package/lib/dataStoreContexts.d.ts.map +1 -1
- package/lib/dataStoreContexts.js.map +1 -1
- package/lib/dataStoreRegistry.js +1 -1
- package/lib/dataStoreRegistry.js.map +1 -1
- package/lib/dataStores.d.ts.map +1 -1
- package/lib/dataStores.js +1 -2
- package/lib/dataStores.js.map +1 -1
- package/lib/error.d.ts +14 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/error.js +17 -0
- package/lib/error.js.map +1 -0
- package/lib/gc/garbageCollection.d.ts +1 -1
- package/lib/gc/garbageCollection.d.ts.map +1 -1
- package/lib/gc/garbageCollection.js +22 -4
- package/lib/gc/garbageCollection.js.map +1 -1
- package/lib/gc/gcConfigs.d.ts.map +1 -1
- package/lib/gc/gcConfigs.js +3 -1
- package/lib/gc/gcConfigs.js.map +1 -1
- package/lib/gc/gcDefinitions.d.ts +2 -0
- package/lib/gc/gcDefinitions.d.ts.map +1 -1
- package/lib/gc/gcDefinitions.js.map +1 -1
- package/lib/gc/gcTelemetry.d.ts.map +1 -1
- package/lib/gc/gcTelemetry.js +2 -0
- package/lib/gc/gcTelemetry.js.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
- package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
- package/lib/id-compressor/appendOnlySortedMap.js +24 -65
- package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
- package/lib/id-compressor/finalSpace.d.ts +29 -0
- package/lib/id-compressor/finalSpace.d.ts.map +1 -0
- package/lib/id-compressor/finalSpace.js +58 -0
- package/lib/id-compressor/finalSpace.js.map +1 -0
- package/lib/id-compressor/idCompressor.d.ts +25 -250
- package/lib/id-compressor/idCompressor.d.ts.map +1 -1
- package/lib/id-compressor/idCompressor.js +381 -1139
- package/lib/id-compressor/idCompressor.js.map +1 -1
- package/lib/id-compressor/identifiers.d.ts +32 -0
- package/lib/id-compressor/identifiers.d.ts.map +1 -0
- package/lib/id-compressor/identifiers.js +11 -0
- package/lib/id-compressor/identifiers.js.map +1 -0
- package/lib/id-compressor/index.d.ts +5 -6
- package/lib/id-compressor/index.d.ts.map +1 -1
- package/lib/id-compressor/index.js +5 -6
- package/lib/id-compressor/index.js.map +1 -1
- package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
- package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
- package/lib/id-compressor/persistanceUtilities.js +34 -0
- package/lib/id-compressor/persistanceUtilities.js.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
- package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
- package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
- package/lib/id-compressor/sessions.d.ts +115 -0
- package/lib/id-compressor/sessions.d.ts.map +1 -0
- package/lib/id-compressor/sessions.js +290 -0
- package/lib/id-compressor/sessions.js.map +1 -0
- package/lib/id-compressor/utilities.d.ts +49 -0
- package/lib/id-compressor/utilities.d.ts.map +1 -0
- package/lib/id-compressor/utilities.js +148 -0
- package/lib/id-compressor/utilities.js.map +1 -0
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
- package/lib/opLifecycle/opCompressor.js +1 -2
- package/lib/opLifecycle/opCompressor.js.map +1 -1
- package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
- package/lib/opLifecycle/opSplitter.js +1 -2
- package/lib/opLifecycle/opSplitter.js.map +1 -1
- package/lib/opLifecycle/outbox.d.ts +1 -0
- package/lib/opLifecycle/outbox.d.ts.map +1 -1
- package/lib/opLifecycle/outbox.js +6 -7
- package/lib/opLifecycle/outbox.js.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
- package/lib/opLifecycle/remoteMessageProcessor.js +12 -6
- 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 +12 -5
- package/lib/pendingStateManager.d.ts.map +1 -1
- package/lib/pendingStateManager.js +21 -7
- package/lib/pendingStateManager.js.map +1 -1
- package/lib/scheduleManager.d.ts.map +1 -1
- package/lib/scheduleManager.js +1 -2
- package/lib/scheduleManager.js.map +1 -1
- package/lib/summary/index.d.ts +2 -2
- package/lib/summary/index.d.ts.map +1 -1
- package/lib/summary/index.js +1 -1
- package/lib/summary/index.js.map +1 -1
- package/lib/summary/orderedClientElection.d.ts +1 -2
- package/lib/summary/orderedClientElection.d.ts.map +1 -1
- package/lib/summary/orderedClientElection.js +1 -2
- package/lib/summary/orderedClientElection.js.map +1 -1
- package/lib/summary/runningSummarizer.d.ts +27 -4
- package/lib/summary/runningSummarizer.d.ts.map +1 -1
- package/lib/summary/runningSummarizer.js +237 -66
- package/lib/summary/runningSummarizer.js.map +1 -1
- package/lib/summary/summarizer.d.ts +6 -5
- package/lib/summary/summarizer.d.ts.map +1 -1
- package/lib/summary/summarizer.js +68 -65
- package/lib/summary/summarizer.js.map +1 -1
- package/lib/summary/summarizerClientElection.d.ts +1 -1
- package/lib/summary/summarizerClientElection.d.ts.map +1 -1
- package/lib/summary/summarizerClientElection.js.map +1 -1
- package/lib/summary/summarizerTypes.d.ts +38 -25
- package/lib/summary/summarizerTypes.d.ts.map +1 -1
- package/lib/summary/summarizerTypes.js.map +1 -1
- package/lib/summary/summaryCollection.d.ts +1 -2
- package/lib/summary/summaryCollection.d.ts.map +1 -1
- package/lib/summary/summaryCollection.js.map +1 -1
- package/lib/summary/summaryGenerator.d.ts +9 -3
- package/lib/summary/summaryGenerator.d.ts.map +1 -1
- package/lib/summary/summaryGenerator.js +43 -39
- package/lib/summary/summaryGenerator.js.map +1 -1
- package/lib/summary/summaryManager.d.ts +7 -6
- package/lib/summary/summaryManager.d.ts.map +1 -1
- package/lib/summary/summaryManager.js +23 -16
- package/lib/summary/summaryManager.js.map +1 -1
- package/package.json +27 -24
- package/src/batchTracker.ts +1 -1
- package/src/blobManager.ts +57 -146
- package/src/containerRuntime.ts +331 -158
- package/src/dataStore.ts +1 -2
- package/src/dataStoreContext.ts +3 -6
- package/src/dataStoreContexts.ts +1 -2
- package/src/dataStoreRegistry.ts +1 -1
- package/src/dataStores.ts +3 -5
- package/src/error.ts +18 -0
- package/src/gc/garbageCollection.ts +38 -5
- package/src/gc/gcConfigs.ts +4 -2
- package/src/gc/gcDefinitions.ts +2 -0
- package/src/gc/gcTelemetry.ts +2 -0
- package/src/id-compressor/appendOnlySortedMap.ts +25 -86
- package/src/id-compressor/finalSpace.ts +67 -0
- package/src/id-compressor/idCompressor.ts +455 -1681
- package/src/id-compressor/identifiers.ts +42 -0
- package/src/id-compressor/index.ts +11 -20
- package/src/id-compressor/persistanceUtilities.ts +58 -0
- package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
- package/src/id-compressor/sessions.ts +405 -0
- package/src/id-compressor/utilities.ts +187 -0
- package/src/index.ts +7 -1
- package/src/opLifecycle/opCompressor.ts +1 -2
- package/src/opLifecycle/opSplitter.ts +4 -4
- package/src/opLifecycle/outbox.ts +13 -10
- package/src/opLifecycle/remoteMessageProcessor.ts +19 -6
- package/src/packageVersion.ts +1 -1
- package/src/pendingStateManager.ts +49 -27
- package/src/scheduleManager.ts +5 -4
- package/src/summary/index.ts +3 -1
- package/src/summary/orderedClientElection.ts +6 -4
- package/src/summary/runningSummarizer.ts +276 -95
- package/src/summary/summarizer.ts +22 -12
- package/src/summary/summarizerClientElection.ts +1 -1
- package/src/summary/summarizerTypes.ts +40 -25
- package/src/summary/summaryCollection.ts +1 -2
- package/src/summary/summaryGenerator.ts +49 -52
- package/src/summary/summaryManager.ts +33 -11
- package/dist/id-compressor/idRange.d.ts +0 -11
- package/dist/id-compressor/idRange.d.ts.map +0 -1
- package/dist/id-compressor/idRange.js +0 -29
- package/dist/id-compressor/idRange.js.map +0 -1
- package/dist/id-compressor/numericUuid.d.ts +0 -59
- package/dist/id-compressor/numericUuid.d.ts.map +0 -1
- package/dist/id-compressor/numericUuid.js +0 -325
- package/dist/id-compressor/numericUuid.js.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/dist/id-compressor/sessionIdNormalizer.js +0 -483
- package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/dist/id-compressor/utils.d.ts +0 -57
- package/dist/id-compressor/utils.d.ts.map +0 -1
- package/dist/id-compressor/utils.js +0 -90
- package/dist/id-compressor/utils.js.map +0 -1
- package/dist/id-compressor/uuidUtilities.d.ts +0 -28
- package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/dist/id-compressor/uuidUtilities.js +0 -104
- package/dist/id-compressor/uuidUtilities.js.map +0 -1
- package/lib/id-compressor/idRange.d.ts +0 -11
- package/lib/id-compressor/idRange.d.ts.map +0 -1
- package/lib/id-compressor/idRange.js +0 -25
- package/lib/id-compressor/idRange.js.map +0 -1
- package/lib/id-compressor/numericUuid.d.ts +0 -59
- package/lib/id-compressor/numericUuid.d.ts.map +0 -1
- package/lib/id-compressor/numericUuid.js +0 -315
- package/lib/id-compressor/numericUuid.js.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
- package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
- package/lib/id-compressor/sessionIdNormalizer.js +0 -479
- package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
- package/lib/id-compressor/utils.d.ts +0 -57
- package/lib/id-compressor/utils.d.ts.map +0 -1
- package/lib/id-compressor/utils.js +0 -79
- package/lib/id-compressor/utils.js.map +0 -1
- package/lib/id-compressor/uuidUtilities.d.ts +0 -28
- package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
- package/lib/id-compressor/uuidUtilities.js +0 -96
- package/lib/id-compressor/uuidUtilities.js.map +0 -1
- package/src/id-compressor/idRange.ts +0 -35
- package/src/id-compressor/numericUuid.ts +0 -383
- package/src/id-compressor/sessionIdNormalizer.ts +0 -609
- package/src/id-compressor/utils.ts +0 -114
- package/src/id-compressor/uuidUtilities.ts +0 -120
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IEvent, IEventProvider } from "@fluidframework/
|
|
7
|
-
import { ITelemetryProperties } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IEvent, IEventProvider, ITelemetryProperties } from "@fluidframework/core-interfaces";
|
|
8
7
|
import { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from "@fluidframework/telemetry-utils";
|
|
9
8
|
import { ContainerWarning, IDeltaManager } from "@fluidframework/container-definitions";
|
|
10
9
|
import {
|
|
@@ -34,6 +33,20 @@ export interface ICancellationToken<T> {
|
|
|
34
33
|
/* Similar to AbortSignal, but using promise instead of events */
|
|
35
34
|
export type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
|
|
36
35
|
|
|
36
|
+
/**
|
|
37
|
+
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
38
|
+
*/
|
|
39
|
+
export interface IRefreshSummaryAckOptions {
|
|
40
|
+
/** Handle from the ack's summary op. */
|
|
41
|
+
readonly proposalHandle: string | undefined;
|
|
42
|
+
/** Handle from the summary ack just received */
|
|
43
|
+
readonly ackHandle: string;
|
|
44
|
+
/** Reference sequence number from the ack's summary op */
|
|
45
|
+
readonly summaryRefSeq: number;
|
|
46
|
+
/** Telemetry logger to which telemetry events will be forwarded. */
|
|
47
|
+
readonly summaryLogger: ITelemetryLoggerExt;
|
|
48
|
+
}
|
|
49
|
+
|
|
37
50
|
export interface ISummarizerInternalsProvider {
|
|
38
51
|
/** Encapsulates the work to walk the internals of the running container to generate a summary */
|
|
39
52
|
submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
|
|
@@ -88,29 +101,21 @@ export interface ISummarizerRuntime extends IConnectableRuntime {
|
|
|
88
101
|
export interface ISummarizeOptions {
|
|
89
102
|
/** True to generate the full tree with no handle reuse optimizations; defaults to false */
|
|
90
103
|
readonly fullTree?: boolean;
|
|
91
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* True to ask the server what the latest summary is first; defaults to false
|
|
106
|
+
*
|
|
107
|
+
* @deprecated - Summarize will not refresh latest snapshot state anymore.
|
|
108
|
+
*/
|
|
92
109
|
readonly refreshLatestAck?: boolean;
|
|
93
110
|
}
|
|
94
111
|
|
|
95
|
-
/**
|
|
96
|
-
* Data required to update internal tracking state after receiving a Summary Ack.
|
|
97
|
-
*/
|
|
98
|
-
export interface IRefreshSummaryAckOptions {
|
|
99
|
-
/** Handle from the ack's summary op. */
|
|
100
|
-
readonly proposalHandle: string | undefined;
|
|
101
|
-
/** Handle from the summary ack just received */
|
|
102
|
-
readonly ackHandle: string;
|
|
103
|
-
/** Reference sequence number from the ack's summary op */
|
|
104
|
-
readonly summaryRefSeq: number;
|
|
105
|
-
/** Telemetry logger to which telemetry events will be forwarded. */
|
|
106
|
-
readonly summaryLogger: ITelemetryLoggerExt;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
112
|
export interface ISubmitSummaryOptions extends ISummarizeOptions {
|
|
110
113
|
/** Logger to use for correlated summary events */
|
|
111
114
|
readonly summaryLogger: ITelemetryLoggerExt;
|
|
112
115
|
/** Tells when summary process should be cancelled */
|
|
113
116
|
readonly cancellationToken: ISummaryCancellationToken;
|
|
117
|
+
/** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt. */
|
|
118
|
+
readonly finalAttempt?: boolean;
|
|
114
119
|
}
|
|
115
120
|
|
|
116
121
|
export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
|
|
@@ -216,8 +221,14 @@ export type SubmitSummaryResult =
|
|
|
216
221
|
|
|
217
222
|
/** The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage. */
|
|
218
223
|
export type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
|
|
224
|
+
|
|
225
|
+
/** Type for summarization failures that are retriable. */
|
|
226
|
+
export interface IRetriableFailureResult {
|
|
227
|
+
readonly retryAfterSeconds?: number;
|
|
228
|
+
}
|
|
229
|
+
|
|
219
230
|
/** The data in summarizer result when submit summary stage fails. */
|
|
220
|
-
export interface SubmitSummaryFailureData {
|
|
231
|
+
export interface SubmitSummaryFailureData extends IRetriableFailureResult {
|
|
221
232
|
stage: SummaryStage;
|
|
222
233
|
}
|
|
223
234
|
|
|
@@ -231,7 +242,7 @@ export interface IAckSummaryResult {
|
|
|
231
242
|
readonly ackNackDuration: number;
|
|
232
243
|
}
|
|
233
244
|
|
|
234
|
-
export interface INackSummaryResult {
|
|
245
|
+
export interface INackSummaryResult extends IRetriableFailureResult {
|
|
235
246
|
readonly summaryNackOp: ISummaryNackMessage;
|
|
236
247
|
readonly ackNackDuration: number;
|
|
237
248
|
}
|
|
@@ -246,7 +257,6 @@ export type SummarizeResultPart<TSuccess, TFailure = undefined> =
|
|
|
246
257
|
data: TFailure | undefined;
|
|
247
258
|
message: string;
|
|
248
259
|
error: any;
|
|
249
|
-
retryAfterSeconds?: number;
|
|
250
260
|
};
|
|
251
261
|
|
|
252
262
|
export interface ISummarizeResults {
|
|
@@ -315,11 +325,14 @@ export type SummarizerStopReason =
|
|
|
315
325
|
*/
|
|
316
326
|
| "latestSummaryStateStale";
|
|
317
327
|
|
|
328
|
+
export interface ISummarizeEventProps {
|
|
329
|
+
result: "success" | "failure" | "canceled";
|
|
330
|
+
currentAttempt: number;
|
|
331
|
+
maxAttempts: number;
|
|
332
|
+
error?: any;
|
|
333
|
+
}
|
|
318
334
|
export interface ISummarizerEvents extends IEvent {
|
|
319
|
-
|
|
320
|
-
* An event indicating that the Summarizer is having problems summarizing
|
|
321
|
-
*/
|
|
322
|
-
(event: "summarizingError", listener: (error: ISummarizingWarning) => void);
|
|
335
|
+
(event: "summarize", listener: (props: ISummarizeEventProps) => void);
|
|
323
336
|
}
|
|
324
337
|
|
|
325
338
|
export interface ISummarizer extends IEventProvider<ISummarizerEvents> {
|
|
@@ -437,7 +450,7 @@ export interface ISummarizeHeuristicRunner {
|
|
|
437
450
|
|
|
438
451
|
type ISummarizeTelemetryRequiredProperties =
|
|
439
452
|
/** Reason code for attempting to summarize */
|
|
440
|
-
"
|
|
453
|
+
"summarizeReason";
|
|
441
454
|
|
|
442
455
|
type ISummarizeTelemetryOptionalProperties =
|
|
443
456
|
/** Number of attempts within the last time window, used for calculating the throttle delay. */
|
|
@@ -446,6 +459,8 @@ type ISummarizeTelemetryOptionalProperties =
|
|
|
446
459
|
| "summaryAttemptsPerPhase"
|
|
447
460
|
/** One-based count of phases we've attempted (used to index into an array of ISummarizeOptions */
|
|
448
461
|
| "summaryAttemptPhase"
|
|
462
|
+
/** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt */
|
|
463
|
+
| "finalAttempt"
|
|
449
464
|
| keyof ISummarizeOptions;
|
|
450
465
|
|
|
451
466
|
export type ISummarizeTelemetryProperties = Pick<
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { IEvent } from "@fluidframework/
|
|
7
|
-
import { IDisposable } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { IDisposable, IEvent } from "@fluidframework/core-interfaces";
|
|
8
7
|
import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
|
|
9
8
|
import { Deferred, assert, TypedEventEmitter } from "@fluidframework/common-utils";
|
|
10
9
|
import { IDeltaManager } from "@fluidframework/container-definitions";
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
ITelemetryLoggerExt,
|
|
8
8
|
PerformanceEvent,
|
|
9
9
|
LoggingError,
|
|
10
|
-
createChildLogger,
|
|
11
10
|
} from "@fluidframework/telemetry-utils";
|
|
12
11
|
import { ITelemetryProperties } from "@fluidframework/core-interfaces";
|
|
13
12
|
|
|
@@ -24,7 +23,6 @@ import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
|
24
23
|
import {
|
|
25
24
|
IAckSummaryResult,
|
|
26
25
|
INackSummaryResult,
|
|
27
|
-
ISummarizeOptions,
|
|
28
26
|
IBroadcastSummaryResult,
|
|
29
27
|
ISummarizeResults,
|
|
30
28
|
ISummarizeHeuristicData,
|
|
@@ -32,9 +30,7 @@ import {
|
|
|
32
30
|
SubmitSummaryResult,
|
|
33
31
|
SummarizeResultPart,
|
|
34
32
|
ISummaryCancellationToken,
|
|
35
|
-
ISummarizeTelemetryProperties,
|
|
36
33
|
SummaryGeneratorTelemetry,
|
|
37
|
-
SummaryStage,
|
|
38
34
|
SubmitSummaryFailureData,
|
|
39
35
|
} from "./summarizerTypes";
|
|
40
36
|
import { IClientSummaryWatcher } from "./summaryCollection";
|
|
@@ -143,12 +139,17 @@ export class SummarizeResultBuilder {
|
|
|
143
139
|
SummarizeResultPart<IAckSummaryResult, INackSummaryResult>
|
|
144
140
|
>();
|
|
145
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Fails one or more of the three results as per the passed params.
|
|
144
|
+
* If submit fails, all three results fail.
|
|
145
|
+
* If op broadcast fails, only op broadcast result and ack nack result fails.
|
|
146
|
+
* If ack nack fails, only ack nack result fails.
|
|
147
|
+
*/
|
|
146
148
|
public fail(
|
|
147
149
|
message: string,
|
|
148
150
|
error: any,
|
|
149
|
-
|
|
151
|
+
submitFailureResult?: SubmitSummaryFailureData,
|
|
150
152
|
nackSummaryResult?: INackSummaryResult,
|
|
151
|
-
retryAfterSeconds?: number,
|
|
152
153
|
) {
|
|
153
154
|
assert(
|
|
154
155
|
!this.receivedSummaryAckOrNack.isCompleted,
|
|
@@ -160,9 +161,11 @@ export class SummarizeResultBuilder {
|
|
|
160
161
|
message,
|
|
161
162
|
data: undefined,
|
|
162
163
|
error,
|
|
163
|
-
retryAfterSeconds,
|
|
164
164
|
} as const;
|
|
165
|
-
|
|
165
|
+
|
|
166
|
+
// Note that if any of these are already resolved, it will be a no-op. For example, if ack nack failed but
|
|
167
|
+
// submit summary and op broadcast has already been resolved as passed, only ack nack result will get modified.
|
|
168
|
+
this.summarySubmitted.resolve({ ...result, data: submitFailureResult });
|
|
166
169
|
this.summaryOpBroadcasted.resolve(result);
|
|
167
170
|
this.receivedSummaryAckOrNack.resolve({ ...result, data: nackSummaryResult });
|
|
168
171
|
}
|
|
@@ -217,33 +220,23 @@ export class SummaryGenerator {
|
|
|
217
220
|
* fullTree to generate tree without any summary handles even if unchanged
|
|
218
221
|
*/
|
|
219
222
|
public summarize(
|
|
220
|
-
|
|
221
|
-
options: ISummarizeOptions,
|
|
222
|
-
cancellationToken: ISummaryCancellationToken,
|
|
223
|
+
summaryOptions: ISubmitSummaryOptions,
|
|
223
224
|
resultsBuilder = new SummarizeResultBuilder(),
|
|
224
225
|
): ISummarizeResults {
|
|
225
|
-
this.summarizeCore(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
},
|
|
231
|
-
);
|
|
226
|
+
this.summarizeCore(summaryOptions, resultsBuilder).catch((error) => {
|
|
227
|
+
const message = "UnexpectedSummarizeError";
|
|
228
|
+
summaryOptions.summaryLogger.sendErrorEvent({ eventName: message }, error);
|
|
229
|
+
resultsBuilder.fail(message, error);
|
|
230
|
+
});
|
|
232
231
|
|
|
233
232
|
return resultsBuilder.build();
|
|
234
233
|
}
|
|
235
234
|
|
|
236
235
|
private async summarizeCore(
|
|
237
|
-
|
|
238
|
-
options: ISummarizeOptions,
|
|
236
|
+
submitSummaryOptions: ISubmitSummaryOptions,
|
|
239
237
|
resultsBuilder: SummarizeResultBuilder,
|
|
240
|
-
cancellationToken: ISummaryCancellationToken,
|
|
241
238
|
): Promise<void> {
|
|
242
|
-
const {
|
|
243
|
-
const logger = createChildLogger({
|
|
244
|
-
logger: this.logger,
|
|
245
|
-
properties: { all: summarizeProps },
|
|
246
|
-
});
|
|
239
|
+
const { summaryLogger, cancellationToken, ...summarizeOptions } = submitSummaryOptions;
|
|
247
240
|
|
|
248
241
|
// Note: timeSinceLastAttempt and timeSinceLastSummary for the
|
|
249
242
|
// first summary are basically the time since the summarizer was loaded.
|
|
@@ -251,32 +244,35 @@ export class SummaryGenerator {
|
|
|
251
244
|
const timeSinceLastSummary =
|
|
252
245
|
Date.now() - this.heuristicData.lastSuccessfulSummary.summaryTime;
|
|
253
246
|
let summarizeTelemetryProps: SummaryGeneratorTelemetry = {
|
|
254
|
-
|
|
247
|
+
...summarizeOptions,
|
|
248
|
+
fullTree: summarizeOptions.fullTree ?? false,
|
|
255
249
|
timeSinceLastAttempt,
|
|
256
250
|
timeSinceLastSummary,
|
|
257
251
|
};
|
|
258
252
|
|
|
259
253
|
const summarizeEvent = PerformanceEvent.start(
|
|
260
|
-
|
|
254
|
+
summaryLogger,
|
|
261
255
|
{
|
|
262
256
|
eventName: "Summarize",
|
|
263
|
-
refreshLatestAck,
|
|
264
257
|
...summarizeTelemetryProps,
|
|
265
258
|
},
|
|
266
259
|
{ start: true, end: true, cancel: "generic" },
|
|
267
260
|
);
|
|
268
261
|
|
|
269
262
|
let summaryData: SubmitSummaryResult | undefined;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Summarization can fail during submit, during op broadcast or during nack.
|
|
266
|
+
* For submit failures, submitFailureResult should be provided. For nack failures, nackSummaryResult should
|
|
267
|
+
* be provided. For op broadcast failures, only errors / properties should be provided.
|
|
268
|
+
*/
|
|
270
269
|
const fail = (
|
|
271
270
|
errorCode: keyof typeof summarizeErrors,
|
|
272
271
|
error?: any,
|
|
273
272
|
properties?: SummaryGeneratorTelemetry,
|
|
273
|
+
submitFailureResult?: SubmitSummaryFailureData,
|
|
274
274
|
nackSummaryResult?: INackSummaryResult,
|
|
275
275
|
) => {
|
|
276
|
-
// UploadSummary may fail with 429 and retryAfter - respect that
|
|
277
|
-
// Summary Nack also can have retryAfter, it's parsed below and comes as a property.
|
|
278
|
-
const retryAfterSeconds = getRetryDelaySecondsFromError(error);
|
|
279
|
-
|
|
280
276
|
// Report any failure as an error unless it was due to cancellation (like "disconnected" error)
|
|
281
277
|
// If failure happened on upload, we may not yet realized that socket disconnected, so check
|
|
282
278
|
// offlineError too.
|
|
@@ -291,15 +287,14 @@ export class SummaryGenerator {
|
|
|
291
287
|
...properties,
|
|
292
288
|
reason,
|
|
293
289
|
category,
|
|
294
|
-
retryAfterSeconds
|
|
290
|
+
retryAfterSeconds:
|
|
291
|
+
submitFailureResult?.retryAfterSeconds ??
|
|
292
|
+
nackSummaryResult?.retryAfterSeconds,
|
|
295
293
|
},
|
|
296
294
|
error ?? reason,
|
|
297
295
|
); // disconnect & summaryAckTimeout do not have proper error.
|
|
298
296
|
|
|
299
|
-
|
|
300
|
-
// unknown.
|
|
301
|
-
const stage = summaryData?.stage ?? "unknown";
|
|
302
|
-
resultsBuilder.fail(reason, error, stage, nackSummaryResult, retryAfterSeconds);
|
|
297
|
+
resultsBuilder.fail(reason, error, submitFailureResult, nackSummaryResult);
|
|
303
298
|
};
|
|
304
299
|
|
|
305
300
|
// Wait to generate and send summary
|
|
@@ -308,12 +303,7 @@ export class SummaryGenerator {
|
|
|
308
303
|
// Need to save refSeqNum before we record new attempt (happens as part of submitSummaryCallback)
|
|
309
304
|
const lastAttemptRefSeqNum = this.heuristicData.lastAttempt.refSequenceNumber;
|
|
310
305
|
|
|
311
|
-
summaryData = await this.submitSummaryCallback(
|
|
312
|
-
fullTree,
|
|
313
|
-
refreshLatestAck,
|
|
314
|
-
summaryLogger: logger,
|
|
315
|
-
cancellationToken,
|
|
316
|
-
});
|
|
306
|
+
summaryData = await this.submitSummaryCallback(submitSummaryOptions);
|
|
317
307
|
|
|
318
308
|
// Cumulatively add telemetry properties based on how far generateSummary went.
|
|
319
309
|
const referenceSequenceNumber = summaryData.referenceSequenceNumber;
|
|
@@ -333,7 +323,10 @@ export class SummaryGenerator {
|
|
|
333
323
|
);
|
|
334
324
|
|
|
335
325
|
if (summaryData.stage !== "submit") {
|
|
336
|
-
return fail("submitSummaryFailure", summaryData.error, summarizeTelemetryProps
|
|
326
|
+
return fail("submitSummaryFailure", summaryData.error, summarizeTelemetryProps, {
|
|
327
|
+
stage: summaryData.stage,
|
|
328
|
+
retryAfterSeconds: getRetryDelaySecondsFromError(summaryData.error),
|
|
329
|
+
});
|
|
337
330
|
}
|
|
338
331
|
|
|
339
332
|
/**
|
|
@@ -346,14 +339,14 @@ export class SummaryGenerator {
|
|
|
346
339
|
* state change of multiple data stores. So, the total number of data stores that are summarized should not
|
|
347
340
|
* exceed the number of ops since last summary + number of data store whose reference state changed.
|
|
348
341
|
*/
|
|
349
|
-
if (!fullTree && !summaryData.forcedFullTree) {
|
|
342
|
+
if (!submitSummaryOptions.fullTree && !summaryData.forcedFullTree) {
|
|
350
343
|
const { summarizedDataStoreCount, gcStateUpdatedDataStoreCount = 0 } =
|
|
351
344
|
summaryData.summaryStats;
|
|
352
345
|
if (
|
|
353
346
|
summarizedDataStoreCount >
|
|
354
347
|
gcStateUpdatedDataStoreCount + this.heuristicData.opsSinceLastSummary
|
|
355
348
|
) {
|
|
356
|
-
|
|
349
|
+
summaryLogger.sendErrorEvent({
|
|
357
350
|
eventName: "IncrementalSummaryViolation",
|
|
358
351
|
summarizedDataStoreCount,
|
|
359
352
|
gcStateUpdatedDataStoreCount,
|
|
@@ -366,7 +359,10 @@ export class SummaryGenerator {
|
|
|
366
359
|
summarizeEvent.reportEvent("generate", { ...summarizeTelemetryProps });
|
|
367
360
|
resultsBuilder.summarySubmitted.resolve({ success: true, data: summaryData });
|
|
368
361
|
} catch (error) {
|
|
369
|
-
return fail("submitSummaryFailure", error
|
|
362
|
+
return fail("submitSummaryFailure", error, undefined /* properties */, {
|
|
363
|
+
stage: "unknown",
|
|
364
|
+
retryAfterSeconds: getRetryDelaySecondsFromError(error),
|
|
365
|
+
});
|
|
370
366
|
} finally {
|
|
371
367
|
if (summaryData === undefined) {
|
|
372
368
|
this.heuristicData.recordAttempt();
|
|
@@ -385,10 +381,10 @@ export class SummaryGenerator {
|
|
|
385
381
|
cancellationToken,
|
|
386
382
|
);
|
|
387
383
|
if (waitBroadcastResult.result === "cancelled") {
|
|
388
|
-
return fail("disconnect"
|
|
384
|
+
return fail("disconnect");
|
|
389
385
|
}
|
|
390
386
|
if (waitBroadcastResult.result !== "done") {
|
|
391
|
-
return fail("summaryOpWaitTimeout"
|
|
387
|
+
return fail("summaryOpWaitTimeout");
|
|
392
388
|
}
|
|
393
389
|
const summarizeOp = waitBroadcastResult.value;
|
|
394
390
|
|
|
@@ -399,7 +395,7 @@ export class SummaryGenerator {
|
|
|
399
395
|
});
|
|
400
396
|
|
|
401
397
|
this.heuristicData.lastAttempt.summarySequenceNumber = summarizeOp.sequenceNumber;
|
|
402
|
-
|
|
398
|
+
summaryLogger.sendTelemetryEvent({
|
|
403
399
|
eventName: "Summarize_Op",
|
|
404
400
|
duration: broadcastDuration,
|
|
405
401
|
referenceSequenceNumber: summarizeOp.referenceSequenceNumber,
|
|
@@ -468,7 +464,8 @@ export class SummaryGenerator {
|
|
|
468
464
|
"summaryNack",
|
|
469
465
|
error,
|
|
470
466
|
{ ...summarizeTelemetryProps, nackRetryAfter: retryAfterSeconds },
|
|
471
|
-
|
|
467
|
+
undefined /* submitFailureResult */,
|
|
468
|
+
{ summaryNackOp: ackNackOp, ackNackDuration, retryAfterSeconds },
|
|
472
469
|
);
|
|
473
470
|
}
|
|
474
471
|
} finally {
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
IDisposable,
|
|
8
|
+
IEvent,
|
|
9
|
+
IEventProvider,
|
|
10
|
+
ITelemetryBaseLogger,
|
|
11
|
+
} from "@fluidframework/core-interfaces";
|
|
12
|
+
import { TypedEventEmitter, assert } from "@fluidframework/common-utils";
|
|
9
13
|
import {
|
|
10
14
|
createChildLogger,
|
|
11
15
|
ITelemetryLoggerExt,
|
|
@@ -14,7 +18,16 @@ import {
|
|
|
14
18
|
import { DriverErrorType } from "@fluidframework/driver-definitions";
|
|
15
19
|
import { IThrottler } from "../throttler";
|
|
16
20
|
import { ISummarizerClientElection } from "./summarizerClientElection";
|
|
17
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
EnqueueSummarizeResult,
|
|
23
|
+
IEnqueueSummarizeOptions,
|
|
24
|
+
IOnDemandSummarizeOptions,
|
|
25
|
+
ISummarizeEventProps,
|
|
26
|
+
ISummarizeResults,
|
|
27
|
+
ISummarizer,
|
|
28
|
+
ISummarizerEvents,
|
|
29
|
+
SummarizerStopReason,
|
|
30
|
+
} from "./summarizerTypes";
|
|
18
31
|
import { SummaryCollection } from "./summaryCollection";
|
|
19
32
|
import { Summarizer } from "./summarizer";
|
|
20
33
|
|
|
@@ -73,7 +86,7 @@ export interface ISummaryManagerConfig {
|
|
|
73
86
|
* It observes changes in calculated summarizer and reacts to changes by either creating summarizer client or
|
|
74
87
|
* stopping existing summarizer client.
|
|
75
88
|
*/
|
|
76
|
-
export class SummaryManager implements IDisposable {
|
|
89
|
+
export class SummaryManager extends TypedEventEmitter<ISummarizerEvents> implements IDisposable {
|
|
77
90
|
private readonly logger: ITelemetryLoggerExt;
|
|
78
91
|
private readonly opsToBypassInitialDelay: number;
|
|
79
92
|
private readonly initialDelayMs: number;
|
|
@@ -108,6 +121,8 @@ export class SummaryManager implements IDisposable {
|
|
|
108
121
|
}: Readonly<Partial<ISummaryManagerConfig>> = {},
|
|
109
122
|
private readonly disableHeuristics?: boolean,
|
|
110
123
|
) {
|
|
124
|
+
super();
|
|
125
|
+
|
|
111
126
|
this.logger = createChildLogger({
|
|
112
127
|
logger: parentLogger,
|
|
113
128
|
namespace: "SummaryManager",
|
|
@@ -145,6 +160,10 @@ export class SummaryManager implements IDisposable {
|
|
|
145
160
|
this.refreshSummarizer();
|
|
146
161
|
};
|
|
147
162
|
|
|
163
|
+
private readonly handleSummarizeEvent = (eventProps: ISummarizeEventProps) => {
|
|
164
|
+
this.emit("summarize", eventProps);
|
|
165
|
+
};
|
|
166
|
+
|
|
148
167
|
private static readonly isStartingOrRunning = (state: SummaryManagerState) =>
|
|
149
168
|
state === SummaryManagerState.Starting || state === SummaryManagerState.Running;
|
|
150
169
|
|
|
@@ -246,6 +265,7 @@ export class SummaryManager implements IDisposable {
|
|
|
246
265
|
|
|
247
266
|
const summarizer = await this.requestSummarizerFn();
|
|
248
267
|
this.summarizer = summarizer;
|
|
268
|
+
this.summarizer.on("summarize", this.handleSummarizeEvent);
|
|
249
269
|
|
|
250
270
|
// Re-validate that it need to be running. Due to asynchrony, it may be not the case anymore
|
|
251
271
|
// If we can't run the LastSummary, simply return as to avoid paying the cost of launching
|
|
@@ -322,6 +342,7 @@ export class SummaryManager implements IDisposable {
|
|
|
322
342
|
assert(this.state !== SummaryManagerState.Off, 0x264 /* "Expected: Not Off" */);
|
|
323
343
|
this.state = SummaryManagerState.Off;
|
|
324
344
|
|
|
345
|
+
this.summarizer?.off("summarize", this.handleSummarizeEvent);
|
|
325
346
|
this.summarizer?.close();
|
|
326
347
|
this.summarizer = undefined;
|
|
327
348
|
|
|
@@ -404,26 +425,27 @@ export class SummaryManager implements IDisposable {
|
|
|
404
425
|
return startWithInitialDelay;
|
|
405
426
|
}
|
|
406
427
|
|
|
407
|
-
public
|
|
428
|
+
public summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults {
|
|
408
429
|
if (this.summarizer === undefined) {
|
|
409
430
|
throw Error("No running summarizer client");
|
|
410
431
|
// TODO: could spawn a summarizer client temporarily.
|
|
411
432
|
}
|
|
412
|
-
return this.summarizer.summarizeOnDemand(
|
|
413
|
-
}
|
|
433
|
+
return this.summarizer.summarizeOnDemand(options);
|
|
434
|
+
}
|
|
414
435
|
|
|
415
|
-
public
|
|
436
|
+
public enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult {
|
|
416
437
|
if (this.summarizer === undefined) {
|
|
417
438
|
throw Error("No running summarizer client");
|
|
418
439
|
// TODO: could spawn a summarizer client temporarily.
|
|
419
440
|
}
|
|
420
|
-
return this.summarizer.enqueueSummarize(
|
|
421
|
-
}
|
|
441
|
+
return this.summarizer.enqueueSummarize(options);
|
|
442
|
+
}
|
|
422
443
|
|
|
423
444
|
public dispose() {
|
|
424
445
|
this.clientElection.off("electedSummarizerChanged", this.refreshSummarizer);
|
|
425
446
|
this.connectedState.off("connected", this.handleConnected);
|
|
426
447
|
this.connectedState.off("disconnected", this.handleDisconnected);
|
|
448
|
+
this.summarizer?.off("summarize", this.handleSummarizeEvent);
|
|
427
449
|
this._disposed = true;
|
|
428
450
|
}
|
|
429
451
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import type { IdCreationRange, UnackedLocalId } from "@fluidframework/runtime-definitions";
|
|
6
|
-
export declare function getIds(range: IdCreationRange): {
|
|
7
|
-
first: UnackedLocalId;
|
|
8
|
-
last: UnackedLocalId;
|
|
9
|
-
overrides?: IdCreationRange.Overrides;
|
|
10
|
-
} | undefined;
|
|
11
|
-
//# sourceMappingURL=idRange.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"idRange.d.ts","sourceRoot":"","sources":["../../src/id-compressor/idRange.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAE3F,wBAAgB,MAAM,CACrB,KAAK,EAAE,eAAe,GAEpB;IAAE,KAAK,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,SAAS,CAAC,EAAE,eAAe,CAAC,SAAS,CAAA;CAAE,GACtF,SAAS,CAsBX"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
4
|
-
* Licensed under the MIT License.
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.getIds = void 0;
|
|
8
|
-
const common_utils_1 = require("@fluidframework/common-utils");
|
|
9
|
-
function getIds(range) {
|
|
10
|
-
const { ids } = range;
|
|
11
|
-
if (ids === undefined) {
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
let first = ids.first;
|
|
15
|
-
let last = ids.last;
|
|
16
|
-
const overrides = ids;
|
|
17
|
-
if (overrides.overrides !== undefined) {
|
|
18
|
-
first ?? (first = overrides.overrides[0][0]);
|
|
19
|
-
last ?? (last = overrides.overrides[overrides.overrides.length - 1][0]);
|
|
20
|
-
}
|
|
21
|
-
(0, common_utils_1.assert)(first !== undefined && last !== undefined, 0x49b /* malformed IdCreationRange */);
|
|
22
|
-
return {
|
|
23
|
-
first,
|
|
24
|
-
last,
|
|
25
|
-
overrides: overrides.overrides,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
exports.getIds = getIds;
|
|
29
|
-
//# sourceMappingURL=idRange.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"idRange.js","sourceRoot":"","sources":["../../src/id-compressor/idRange.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAsD;AAGtD,SAAgB,MAAM,CACrB,KAAsB;IAItB,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;IACtB,IAAI,GAAG,KAAK,SAAS,EAAE;QACtB,OAAO,SAAS,CAAC;KACjB;IAED,IAAI,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACtB,IAAI,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IAEpB,MAAM,SAAS,GAAG,GAA4C,CAAC;IAC/D,IAAI,SAAS,CAAC,SAAS,KAAK,SAAS,EAAE;QACtC,KAAK,KAAL,KAAK,GAAK,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC;QACpC,IAAI,KAAJ,IAAI,GAAK,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC;KAChE;IAED,IAAA,qBAAM,EAAC,KAAK,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAEzF,OAAO;QACN,KAAK;QACL,IAAI;QACJ,SAAS,EAAE,SAAS,CAAC,SAAS;KAC9B,CAAC;AACH,CAAC;AA1BD,wBA0BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/common-utils\";\nimport type { IdCreationRange, UnackedLocalId } from \"@fluidframework/runtime-definitions\";\n\nexport function getIds(\n\trange: IdCreationRange,\n):\n\t| { first: UnackedLocalId; last: UnackedLocalId; overrides?: IdCreationRange.Overrides }\n\t| undefined {\n\tconst { ids } = range;\n\tif (ids === undefined) {\n\t\treturn undefined;\n\t}\n\n\tlet first = ids.first;\n\tlet last = ids.last;\n\n\tconst overrides = ids as Partial<IdCreationRange.HasOverrides>;\n\tif (overrides.overrides !== undefined) {\n\t\tfirst ??= overrides.overrides[0][0];\n\t\tlast ??= overrides.overrides[overrides.overrides.length - 1][0];\n\t}\n\n\tassert(first !== undefined && last !== undefined, 0x49b /* malformed IdCreationRange */);\n\n\treturn {\n\t\tfirst,\n\t\tlast,\n\t\toverrides: overrides.overrides,\n\t};\n}\n"]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
import { SessionId, StableId } from "@fluidframework/runtime-definitions";
|
|
6
|
-
/**
|
|
7
|
-
* A UUID (128 bit identifier) optimized for use as a 128 bit unsigned integer with fast addition and toString operations.
|
|
8
|
-
* The string entry is the upper 76 bits of the uuid and the integer entry holds the lower 52 bits:
|
|
9
|
-
*
|
|
10
|
-
* ```
|
|
11
|
-
* UUUUUUUU-UUUU-VUUU-vUUU-UUUUUUUUUUUU - the uuid
|
|
12
|
-
* SSSSSSSS-SSSS-SSSS-SSS - array[0]: string
|
|
13
|
-
* N NNNNNNNNNNNN - array[1]: integer
|
|
14
|
-
* ```
|
|
15
|
-
*
|
|
16
|
-
* The integer keeps the common case cost of incrementing and computing deltas very low.
|
|
17
|
-
* The string optimizes toString by caching the the majority of the resulting string.
|
|
18
|
-
*/
|
|
19
|
-
export declare type NumericUuid = readonly [string, number] & {
|
|
20
|
-
readonly NumericUuid: "9132ea20-a811-4756-85f8-aa6da5ca90f8";
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Calculates the numeric delta between a and b (i.e. a - b).
|
|
24
|
-
* @param a - an uuid
|
|
25
|
-
* @param b - an other uuid
|
|
26
|
-
* @param maxDelta - the maximum integer delta (inclusive) to tolerate.
|
|
27
|
-
* @returns undefined if the delta is negative or greater than `maxDelta`
|
|
28
|
-
*/
|
|
29
|
-
export declare function getPositiveDelta(a: NumericUuid, b: NumericUuid, maxDelta: number): number | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* @param offset - an optional offset to increment the returned StableId
|
|
32
|
-
* @returns the string representation of a `NumericUuid`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function stableIdFromNumericUuid(uuid: NumericUuid, offset?: number): StableId;
|
|
35
|
-
/**
|
|
36
|
-
* @param stableId - a minimal uuid string
|
|
37
|
-
* @returns a numeric representation of `stableId`.
|
|
38
|
-
*/
|
|
39
|
-
export declare function numericUuidFromStableId(stableId: StableId): NumericUuid;
|
|
40
|
-
/**
|
|
41
|
-
* Creates a session base ID.
|
|
42
|
-
* This method (rather than standard uuid generation methods) should be used to generate session IDs.
|
|
43
|
-
*/
|
|
44
|
-
export declare function createSessionId(): SessionId;
|
|
45
|
-
/**
|
|
46
|
-
* Compares numeric uuids for equality.
|
|
47
|
-
*/
|
|
48
|
-
export declare function numericUuidEquals(a: NumericUuid, b: NumericUuid): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Increments the uuid. `amount` must be a positive integer.
|
|
51
|
-
* @returns the result of incrementing the uuid by `amount`.
|
|
52
|
-
*/
|
|
53
|
-
export declare function incrementUuid(uuid: NumericUuid, amount: number): NumericUuid;
|
|
54
|
-
/**
|
|
55
|
-
* Any session uuid with all of its highish bits set is in danger of overflowing after fewer than 2^53 increments.
|
|
56
|
-
* By zeroing one of those bits at random, potential overflow is prevented.
|
|
57
|
-
*/
|
|
58
|
-
export declare function ensureSessionUuid(uuid: StableId): SessionId;
|
|
59
|
-
//# sourceMappingURL=numericUuid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"numericUuid.d.ts","sourceRoot":"","sources":["../../src/id-compressor/numericUuid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAI1E;;;;;;;;;;;;GAYG;AACH,oBAAY,WAAW,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IACrD,QAAQ,CAAC,WAAW,EAAE,sCAAsC,CAAC;CAC7D,CAAC;AAQF;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC/B,CAAC,EAAE,WAAW,EACd,CAAC,EAAE,WAAW,EACd,QAAQ,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAgDpB;AAaD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,SAAI,GAAG,QAAQ,CAW/E;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,WAAW,CAKvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,SAAS,CAE3C;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAEzE;AAQD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAoD5E;AAiJD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,CAoB3D"}
|