@fluidframework/container-runtime 2.0.0-internal.7.1.0 → 2.0.0-internal.7.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.
Files changed (207) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-extractor.json +1 -13
  3. package/api-report/container-runtime.api.md +75 -10
  4. package/dist/blobManager.d.ts +4 -6
  5. package/dist/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager.js +42 -56
  7. package/dist/blobManager.js.map +1 -1
  8. package/dist/containerRuntime.d.ts +71 -23
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +72 -32
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/dataStore.js +2 -2
  13. package/dist/dataStore.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +8 -2
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +15 -8
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/dataStoreRegistry.d.ts +3 -0
  19. package/dist/dataStoreRegistry.d.ts.map +1 -1
  20. package/dist/dataStoreRegistry.js +3 -0
  21. package/dist/dataStoreRegistry.js.map +1 -1
  22. package/dist/dataStores.d.ts +0 -2
  23. package/dist/dataStores.d.ts.map +1 -1
  24. package/dist/dataStores.js +2 -7
  25. package/dist/dataStores.js.map +1 -1
  26. package/dist/deltaManagerProxyBase.d.ts +1 -1
  27. package/dist/deltaManagerProxyBase.d.ts.map +1 -1
  28. package/dist/deltaManagerProxyBase.js +2 -2
  29. package/dist/deltaManagerProxyBase.js.map +1 -1
  30. package/dist/gc/garbageCollection.d.ts +6 -0
  31. package/dist/gc/garbageCollection.d.ts.map +1 -1
  32. package/dist/gc/garbageCollection.js +16 -3
  33. package/dist/gc/garbageCollection.js.map +1 -1
  34. package/dist/gc/gcConfigs.d.ts +1 -0
  35. package/dist/gc/gcConfigs.d.ts.map +1 -1
  36. package/dist/gc/gcConfigs.js +12 -2
  37. package/dist/gc/gcConfigs.js.map +1 -1
  38. package/dist/gc/gcDefinitions.d.ts +40 -9
  39. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  40. package/dist/gc/gcDefinitions.js +4 -1
  41. package/dist/gc/gcDefinitions.js.map +1 -1
  42. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  43. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  44. package/dist/gc/gcTelemetry.d.ts +2 -3
  45. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  46. package/dist/gc/gcTelemetry.js +7 -8
  47. package/dist/gc/gcTelemetry.js.map +1 -1
  48. package/dist/gc/index.d.ts +2 -2
  49. package/dist/gc/index.d.ts.map +1 -1
  50. package/dist/gc/index.js +1 -5
  51. package/dist/gc/index.js.map +1 -1
  52. package/dist/id-compressor/utilities.d.ts +3 -0
  53. package/dist/id-compressor/utilities.d.ts.map +1 -1
  54. package/dist/id-compressor/utilities.js +3 -0
  55. package/dist/id-compressor/utilities.js.map +1 -1
  56. package/dist/index.d.ts +3 -2
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +3 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/messageTypes.d.ts +4 -1
  61. package/dist/messageTypes.d.ts.map +1 -1
  62. package/dist/messageTypes.js +3 -0
  63. package/dist/messageTypes.js.map +1 -1
  64. package/dist/opLifecycle/definitions.d.ts +3 -0
  65. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  66. package/dist/opLifecycle/definitions.js.map +1 -1
  67. package/dist/packageVersion.d.ts +1 -1
  68. package/dist/packageVersion.js +1 -1
  69. package/dist/packageVersion.js.map +1 -1
  70. package/dist/summary/orderedClientElection.d.ts +4 -1
  71. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  72. package/dist/summary/orderedClientElection.js.map +1 -1
  73. package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
  74. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  75. package/dist/summary/runWhileConnectedCoordinator.js +1 -0
  76. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  77. package/dist/summary/summarizer.d.ts +1 -0
  78. package/dist/summary/summarizer.d.ts.map +1 -1
  79. package/dist/summary/summarizer.js +1 -0
  80. package/dist/summary/summarizer.js.map +1 -1
  81. package/dist/summary/summarizerTypes.d.ts +94 -10
  82. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  83. package/dist/summary/summarizerTypes.js.map +1 -1
  84. package/dist/summary/summaryCollection.d.ts +16 -0
  85. package/dist/summary/summaryCollection.d.ts.map +1 -1
  86. package/dist/summary/summaryCollection.js +1 -0
  87. package/dist/summary/summaryCollection.js.map +1 -1
  88. package/dist/summary/summaryFormat.d.ts +10 -1
  89. package/dist/summary/summaryFormat.d.ts.map +1 -1
  90. package/dist/summary/summaryFormat.js.map +1 -1
  91. package/lib/blobManager.d.ts +4 -6
  92. package/lib/blobManager.d.ts.map +1 -1
  93. package/lib/blobManager.js +44 -58
  94. package/lib/blobManager.js.map +1 -1
  95. package/lib/containerRuntime.d.ts +71 -23
  96. package/lib/containerRuntime.d.ts.map +1 -1
  97. package/lib/containerRuntime.js +73 -33
  98. package/lib/containerRuntime.js.map +1 -1
  99. package/lib/dataStore.js +2 -2
  100. package/lib/dataStore.js.map +1 -1
  101. package/lib/dataStoreContext.d.ts +8 -2
  102. package/lib/dataStoreContext.d.ts.map +1 -1
  103. package/lib/dataStoreContext.js +16 -9
  104. package/lib/dataStoreContext.js.map +1 -1
  105. package/lib/dataStoreRegistry.d.ts +3 -0
  106. package/lib/dataStoreRegistry.d.ts.map +1 -1
  107. package/lib/dataStoreRegistry.js +3 -0
  108. package/lib/dataStoreRegistry.js.map +1 -1
  109. package/lib/dataStores.d.ts +0 -2
  110. package/lib/dataStores.d.ts.map +1 -1
  111. package/lib/dataStores.js +3 -8
  112. package/lib/dataStores.js.map +1 -1
  113. package/lib/deltaManagerProxyBase.d.ts +1 -1
  114. package/lib/deltaManagerProxyBase.d.ts.map +1 -1
  115. package/lib/deltaManagerProxyBase.js +2 -2
  116. package/lib/deltaManagerProxyBase.js.map +1 -1
  117. package/lib/gc/garbageCollection.d.ts +6 -0
  118. package/lib/gc/garbageCollection.d.ts.map +1 -1
  119. package/lib/gc/garbageCollection.js +16 -3
  120. package/lib/gc/garbageCollection.js.map +1 -1
  121. package/lib/gc/gcConfigs.d.ts +1 -0
  122. package/lib/gc/gcConfigs.d.ts.map +1 -1
  123. package/lib/gc/gcConfigs.js +14 -4
  124. package/lib/gc/gcConfigs.js.map +1 -1
  125. package/lib/gc/gcDefinitions.d.ts +40 -9
  126. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  127. package/lib/gc/gcDefinitions.js +4 -1
  128. package/lib/gc/gcDefinitions.js.map +1 -1
  129. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  130. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  131. package/lib/gc/gcTelemetry.d.ts +2 -3
  132. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  133. package/lib/gc/gcTelemetry.js +7 -8
  134. package/lib/gc/gcTelemetry.js.map +1 -1
  135. package/lib/gc/index.d.ts +2 -2
  136. package/lib/gc/index.d.ts.map +1 -1
  137. package/lib/gc/index.js +2 -2
  138. package/lib/gc/index.js.map +1 -1
  139. package/lib/id-compressor/utilities.d.ts +3 -0
  140. package/lib/id-compressor/utilities.d.ts.map +1 -1
  141. package/lib/id-compressor/utilities.js +3 -0
  142. package/lib/id-compressor/utilities.js.map +1 -1
  143. package/lib/index.d.ts +3 -2
  144. package/lib/index.d.ts.map +1 -1
  145. package/lib/index.js +1 -0
  146. package/lib/index.js.map +1 -1
  147. package/lib/messageTypes.d.ts +4 -1
  148. package/lib/messageTypes.d.ts.map +1 -1
  149. package/lib/messageTypes.js +3 -0
  150. package/lib/messageTypes.js.map +1 -1
  151. package/lib/opLifecycle/definitions.d.ts +3 -0
  152. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  153. package/lib/opLifecycle/definitions.js.map +1 -1
  154. package/lib/packageVersion.d.ts +1 -1
  155. package/lib/packageVersion.js +1 -1
  156. package/lib/packageVersion.js.map +1 -1
  157. package/lib/summary/orderedClientElection.d.ts +4 -1
  158. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  159. package/lib/summary/orderedClientElection.js.map +1 -1
  160. package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
  161. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  162. package/lib/summary/runWhileConnectedCoordinator.js +1 -0
  163. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  164. package/lib/summary/summarizer.d.ts +1 -0
  165. package/lib/summary/summarizer.d.ts.map +1 -1
  166. package/lib/summary/summarizer.js +1 -0
  167. package/lib/summary/summarizer.js.map +1 -1
  168. package/lib/summary/summarizerTypes.d.ts +94 -10
  169. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  170. package/lib/summary/summarizerTypes.js.map +1 -1
  171. package/lib/summary/summaryCollection.d.ts +16 -0
  172. package/lib/summary/summaryCollection.d.ts.map +1 -1
  173. package/lib/summary/summaryCollection.js +1 -0
  174. package/lib/summary/summaryCollection.js.map +1 -1
  175. package/lib/summary/summaryFormat.d.ts +10 -1
  176. package/lib/summary/summaryFormat.d.ts.map +1 -1
  177. package/lib/summary/summaryFormat.js.map +1 -1
  178. package/package.json +25 -22
  179. package/src/blobManager.ts +61 -74
  180. package/src/containerRuntime.ts +103 -50
  181. package/src/dataStore.ts +2 -2
  182. package/src/dataStoreContext.ts +16 -9
  183. package/src/dataStoreRegistry.ts +3 -0
  184. package/src/dataStores.ts +4 -16
  185. package/src/deltaManagerProxyBase.ts +2 -2
  186. package/src/gc/garbageCollection.ts +18 -3
  187. package/src/gc/gcConfigs.ts +22 -4
  188. package/src/gc/gcDefinitions.ts +41 -9
  189. package/src/gc/gcSummaryDefinitions.ts +1 -1
  190. package/src/gc/gcTelemetry.ts +8 -8
  191. package/src/gc/index.ts +0 -4
  192. package/src/id-compressor/utilities.ts +3 -0
  193. package/src/index.ts +13 -1
  194. package/src/messageTypes.ts +4 -1
  195. package/src/opLifecycle/definitions.ts +3 -0
  196. package/src/packageVersion.ts +1 -1
  197. package/src/summary/orderedClientElection.ts +4 -1
  198. package/src/summary/runWhileConnectedCoordinator.ts +5 -1
  199. package/src/summary/summarizer.ts +1 -0
  200. package/src/summary/summarizerTypes.ts +95 -11
  201. package/src/summary/summaryCollection.ts +18 -1
  202. package/src/summary/summaryFormat.ts +11 -1
  203. package/dist/container-runtime-alpha.d.ts +0 -1554
  204. package/dist/container-runtime-beta.d.ts +0 -1554
  205. package/dist/container-runtime-public.d.ts +0 -1554
  206. package/dist/container-runtime.d.ts +0 -1611
  207. package/src/gc/gcEarlyAdoption.md +0 -145
@@ -1,1554 +0,0 @@
1
- import { AttachState } from '@fluidframework/container-definitions';
2
- import { ContainerWarning } from '@fluidframework/container-definitions';
3
- import { FluidDataStoreRegistryEntry } from '@fluidframework/runtime-definitions';
4
- import { FluidObject } from '@fluidframework/core-interfaces';
5
- import { FlushMode } from '@fluidframework/runtime-definitions';
6
- import { IAudience } from '@fluidframework/container-definitions';
7
- import { IClientDetails } from '@fluidframework/protocol-definitions';
8
- import { IContainerContext } from '@fluidframework/container-definitions';
9
- import { IContainerRuntime } from '@fluidframework/container-runtime-definitions';
10
- import { IContainerRuntimeEvents } from '@fluidframework/container-runtime-definitions';
11
- import { ICriticalContainerError } from '@fluidframework/container-definitions';
12
- import { IDataStore } from '@fluidframework/runtime-definitions';
13
- import { IDeltaManager } from '@fluidframework/container-definitions';
14
- import { IDisposable } from '@fluidframework/core-interfaces';
15
- import { IDocumentMessage } from '@fluidframework/protocol-definitions';
16
- import { IDocumentStorageService } from '@fluidframework/driver-definitions';
17
- import { IEvent } from '@fluidframework/core-interfaces';
18
- import { IEventProvider } from '@fluidframework/core-interfaces';
19
- import { IFluidDataStoreContextDetached } from '@fluidframework/runtime-definitions';
20
- import { IFluidDataStoreRegistry } from '@fluidframework/runtime-definitions';
21
- import { IFluidHandle } from '@fluidframework/core-interfaces';
22
- import { IFluidHandleContext } from '@fluidframework/core-interfaces';
23
- import { IFluidRouter } from '@fluidframework/core-interfaces';
24
- import { IGarbageCollectionData } from '@fluidframework/runtime-definitions';
25
- import { IIdCompressor } from '@fluidframework/runtime-definitions';
26
- import { IIdCompressorCore } from '@fluidframework/runtime-definitions';
27
- import { ILoader } from '@fluidframework/container-definitions';
28
- import { ILoaderOptions } from '@fluidframework/container-definitions';
29
- import { IProvideFluidHandleContext } from '@fluidframework/core-interfaces';
30
- import { IQuorumClients } from '@fluidframework/protocol-definitions';
31
- import { IRequest } from '@fluidframework/core-interfaces';
32
- import { IResponse } from '@fluidframework/core-interfaces';
33
- import { IRuntime } from '@fluidframework/container-definitions';
34
- import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
35
- import { ISignalMessage } from '@fluidframework/protocol-definitions';
36
- import { ISummaryAck } from '@fluidframework/protocol-definitions';
37
- import { ISummaryContent } from '@fluidframework/protocol-definitions';
38
- import { ISummaryNack } from '@fluidframework/protocol-definitions';
39
- import { ISummaryStats } from '@fluidframework/runtime-definitions';
40
- import { ISummaryTree } from '@fluidframework/protocol-definitions';
41
- import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
42
- import { ITelemetryContext } from '@fluidframework/runtime-definitions';
43
- import { ITelemetryLoggerExt } from '@fluidframework/telemetry-utils';
44
- import { MessageType } from '@fluidframework/protocol-definitions';
45
- import { NamedFluidDataStoreRegistryEntries } from '@fluidframework/runtime-definitions';
46
- import { StableId } from '@fluidframework/runtime-definitions';
47
-
48
- /**
49
- * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
50
- * special-case for document dirty state. Ultimately we should have no special-cases from the
51
- * ContainerRuntime's perspective.
52
- */
53
- export declare const agentSchedulerId = "_scheduler";
54
-
55
- /** [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring */
56
- export declare const AllowInactiveRequestHeaderKey = "allowInactive";
57
-
58
- /** True if a tombstoned object should be returned without erroring */
59
- export declare const AllowTombstoneRequestHeaderKey = "allowTombstone";
60
-
61
- /**
62
- * Asserts that the given string is a stable ID.
63
- */
64
- export declare function assertIsStableId(stableId: string): StableId;
65
-
66
- /* Excluded from this release type: CompatModeBehavior */
67
-
68
- /**
69
- * Available compression algorithms for op compression.
70
- */
71
- export declare enum CompressionAlgorithms {
72
- lz4 = "lz4"
73
- }
74
-
75
- export declare enum ContainerMessageType {
76
- FluidDataStoreOp = "component",
77
- Attach = "attach",
78
- ChunkedOp = "chunkedOp",
79
- BlobAttach = "blobAttach",
80
- Rejoin = "rejoin",
81
- Alias = "alias",
82
- /**
83
- * An op containing an IdRange of Ids allocated using the runtime's IdCompressor since
84
- * the last allocation op was sent.
85
- * See the [IdCompressor README](./id-compressor/README.md) for more details.
86
- */
87
- IdAllocation = "idAllocation"
88
- }
89
-
90
- /**
91
- * Represents the runtime of the container. Contains helper functions/state of the container.
92
- * It will define the store level mappings.
93
- */
94
- export declare class ContainerRuntime extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents> implements IContainerRuntime, IRuntime, ISummarizerRuntime, ISummarizerInternalsProvider, IProvideFluidHandleContext {
95
- private readonly registry;
96
- private readonly runtimeOptions;
97
- private readonly containerScope;
98
- readonly logger: ITelemetryLoggerExt;
99
- private readonly _storage;
100
- private readonly requestHandler?;
101
- private readonly summaryConfiguration;
102
- /**
103
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
104
- */
105
- get IFluidRouter(): this;
106
- /**
107
- * @deprecated - use loadRuntime instead.
108
- * Load the stores from a snapshot and returns the runtime.
109
- * @param context - Context of the container.
110
- * @param registryEntries - Mapping to the stores.
111
- * @param requestHandler - Request handlers for the container runtime
112
- * @param runtimeOptions - Additional options to be passed to the runtime
113
- * @param existing - (optional) When loading from an existing snapshot. Precedes context.existing if provided
114
- * @param containerRuntimeCtor - (optional) Constructor to use to create the ContainerRuntime instance. This
115
- * allows mixin classes to leverage this method to define their own async initializer.
116
- */
117
- static load(context: IContainerContext, registryEntries: NamedFluidDataStoreRegistryEntries, requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>, runtimeOptions?: IContainerRuntimeOptions, containerScope?: FluidObject, existing?: boolean, containerRuntimeCtor?: typeof ContainerRuntime): Promise<ContainerRuntime>;
118
- /**
119
- * Load the stores from a snapshot and returns the runtime.
120
- * @param params - An object housing the runtime properties:
121
- * - context - Context of the container.
122
- * - registryEntries - Mapping from data store types to their corresponding factories.
123
- * - existing - Pass 'true' if loading from an existing snapshot.
124
- * - requestHandler - (optional) Request handler for the request() method of the container runtime.
125
- * Only relevant for back-compat while we remove the request() method and move fully to entryPoint as the main pattern.
126
- * - runtimeOptions - Additional options to be passed to the runtime
127
- * - containerScope - runtime services provided with context
128
- * - containerRuntimeCtor - Constructor to use to create the ContainerRuntime instance.
129
- * This allows mixin classes to leverage this method to define their own async initializer.
130
- * - provideEntryPoint - Promise that resolves to an object which will act as entryPoint for the Container.
131
- * This object should provide all the functionality that the Container is expected to provide to the loader layer.
132
- */
133
- static loadRuntime(params: {
134
- context: IContainerContext;
135
- registryEntries: NamedFluidDataStoreRegistryEntries;
136
- existing: boolean;
137
- runtimeOptions?: IContainerRuntimeOptions;
138
- containerScope?: FluidObject;
139
- containerRuntimeCtor?: typeof ContainerRuntime;
140
- /** @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md */
141
- requestHandler?: (request: IRequest, runtime: IContainerRuntime) => Promise<IResponse>;
142
- provideEntryPoint: (containerRuntime: IContainerRuntime) => Promise<FluidObject>;
143
- }): Promise<ContainerRuntime>;
144
- readonly options: ILoaderOptions;
145
- private readonly _getClientId;
146
- get clientId(): string | undefined;
147
- readonly clientDetails: IClientDetails;
148
- get storage(): IDocumentStorageService;
149
- private readonly submitFn;
150
- /**
151
- * Although current IContainerContext guarantees submitBatchFn, it is not available on older loaders.
152
- */
153
- private readonly submitBatchFn;
154
- private readonly submitSummaryFn;
155
- private readonly submitSignalFn;
156
- readonly disposeFn: (error?: ICriticalContainerError) => void;
157
- readonly closeFn: (error?: ICriticalContainerError) => void;
158
- get flushMode(): FlushMode;
159
- get scope(): FluidObject;
160
- get IFluidDataStoreRegistry(): IFluidDataStoreRegistry;
161
- private readonly _getAttachState;
162
- get attachState(): AttachState;
163
- idCompressor: (IIdCompressor & IIdCompressorCore) | undefined;
164
- get IFluidHandleContext(): IFluidHandleContext;
165
- private readonly handleContext;
166
- /**
167
- * This is a proxy to the delta manager provided by the container context (innerDeltaManager). It restricts certain
168
- * accesses such as sets "read-only" mode for the summarizer client. This is the default delta manager that should
169
- * be used unless the innerDeltaManager is required.
170
- */
171
- readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
172
- /**
173
- * The delta manager provided by the container context. By default, using the default delta manager (proxy)
174
- * should be sufficient. This should be used only if necessary. For example, for validating and propagating connected
175
- * events which requires access to the actual real only info, this is needed.
176
- */
177
- private readonly innerDeltaManager;
178
- private readonly mc;
179
- private readonly summarizerClientElection?;
180
- /**
181
- * summaryManager will only be created if this client is permitted to spawn a summarizing client
182
- * It is created only by interactive client, i.e. summarizer client, as well as non-interactive bots
183
- * do not create it (see SummarizerClientElection.clientDetailsPermitElection() for details)
184
- */
185
- private readonly summaryManager?;
186
- private readonly summaryCollection;
187
- private readonly summarizerNode;
188
- private readonly maxConsecutiveReconnects;
189
- private readonly defaultMaxConsecutiveReconnects;
190
- private _orderSequentiallyCalls;
191
- private readonly _flushMode;
192
- private flushTaskExists;
193
- private _connected;
194
- private consecutiveReconnects;
195
- /**
196
- * Used to delay transition to "connected" state while we upload
197
- * attachment blobs that were added while disconnected
198
- */
199
- private delayConnectClientId?;
200
- private ensureNoDataModelChangesCalls;
201
- /**
202
- * Tracks the number of detected reentrant ops to report,
203
- * in order to self-throttle the telemetry events.
204
- *
205
- * This should be removed as part of ADO:2322
206
- */
207
- private opReentryCallsToReport;
208
- /**
209
- * Invokes the given callback and expects that no ops are submitted
210
- * until execution finishes. If an op is submitted, an error will be raised.
211
- *
212
- * Can be disabled by feature gate `Fluid.ContainerRuntime.DisableOpReentryCheck`
213
- *
214
- * @param callback - the callback to be invoked
215
- */
216
- ensureNoDataModelChanges<T>(callback: () => T): T;
217
- get connected(): boolean;
218
- /** clientId of parent (non-summarizing) container that owns summarizer container */
219
- get summarizerClientId(): string | undefined;
220
- private _disposed;
221
- get disposed(): boolean;
222
- private dirtyContainer;
223
- private emitDirtyDocumentEvent;
224
- private readonly enableOpReentryCheck;
225
- private readonly disableAttachReorder;
226
- private readonly closeSummarizerDelayMs;
227
- /**
228
- * If true, summary generated is validate before uploading it to the server. With single commit summaries,
229
- * summaries will be accepted once uploaded, so they should be validated before upload. However, this can
230
- * currently be controlled via a feature flag as its a new functionality.
231
- */
232
- private readonly validateSummaryBeforeUpload;
233
- private readonly defaultTelemetrySignalSampleCount;
234
- private readonly _perfSignalData;
235
- /**
236
- * Summarizer is responsible for coordinating when to send generate and send summaries.
237
- * It is the main entry point for summary work.
238
- * It is created only by summarizing container (i.e. one with clientType === "summarizer")
239
- */
240
- private readonly _summarizer?;
241
- private readonly scheduleManager;
242
- private readonly blobManager;
243
- private readonly pendingStateManager;
244
- private readonly outbox;
245
- private readonly garbageCollector;
246
- private readonly dataStores;
247
- private readonly remoteMessageProcessor;
248
- /** The last message processed at the time of the last summary. */
249
- private messageAtLastSummary;
250
- private get summarizer();
251
- private readonly summariesDisabled;
252
- private isSummariesDisabled;
253
- private readonly heuristicsDisabled;
254
- private isHeuristicsDisabled;
255
- private readonly maxOpsSinceLastSummary;
256
- private getMaxOpsSinceLastSummary;
257
- private readonly initialSummarizerDelayMs;
258
- private getInitialSummarizerDelayMs;
259
- private readonly createContainerMetadata;
260
- /**
261
- * The summary number of the next summary that will be generated for this container. This is incremented every time
262
- * a summary is generated.
263
- */
264
- private nextSummaryNumber;
265
- /**
266
- * If false, loading or using a Tombstoned object should merely log, not fail
267
- */
268
- readonly gcTombstoneEnforcementAllowed: boolean;
269
- /**
270
- * GUID to identify a document in telemetry
271
- * ! Note: should not be used for anything other than telemetry and is not considered a stable GUID
272
- */
273
- private readonly telemetryDocumentId;
274
- /**
275
- * If true, the runtime has access to an IdCompressor
276
- */
277
- private readonly idCompressorEnabled;
278
- /**
279
- * Whether this client is the summarizer client itself (type is summarizerClientType)
280
- */
281
- private readonly isSummarizerClient;
282
- /**
283
- * The id of the version used to initially load this runtime, or undefined if it's newly created.
284
- */
285
- private readonly loadedFromVersionId;
286
- /* Excluded from this release type: __constructor */
287
- /**
288
- * Initializes the state from the base snapshot this container runtime loaded from.
289
- */
290
- private initializeBaseState;
291
- dispose(error?: Error): void;
292
- /**
293
- * Notifies this object about the request made to the container.
294
- * @param request - Request made to the handler.
295
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
296
- */
297
- request(request: IRequest): Promise<IResponse>;
298
- /**
299
- * Resolves URI representing handle
300
- * @param request - Request made to the handler.
301
- */
302
- resolveHandle(request: IRequest): Promise<IResponse>;
303
- /**
304
- * {@inheritDoc @fluidframework/container-definitions#IRuntime.getEntryPoint}
305
- */
306
- getEntryPoint(): Promise<FluidObject>;
307
- private readonly entryPoint;
308
- private internalId;
309
- private getDataStoreFromRequest;
310
- /** Adds the container's metadata to the given summary tree. */
311
- private addMetadataToSummary;
312
- protected addContainerStateToSummary(summaryTree: ISummaryTreeWithStats, fullTree: boolean, trackState: boolean, telemetryContext?: ITelemetryContext): void;
313
- private shouldContinueReconnecting;
314
- private resetReconnectCount;
315
- private replayPendingStates;
316
- /**
317
- * Updates the runtime's IdCompressor with the stashed state present in the given op. This is a bit of a
318
- * hack and is unnecessarily expensive. As it stands, every locally stashed op (all ops that get stored in
319
- * the PendingStateManager) will store their serialized representation locally until ack'd. Upon receiving
320
- * this stashed state, the IdCompressor blindly deserializes to the stashed state and assumes the session.
321
- * Technically only the last stashed state is needed to do this correctly, but we would have to write some
322
- * more hacky code to modify the batch before it gets sent out.
323
- * @param content - An IdAllocationOp with "stashedState", which is a representation of un-ack'd local state.
324
- */
325
- private applyStashedIdAllocationOp;
326
- /**
327
- * Parse an op's type and actual content from given serialized content
328
- * ! Note: this format needs to be in-line with what is set in the "ContainerRuntime.submit(...)" method
329
- */
330
- private parseLocalOpContent;
331
- private applyStashedOp;
332
- setConnectionState(connected: boolean, clientId?: string): void;
333
- private setConnectionStateCore;
334
- notifyOpReplay(message: ISequencedDocumentMessage): Promise<void>;
335
- process(messageArg: ISequencedDocumentMessage, local: boolean): void;
336
- private _processedClientSequenceNumber;
337
- /**
338
- * Direct the message to the correct subsystem for processing, and implement other side effects
339
- */
340
- private processCore;
341
- /**
342
- * Assuming the given message is also a TypedContainerRuntimeMessage,
343
- * checks its type and dispatches the message to the appropriate handler in the runtime.
344
- * Throws a DataProcessingError if the message looks like but doesn't conform to a known TypedContainerRuntimeMessage type.
345
- */
346
- private validateAndProcessRuntimeMessage;
347
- /**
348
- * Emits the Signal event and update the perf signal data.
349
- * @param clientSignalSequenceNumber - is the client signal sequence number to be uploaded.
350
- */
351
- private sendSignalTelemetryEvent;
352
- processSignal(message: ISignalMessage, local: boolean): void;
353
- /**
354
- * Returns the runtime of the data store.
355
- * @param id - Id supplied during creating the data store.
356
- * @param wait - True if you want to wait for it.
357
- * @deprecated - Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
358
- */
359
- getRootDataStore(id: string, wait?: boolean): Promise<IFluidRouter>;
360
- private getRootDataStoreChannel;
361
- /**
362
- * Flush the pending ops manually.
363
- * This method is expected to be called at the end of a batch.
364
- */
365
- private flush;
366
- orderSequentially<T>(callback: () => T): T;
367
- /**
368
- * Returns the aliased data store's entryPoint, given the alias.
369
- * @param alias - The alias for the data store.
370
- * @returns The data store's entry point ({@link @fluidframework/core-interfaces#IFluidHandle}) if it exists and is aliased.
371
- * Returns undefined if no data store has been assigned the given alias.
372
- */
373
- getAliasedDataStoreEntryPoint(alias: string): Promise<IFluidHandle<FluidObject> | undefined>;
374
- createDetachedRootDataStore(pkg: Readonly<string[]>, rootDataStoreId: string): IFluidDataStoreContextDetached;
375
- createDetachedDataStore(pkg: Readonly<string[]>): IFluidDataStoreContextDetached;
376
- createDataStore(pkg: string | string[]): Promise<IDataStore>;
377
- /* Excluded from this release type: _createDataStoreWithProps */
378
- private canSendOps;
379
- /**
380
- * Are we in the middle of batching ops together?
381
- */
382
- private currentlyBatching;
383
- private readonly _quorum;
384
- getQuorum(): IQuorumClients;
385
- private readonly _audience;
386
- getAudience(): IAudience;
387
- /**
388
- * Returns true of container is dirty, i.e. there are some pending local changes that
389
- * either were not sent out to delta stream or were not yet acknowledged.
390
- */
391
- get isDirty(): boolean;
392
- private isContainerMessageDirtyable;
393
- private createNewSignalEnvelope;
394
- /**
395
- * Submits the signal to be sent to other clients.
396
- * @param type - Type of the signal.
397
- * @param content - Content of the signal.
398
- */
399
- submitSignal(type: string, content: any): void;
400
- submitDataStoreSignal(address: string, type: string, content: any): void;
401
- setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;
402
- /**
403
- * Create a summary. Used when attaching or serializing a detached container.
404
- *
405
- * @param blobRedirectTable - A table passed during the attach process. While detached, blob upload is supported
406
- * using IDs generated locally. After attach, these IDs cannot be used, so this table maps the old local IDs to the
407
- * new storage IDs so requests can be redirected.
408
- * @param telemetryContext - summary data passed through the layers for telemetry purposes
409
- */
410
- createSummary(blobRedirectTable?: Map<string, string>, telemetryContext?: ITelemetryContext): ISummaryTree;
411
- readonly getAbsoluteUrl: (relativeUrl: string) => Promise<string | undefined>;
412
- private summarizeInternal;
413
- /**
414
- * Returns a summary of the runtime at the current sequence number.
415
- */
416
- summarize(options: {
417
- /** True to generate the full tree with no handle reuse optimizations; defaults to false */
418
- fullTree?: boolean;
419
- /** True to track the state for this summary in the SummarizerNodes; defaults to true */
420
- trackState?: boolean;
421
- /** Logger to use for correlated summary events */
422
- summaryLogger?: ITelemetryLoggerExt;
423
- /** True to run garbage collection before summarizing; defaults to true */
424
- runGC?: boolean;
425
- /** True to generate full GC data */
426
- fullGC?: boolean;
427
- /** True to run GC sweep phase after the mark phase */
428
- runSweep?: boolean;
429
- }): Promise<ISummaryTreeWithStats>;
430
- /**
431
- * Before GC runs, called by the garbage collector to update any pending GC state. This is mainly used to notify
432
- * the garbage collector of references detected since the last GC run. Most references are notified immediately
433
- * but there can be some for which async operation is required (such as detecting new root data stores).
434
- * @see IGarbageCollectionRuntime.updateStateBeforeGC
435
- */
436
- updateStateBeforeGC(): Promise<void>;
437
- private getGCDataInternal;
438
- /**
439
- * Generates and returns the GC data for this container.
440
- * @param fullGC - true to bypass optimizations and force full generation of GC data.
441
- * @see IGarbageCollectionRuntime.getGCData
442
- */
443
- getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;
444
- /**
445
- * After GC has run, called to notify this container's nodes of routes that are used in it.
446
- * @param usedRoutes - The routes that are used in all nodes in this Container.
447
- * @see IGarbageCollectionRuntime.updateUsedRoutes
448
- */
449
- updateUsedRoutes(usedRoutes: string[]): void;
450
- /**
451
- * This is called to update objects whose routes are unused.
452
- * @param unusedRoutes - Data store and attachment blob routes that are unused in this Container.
453
- */
454
- updateUnusedRoutes(unusedRoutes: string[]): void;
455
- /**
456
- * @deprecated - Replaced by deleteSweepReadyNodes.
457
- */
458
- deleteUnusedNodes(unusedRoutes: string[]): string[];
459
- /**
460
- * After GC has run and identified nodes that are sweep ready, this is called to delete the sweep ready nodes.
461
- * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.
462
- * @returns The routes of nodes that were deleted.
463
- */
464
- deleteSweepReadyNodes(sweepReadyRoutes: string[]): string[];
465
- /**
466
- * This is called to update objects that are tombstones.
467
- * @param tombstonedRoutes - Data store and attachment blob routes that are tombstones in this Container.
468
- */
469
- updateTombstonedRoutes(tombstonedRoutes: string[]): void;
470
- /**
471
- * Returns a server generated referenced timestamp to be used to track unreferenced nodes by GC.
472
- */
473
- getCurrentReferenceTimestampMs(): number | undefined;
474
- /**
475
- * Returns the type of the GC node. Currently, there are nodes that belong to the root ("/"), data stores or
476
- * blob manager.
477
- */
478
- getNodeType(nodePath: string): GCNodeType;
479
- /**
480
- * Called by GC to retrieve the package path of the node with the given path. The node should belong to a
481
- * data store or an attachment blob.
482
- */
483
- getGCNodePackagePath(nodePath: string): Promise<readonly string[] | undefined>;
484
- /**
485
- * Returns whether a given path is for attachment blobs that are in the format - "/BlobManager.basePath/...".
486
- */
487
- private isBlobPath;
488
- /**
489
- * From a given list of routes, separate and return routes that belong to blob manager and data stores.
490
- * @param routes - A list of routes that can belong to data stores or blob manager.
491
- * @returns Two route lists - One that contains routes for blob manager and another one that contains routes
492
- * for data stores.
493
- */
494
- private getDataStoreAndBlobManagerRoutes;
495
- /**
496
- * Runs garbage collection and updates the reference / used state of the nodes in the container.
497
- * @returns the statistics of the garbage collection run; undefined if GC did not run.
498
- */
499
- collectGarbage(options: {
500
- /** Logger to use for logging GC events */
501
- logger?: ITelemetryLoggerExt;
502
- /** True to run GC sweep phase after the mark phase */
503
- runSweep?: boolean;
504
- /** True to generate full GC data */
505
- fullGC?: boolean;
506
- }, telemetryContext?: ITelemetryContext): Promise<IGCStats | undefined>;
507
- /**
508
- * Called when a new outbound reference is added to another node. This is used by garbage collection to identify
509
- * all references added in the system.
510
- * @param srcHandle - The handle of the node that added the reference.
511
- * @param outboundHandle - The handle of the outbound node that is referenced.
512
- */
513
- addedGCOutboundReference(srcHandle: IFluidHandle, outboundHandle: IFluidHandle): void;
514
- /**
515
- * Generates the summary tree, uploads it to storage, and then submits the summarize op.
516
- * This is intended to be called by the summarizer, since it is the implementation of
517
- * ISummarizerInternalsProvider.submitSummary.
518
- * It takes care of state management at the container level, including pausing inbound
519
- * op processing, updating SummarizerNode state tracking, and garbage collection.
520
- * @param options - options controlling how the summary is generated or submitted
521
- */
522
- submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
523
- /**
524
- * This helper is called during summarization. If there are pending ops, it will return a failed summarize result
525
- * (IBaseSummarizeResult) unless this is the final summarize attempt and SkipFailingIncorrectSummary option is set.
526
- * @param logger - The logger to be used for sending telemetry.
527
- * @param referenceSequenceNumber - The reference sequence number of the summary attempt.
528
- * @param minimumSequenceNumber - The minimum sequence number of the summary attempt.
529
- * @param finalAttempt - Whether this is the final summary attempt.
530
- * @param beforeSummaryGeneration - Whether this is called before summary generation or after.
531
- * @returns failed summarize result (IBaseSummarizeResult) if summary should be failed, undefined otherwise.
532
- */
533
- private shouldFailSummaryOnPendingOps;
534
- private get pendingMessagesCount();
535
- private hasPendingMessages;
536
- private updateDocumentDirtyState;
537
- submitDataStoreOp(id: string, contents: any, localOpMetadata?: unknown): void;
538
- submitDataStoreAliasOp(contents: any, localOpMetadata: unknown): void;
539
- uploadBlob(blob: ArrayBufferLike, signal?: AbortSignal): Promise<IFluidHandle<ArrayBufferLike>>;
540
- private maybeSubmitIdAllocationOp;
541
- private submit;
542
- private scheduleFlush;
543
- private submitSummaryMessage;
544
- /**
545
- * Throw an error if the runtime is closed. Methods that are expected to potentially
546
- * be called after dispose due to asynchrony should not call this.
547
- */
548
- private verifyNotClosed;
549
- private verifyCanSubmitOps;
550
- private reSubmitBatch;
551
- private reSubmit;
552
- /**
553
- * Finds the right store and asks it to resubmit the message. This typically happens when we
554
- * reconnect and there are pending messages.
555
- * @param message - The original LocalContainerRuntimeMessage.
556
- * @param localOpMetadata - The local metadata associated with the original message.
557
- */
558
- private reSubmitCore;
559
- private rollback;
560
- /** Implementation of ISummarizerInternalsProvider.refreshLatestSummaryAck */
561
- refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
562
- /**
563
- * Fetches the latest snapshot from storage to refresh the cache as a performance optimization and closes the
564
- * summarizer to reload from new state.
565
- * @param summaryLogger - logger to use when fetching snapshot from storage
566
- * @returns a generic summarization error
567
- */
568
- private prefetchLatestSummaryThenClose;
569
- private closeStaleSummarizer;
570
- /**
571
- * Downloads snapshot from storage with the given versionId or latest if versionId is null.
572
- * By default, it also closes the container after downloading the snapshot. However, this may be
573
- * overridden via options.
574
- */
575
- private fetchSnapshotFromStorage;
576
- notifyAttaching(): void;
577
- getPendingLocalState(props?: {
578
- notifyImminentClosure: boolean;
579
- }): Promise<unknown>;
580
- summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
581
- enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
582
- /**
583
- * Forms a function that will create and retrieve a Summarizer.
584
- */
585
- private formCreateSummarizerFn;
586
- private validateSummaryHeuristicConfiguration;
587
- private get groupedBatchingEnabled();
588
- }
589
-
590
- /* Excluded from this release type: ContainerRuntimeMessage */
591
-
592
- export declare const DefaultSummaryConfiguration: ISummaryConfiguration;
593
-
594
- export declare type EnqueueSummarizeResult = (ISummarizeResults & {
595
- /**
596
- * Indicates that another summarize attempt is not already enqueued,
597
- * and this attempt has been enqueued.
598
- */
599
- readonly alreadyEnqueued?: undefined;
600
- }) | (ISummarizeResults & {
601
- /** Indicates that another summarize attempt was already enqueued. */
602
- readonly alreadyEnqueued: true;
603
- /**
604
- * Indicates that the other enqueued summarize attempt was abandoned,
605
- * and this attempt has been enqueued enqueued.
606
- */
607
- readonly overridden: true;
608
- }) | {
609
- /** Indicates that another summarize attempt was already enqueued. */
610
- readonly alreadyEnqueued: true;
611
- /**
612
- * Indicates that the other enqueued summarize attempt remains enqueued,
613
- * and this attempt has not been enqueued.
614
- */
615
- readonly overridden?: undefined;
616
- };
617
-
618
- export declare class FluidDataStoreRegistry implements IFluidDataStoreRegistry {
619
- private readonly map;
620
- get IFluidDataStoreRegistry(): this;
621
- constructor(namedEntries: NamedFluidDataStoreRegistryEntries);
622
- get(name: string): Promise<FluidDataStoreRegistryEntry | undefined>;
623
- }
624
-
625
- /** @see IGCMetadata.gcFeatureMatrix */
626
- declare interface GCFeatureMatrix {
627
- /**
628
- * The Tombstone Generation value in effect when this file was created.
629
- * Gives a way for an app to disqualify old files from GC Tombstone enforcement.
630
- * Provided via Container Runtime Options.
631
- */
632
- tombstoneGeneration?: number;
633
- /**
634
- * The Sweep Generation value in effect when this file was created.
635
- * Gives a way for an app to disqualify old files from GC Sweep.
636
- * Provided via Container Runtime Options.
637
- */
638
- sweepGeneration?: number;
639
- }
640
-
641
- /** The types of GC nodes in the GC reference graph. */
642
- declare const GCNodeType: {
643
- DataStore: string;
644
- SubDataStore: string;
645
- Blob: string;
646
- Other: string;
647
- };
648
-
649
- declare type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
650
-
651
- declare type GCVersion = number;
652
-
653
- /**
654
- * Generate a random stable ID
655
- */
656
- export declare function generateStableId(): StableId;
657
-
658
- /**
659
- * A single summary which has already been acked by the server.
660
- */
661
- export declare interface IAckedSummary {
662
- readonly summaryOp: ISummaryOpMessage;
663
- readonly summaryAck: ISummaryAckMessage;
664
- }
665
-
666
- export declare interface IAckSummaryResult {
667
- readonly summaryAckOp: ISummaryAckMessage;
668
- readonly ackNackDuration: number;
669
- }
670
-
671
- /** Base results for all submitSummary attempts. */
672
- export declare interface IBaseSummarizeResult {
673
- readonly stage: "base";
674
- /** Error object related to failed summarize attempt. */
675
- readonly error: any;
676
- /** Reference sequence number as of the generate summary attempt. */
677
- readonly referenceSequenceNumber: number;
678
- readonly minimumSequenceNumber: number;
679
- }
680
-
681
- /**
682
- * Information from a snapshot needed to load BlobManager
683
- */
684
- declare interface IBlobManagerLoadInfo {
685
- ids?: string[];
686
- redirectTable?: [string, string][];
687
- }
688
-
689
- export declare interface IBroadcastSummaryResult {
690
- readonly summarizeOp: ISummaryOpMessage;
691
- readonly broadcastDuration: number;
692
- }
693
-
694
- export declare interface ICancellableSummarizerController extends ISummaryCancellationToken {
695
- stop(reason: SummarizerStopReason): void;
696
- }
697
-
698
- /**
699
- * Similar to AbortSignal, but using promise instead of events
700
- * @param T - cancellation reason type
701
- */
702
- export declare interface ICancellationToken<T> {
703
- /** Tells if this cancellable token is cancelled */
704
- readonly cancelled: boolean;
705
- /**
706
- * Promise that gets fulfilled when this cancellable token is cancelled
707
- * @returns reason of cancellation
708
- */
709
- readonly waitCancelled: Promise<T>;
710
- }
711
-
712
- export declare interface IChunkedOp {
713
- chunkId: number;
714
- totalChunks: number;
715
- contents: string;
716
- originalType: MessageType | ContainerMessageType;
717
- originalMetadata?: Record<string, unknown>;
718
- originalCompression?: string;
719
- }
720
-
721
- /**
722
- * Watches summaries created by a specific client.
723
- */
724
- export declare interface IClientSummaryWatcher extends IDisposable {
725
- watchSummary(clientSequenceNumber: number): ISummary;
726
- waitFlushed(): Promise<IAckedSummary | undefined>;
727
- }
728
-
729
- /**
730
- * Options for op compression.
731
- */
732
- export declare interface ICompressionRuntimeOptions {
733
- /**
734
- * The value the batch's content size must exceed for the batch to be compressed.
735
- * By default the value is 600 * 1024 = 614400 bytes. If the value is set to `Infinity`, compression will be disabled.
736
- */
737
- readonly minimumBatchSizeInBytes: number;
738
- /**
739
- * The compression algorithm that will be used to compress the op.
740
- * By default the value is `lz4` which is the only compression algorithm currently supported.
741
- */
742
- readonly compressionAlgorithm: CompressionAlgorithms;
743
- }
744
-
745
- export declare interface IConnectableRuntime {
746
- readonly disposed: boolean;
747
- readonly connected: boolean;
748
- readonly clientId: string | undefined;
749
- once(event: "connected" | "disconnected" | "dispose", listener: () => void): this;
750
- }
751
-
752
- /* Excluded from this release type: IContainerRuntimeMessageCompatDetails */
753
-
754
- declare interface IContainerRuntimeMetadata extends ICreateContainerMetadata, IGCMetadata {
755
- readonly summaryFormatVersion: 1;
756
- /** The last message processed at the time of summary. Only primitive property types are added to the summary. */
757
- readonly message: ISummaryMetadataMessage | undefined;
758
- /** True if channels are not isolated in .channels subtrees, otherwise isolated. */
759
- readonly disableIsolatedChannels?: true;
760
- /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */
761
- readonly summaryNumber?: number;
762
- /** GUID to identify a document in telemetry */
763
- readonly telemetryDocumentId?: string;
764
- /** True if the runtime IdCompressor is enabled */
765
- readonly idCompressorEnabled?: boolean;
766
- }
767
-
768
- /**
769
- * Options for container runtime.
770
- */
771
- export declare interface IContainerRuntimeOptions {
772
- readonly summaryOptions?: ISummaryRuntimeOptions;
773
- readonly gcOptions?: IGCRuntimeOptions;
774
- /**
775
- * Affects the behavior while loading the runtime when the data verification check which
776
- * compares the DeltaManager sequence number (obtained from protocol in summary) to the
777
- * runtime sequence number (obtained from runtime metadata in summary) finds a mismatch.
778
- * 1. "close" (default) will close the container with an assertion.
779
- * 2. "log" will log an error event to telemetry, but still continue to load.
780
- * 3. "bypass" will skip the check entirely. This is not recommended.
781
- */
782
- readonly loadSequenceNumberVerification?: "close" | "log" | "bypass";
783
- /**
784
- * Sets the flush mode for the runtime. In Immediate flush mode the runtime will immediately
785
- * send all operations to the driver layer, while in TurnBased the operations will be buffered
786
- * and then sent them as a single batch at the end of the turn.
787
- * By default, flush mode is TurnBased.
788
- */
789
- readonly flushMode?: FlushMode;
790
- /**
791
- * Enables the runtime to compress ops. See {@link ICompressionRuntimeOptions}.
792
- */
793
- readonly compressionOptions?: ICompressionRuntimeOptions;
794
- /**
795
- * If specified, when in FlushMode.TurnBased, if the size of the ops between JS turns exceeds this value,
796
- * an error will be thrown and the container will close.
797
- *
798
- * If unspecified, the limit is 950 * 1024.
799
- *
800
- * 'Infinity' will disable any limit.
801
- *
802
- * @experimental This config should be driven by the connection with the service and will be moved in the future.
803
- */
804
- readonly maxBatchSizeInBytes?: number;
805
- /**
806
- * If the op payload needs to be chunked in order to work around the maximum size of the batch, this value represents
807
- * how large the individual chunks will be. This is only supported when compression is enabled. If after compression, the
808
- * batch content size exceeds this value, it will be chunked into smaller ops of this exact size.
809
- *
810
- * This value is a trade-off between having many small chunks vs fewer larger chunks and by default, the runtime is configured to use
811
- * 200 * 1024 = 204800 bytes. This default value ensures that no compressed payload's content is able to exceed {@link IContainerRuntimeOptions.maxBatchSizeInBytes}
812
- * regardless of the overhead of an individual op.
813
- *
814
- * Any value of `chunkSizeInBytes` exceeding {@link IContainerRuntimeOptions.maxBatchSizeInBytes} will disable this feature, therefore if a compressed batch's content
815
- * size exceeds {@link IContainerRuntimeOptions.maxBatchSizeInBytes} after compression, the container will close with an instance of `GenericError` with
816
- * the `BatchTooLarge` message.
817
- */
818
- readonly chunkSizeInBytes?: number;
819
- /**
820
- * Enable the IdCompressor in the runtime.
821
- * @experimental Not ready for use.
822
- */
823
- readonly enableRuntimeIdCompressor?: boolean;
824
- /**
825
- * If enabled, the runtime will block all attempts to send an op inside the
826
- * {@link ContainerRuntime#ensureNoDataModelChanges} callback. The callback is used by
827
- * {@link @fluidframework/shared-object-base#SharedObjectCore} for event handlers so enabling this
828
- * will disallow modifying DDSes while handling DDS events.
829
- *
830
- * By default, the feature is disabled. If enabled from options, the `Fluid.ContainerRuntime.DisableOpReentryCheck`
831
- * can be used to disable it at runtime.
832
- */
833
- readonly enableOpReentryCheck?: boolean;
834
- /**
835
- * If enabled, the runtime will group messages within a batch into a single
836
- * message to be sent to the service.
837
- * The grouping an ungrouping of such messages is handled by the "OpGroupingManager".
838
- *
839
- * By default, the feature is disabled. If enabled from options, the `Fluid.ContainerRuntime.DisableGroupedBatching`
840
- * flag can be used to disable it at runtime.
841
- *
842
- * @experimental Not ready for use.
843
- */
844
- readonly enableGroupedBatching?: boolean;
845
- }
846
-
847
- declare interface ICreateContainerMetadata {
848
- /** Runtime version of the container when it was first created */
849
- createContainerRuntimeVersion?: string;
850
- /** Timestamp of the container when it was first created */
851
- createContainerTimestamp?: number;
852
- }
853
-
854
- /** Options to use when enqueueing a summarize attempt. */
855
- export declare interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {
856
- /** If specified, The summarize attempt will not occur until after this sequence number. */
857
- readonly afterSequenceNumber?: number;
858
- /**
859
- * True to override the existing enqueued summarize attempt if there is one.
860
- * This will guarantee that this attempt gets enqueued. If override is false,
861
- * than an existing enqueued summarize attempt will block a new one from being
862
- * enqueued. There can only be one enqueued at a time. Defaults to false.
863
- */
864
- readonly override?: boolean;
865
- }
866
-
867
- declare interface IGCMetadata {
868
- /**
869
- * The version of the GC code that was run to generate the GC data that is written in the summary.
870
- * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.
871
- * Also, used to determine whether GC is enabled for this container or not:
872
- * - A value of 0 or undefined means GC is disabled.
873
- * - A value greater than 0 means GC is enabled.
874
- */
875
- readonly gcFeature?: GCVersion;
876
- /**
877
- * A collection of different numerical "Generations" for different features,
878
- * used to determine feature availability over time.
879
- * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),
880
- * and pertains to aspects of the document that may be fixed for its lifetime.
881
- *
882
- * For each dimension, if the persisted value doesn't match the currently provided value,
883
- * then this file does not support the corresponding feature as currently implemented.
884
- *
885
- * Guidance is that if no value is provided at runtime, it should result in the current default behavior.
886
- */
887
- readonly gcFeatureMatrix?: GCFeatureMatrix;
888
- /**
889
- * @deprecated - @see GCFeatureMatrix.sweepGeneration
890
- *
891
- * Tells whether the GC sweep phase is enabled for this container.
892
- * - True means sweep phase is enabled.
893
- * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.
894
- */
895
- readonly sweepEnabled?: boolean;
896
- /** If this is present, the session for this container will expire after this time and the container will close */
897
- readonly sessionExpiryTimeoutMs?: number;
898
- /** How long to wait after an object is unreferenced before deleting it via GC Sweep */
899
- readonly sweepTimeoutMs?: number;
900
- }
901
-
902
- export declare interface IGCRuntimeOptions {
903
- /**
904
- * Flag that if true, will enable running garbage collection (GC) for a new container.
905
- *
906
- * GC has mark phase and sweep phase. In mark phase, unreferenced objects are identified
907
- * and marked as such in the summary. This option enables the mark phase.
908
- * In sweep phase, unreferenced objects are eventually deleted from the container if they meet certain conditions.
909
- * Sweep phase can be enabled using the "gcSweepGeneration" option.
910
- *
911
- * Note: This setting is persisted in the container's summary and cannot be changed.
912
- */
913
- gcAllowed?: boolean;
914
- /**
915
- * Flag that if true, will disable garbage collection for the session.
916
- * Can be used to disable running GC on containers where it is allowed via the gcAllowed option.
917
- */
918
- disableGC?: boolean;
919
- /**
920
- * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node
921
- * changed or not.
922
- */
923
- runFullGC?: boolean;
924
- /**
925
- * Maximum session duration for a new container. If not present, a default value will be used.
926
- *
927
- * Note: This setting is persisted in the container's summary and cannot be changed.
928
- */
929
- sessionExpiryTimeoutMs?: number;
930
- /**
931
- * Allows additional GC options to be passed.
932
- */
933
- [key: string]: any;
934
- }
935
-
936
- /** The statistics of the system state after a garbage collection run. */
937
- export declare interface IGCStats {
938
- /** The number of nodes in the container. */
939
- nodeCount: number;
940
- /** The number of data stores in the container. */
941
- dataStoreCount: number;
942
- /** The number of attachment blobs in the container. */
943
- attachmentBlobCount: number;
944
- /** The number of unreferenced nodes in the container. */
945
- unrefNodeCount: number;
946
- /** The number of unreferenced data stores in the container. */
947
- unrefDataStoreCount: number;
948
- /** The number of unreferenced attachment blobs in the container. */
949
- unrefAttachmentBlobCount: number;
950
- /** The number of nodes whose reference state updated since last GC run. */
951
- updatedNodeCount: number;
952
- /** The number of data stores whose reference state updated since last GC run. */
953
- updatedDataStoreCount: number;
954
- /** The number of attachment blobs whose reference state updated since last GC run. */
955
- updatedAttachmentBlobCount: number;
956
- }
957
-
958
- /**
959
- * In addition to the normal summary tree + stats, this contains additional stats
960
- * only relevant at the root of the tree.
961
- */
962
- export declare interface IGeneratedSummaryStats extends ISummaryStats {
963
- /** The total number of data stores in the container. */
964
- readonly dataStoreCount: number;
965
- /** The number of data stores that were summarized in this summary. */
966
- readonly summarizedDataStoreCount: number;
967
- /** The number of data stores whose GC reference state was updated in this summary. */
968
- readonly gcStateUpdatedDataStoreCount?: number;
969
- /** The size of the gc blobs in this summary. */
970
- readonly gcTotalBlobsSize?: number;
971
- /** The number of gc blobs in this summary. */
972
- readonly gcBlobNodeCount?: number;
973
- /** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */
974
- readonly summaryNumber: number;
975
- }
976
-
977
- /** Results of submitSummary after generating the summary tree. */
978
- export declare interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, "stage"> {
979
- readonly stage: "generate";
980
- /** Generated summary tree. */
981
- readonly summaryTree: ISummaryTree;
982
- /** Stats for generated summary tree. */
983
- readonly summaryStats: IGeneratedSummaryStats;
984
- /** Time it took to generate the summary tree and stats. */
985
- readonly generateDuration: number;
986
- /** True if the full tree regeneration with no handle reuse optimizations was forced. */
987
- readonly forcedFullTree: boolean;
988
- }
989
-
990
- export declare interface INackSummaryResult extends IRetriableFailureResult {
991
- readonly summaryNackOp: ISummaryNackMessage;
992
- readonly ackNackDuration: number;
993
- }
994
-
995
- /** Inactive error responses will have this header set to true */
996
- export declare const InactiveResponseHeaderKey = "isInactive";
997
-
998
- export declare interface IOnDemandSummarizeOptions extends ISummarizeOptions {
999
- /** Reason for generating summary. */
1000
- readonly reason: string;
1001
- }
1002
-
1003
- /**
1004
- * Data required to update internal tracking state after receiving a Summary Ack.
1005
- */
1006
- export declare interface IRefreshSummaryAckOptions {
1007
- /** Handle from the ack's summary op. */
1008
- readonly proposalHandle: string | undefined;
1009
- /** Handle from the summary ack just received */
1010
- readonly ackHandle: string;
1011
- /** Reference sequence number from the ack's summary op */
1012
- readonly summaryRefSeq: number;
1013
- /** Telemetry logger to which telemetry events will be forwarded. */
1014
- readonly summaryLogger: ITelemetryLoggerExt;
1015
- }
1016
-
1017
- /** Type for summarization failures that are retriable. */
1018
- export declare interface IRetriableFailureResult {
1019
- readonly retryAfterSeconds?: number;
1020
- }
1021
-
1022
- /** Serialized state of IOrderedClientElection. */
1023
- declare interface ISerializedElection {
1024
- /** Sequence number at the time of the latest election. */
1025
- readonly electionSequenceNumber: number;
1026
- /**
1027
- * Most recently elected client id. This is either:
1028
- *
1029
- * 1. the interactive elected parent client, in which case electedClientId === electedParentId,
1030
- * and the SummaryManager on the elected client will spawn a summarizer client, or
1031
- *
1032
- * 2. the non-interactive summarizer client itself.
1033
- */
1034
- readonly electedClientId: string | undefined;
1035
- /** Most recently elected parent client id. This is always an interactive client. */
1036
- readonly electedParentId: string | undefined;
1037
- }
1038
-
1039
- /**
1040
- * @deprecated - please use version in driver-utils
1041
- */
1042
- export declare function isRuntimeMessage(message: ISequencedDocumentMessage): boolean;
1043
-
1044
- /**
1045
- * Returns true iff the given string is a valid Version 4, variant 2 UUID
1046
- * 'xxxxxxxx-xxxx-4xxx-vxxx-xxxxxxxxxxxx'
1047
- */
1048
- export declare function isStableId(str: string): str is StableId;
1049
-
1050
- /** Results of submitSummary after submitting the summarize op. */
1051
- export declare interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, "stage" | "error"> {
1052
- readonly stage: "submit";
1053
- /** The client sequence number of the summarize op submitted for the summary. */
1054
- readonly clientSequenceNumber: number;
1055
- /** Time it took to submit the summarize op to the broadcasting service. */
1056
- readonly submitOpDuration: number;
1057
- }
1058
-
1059
- export declare interface ISubmitSummaryOptions extends ISummarizeOptions {
1060
- /** Logger to use for correlated summary events */
1061
- readonly summaryLogger: ITelemetryLoggerExt;
1062
- /** Tells when summary process should be cancelled */
1063
- readonly cancellationToken: ISummaryCancellationToken;
1064
- /** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt. */
1065
- readonly finalAttempt?: boolean;
1066
- }
1067
-
1068
- export declare interface ISummarizeEventProps {
1069
- result: "success" | "failure" | "canceled";
1070
- currentAttempt: number;
1071
- maxAttempts: number;
1072
- error?: any;
1073
- }
1074
-
1075
- /** Options affecting summarize behavior. */
1076
- export declare interface ISummarizeOptions {
1077
- /** True to generate the full tree with no handle reuse optimizations; defaults to false */
1078
- readonly fullTree?: boolean;
1079
- /**
1080
- * True to ask the server what the latest summary is first; defaults to false
1081
- *
1082
- * @deprecated - Summarize will not refresh latest snapshot state anymore. Instead it updates the cache and closes
1083
- * It's expected a new summarizer client will be created, likely by the same parent.
1084
- */
1085
- readonly refreshLatestAck?: boolean;
1086
- }
1087
-
1088
- export declare interface ISummarizer extends IEventProvider<ISummarizerEvents> {
1089
- /**
1090
- * Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern.
1091
- */
1092
- readonly ISummarizer?: ISummarizer;
1093
- stop(reason: SummarizerStopReason): void;
1094
- close(): void;
1095
- run(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;
1096
- /**
1097
- * Attempts to generate a summary on demand. If already running, takes no action.
1098
- * @param options - options controlling the summarize attempt
1099
- * @returns an alreadyRunning promise if a summarize attempt is already in progress,
1100
- * which will resolve when the current attempt completes. At that point caller can
1101
- * decide to try again or not. Otherwise, it will return an object containing promises
1102
- * that resolve as the summarize attempt progresses. They will resolve with success
1103
- * false if a failure is encountered.
1104
- */
1105
- summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
1106
- /**
1107
- * Enqueue an attempt to summarize after the specified sequence number.
1108
- * If afterSequenceNumber is provided, the summarize attempt is "enqueued"
1109
- * to run once an eligible op comes in with sequenceNumber \>= afterSequenceNumber.
1110
- * @param options - options controlling the summarize attempt
1111
- * @returns an object containing an alreadyEnqueued flag to indicate if another
1112
- * summarize attempt has already been enqueued. It also may contain an overridden flag
1113
- * when alreadyEnqueued is true, that indicates whether this attempt forced the
1114
- * previous attempt to abort. If this attempt becomes enqueued, it returns an object
1115
- * containing promises that resolve as the summarize attempt progresses. They will
1116
- * resolve with success false if a failure is encountered.
1117
- */
1118
- enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
1119
- }
1120
-
1121
- export declare interface ISummarizeResults {
1122
- /** Resolves when we generate, upload, and submit the summary. */
1123
- readonly summarySubmitted: Promise<SummarizeResultPart<SubmitSummaryResult, SubmitSummaryFailureData>>;
1124
- /** Resolves when we observe our summarize op broadcast. */
1125
- readonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;
1126
- /** Resolves when we receive a summaryAck or summaryNack. */
1127
- readonly receivedSummaryAckOrNack: Promise<SummarizeResultPart<IAckSummaryResult, INackSummaryResult>>;
1128
- }
1129
-
1130
- export declare interface ISummarizerEvents extends IEvent {
1131
- (event: "summarize", listener: (props: ISummarizeEventProps) => void): any;
1132
- }
1133
-
1134
- export declare interface ISummarizerInternalsProvider {
1135
- /** Encapsulates the work to walk the internals of the running container to generate a summary */
1136
- submitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;
1137
- /** Callback whenever a new SummaryAck is received, to update internal tracking state */
1138
- refreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;
1139
- }
1140
-
1141
- export declare interface ISummarizerRuntime extends IConnectableRuntime {
1142
- readonly logger: ITelemetryLoggerExt;
1143
- /** clientId of parent (non-summarizing) container that owns summarizer container */
1144
- readonly summarizerClientId: string | undefined;
1145
- readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;
1146
- disposeFn(): void;
1147
- closeFn(): void;
1148
- on(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): this;
1149
- off(event: "op", listener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void): this;
1150
- }
1151
-
1152
- export declare interface ISummarizingWarning extends ContainerWarning {
1153
- readonly errorType: "summarizingError";
1154
- readonly logged: boolean;
1155
- }
1156
-
1157
- /**
1158
- * A single summary which can be tracked as it goes through its life cycle.
1159
- * The life cycle is: Local to Broadcast to Acked/Nacked.
1160
- */
1161
- export declare interface ISummary {
1162
- readonly clientId: string;
1163
- readonly clientSequenceNumber: number;
1164
- waitBroadcast(): Promise<ISummaryOpMessage>;
1165
- waitAckNack(): Promise<ISummaryAckMessage | ISummaryNackMessage>;
1166
- }
1167
-
1168
- /**
1169
- * Interface for summary ack messages with typed contents.
1170
- */
1171
- export declare interface ISummaryAckMessage extends ISequencedDocumentMessage {
1172
- type: MessageType.SummaryAck;
1173
- contents: ISummaryAck;
1174
- }
1175
-
1176
- export declare interface ISummaryBaseConfiguration {
1177
- /**
1178
- * Delay before first attempt to spawn summarizing container.
1179
- */
1180
- initialSummarizerDelayMs: number;
1181
- /**
1182
- * Defines the maximum allowed time to wait for a pending summary ack.
1183
- * The maximum amount of time client will wait for a summarize is the minimum of
1184
- * maxSummarizeAckWaitTime (currently 3 * 60 * 1000) and maxAckWaitTime.
1185
- */
1186
- maxAckWaitTime: number;
1187
- /**
1188
- * Defines the maximum number of Ops in between Summaries that can be
1189
- * allowed before forcibly electing a new summarizer client.
1190
- */
1191
- maxOpsSinceLastSummary: number;
1192
- }
1193
-
1194
- export declare type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;
1195
-
1196
- export declare interface ISummaryCollectionOpEvents extends IEvent {
1197
- (event: OpActionEventName, listener: OpActionEventListener): any;
1198
- }
1199
-
1200
- export declare type ISummaryConfiguration = ISummaryConfigurationDisableSummarizer | ISummaryConfigurationDisableHeuristics | ISummaryConfigurationHeuristics;
1201
-
1202
- export declare interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
1203
- state: "disableHeuristics";
1204
- }
1205
-
1206
- export declare interface ISummaryConfigurationDisableSummarizer {
1207
- state: "disabled";
1208
- }
1209
-
1210
- export declare interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
1211
- state: "enabled";
1212
- /**
1213
- * Defines the maximum allowed time, since the last received Ack, before running the summary
1214
- * with reason maxTime.
1215
- * For example, say we receive ops one by one just before the idle time is triggered.
1216
- * In this case, we still want to run a summary since it's been a while since the last summary.
1217
- */
1218
- maxTime: number;
1219
- /**
1220
- * Defines the maximum number of Ops, since the last received Ack, that can be allowed
1221
- * before running the summary with reason maxOps.
1222
- */
1223
- maxOps: number;
1224
- /**
1225
- * Defines the minimum number of Ops, since the last received Ack, that can be allowed
1226
- * before running the last summary.
1227
- */
1228
- minOpsForLastSummaryAttempt: number;
1229
- /**
1230
- * Defines the lower boundary for the allowed time in between summarizations.
1231
- * Pairs with maxIdleTime to form a range.
1232
- * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.
1233
- * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change
1234
- * linearly depending on the number of ops we receive.
1235
- */
1236
- minIdleTime: number;
1237
- /**
1238
- * Defines the upper boundary for the allowed time in between summarizations.
1239
- * Pairs with minIdleTime to form a range.
1240
- * For example, if we only receive 1 op, we don't want to have the same idle time as say 100 ops.
1241
- * Based on the boundaries we set in minIdleTime and maxIdleTime, the idle time will change
1242
- * linearly depending on the number of ops we receive.
1243
- */
1244
- maxIdleTime: number;
1245
- /**
1246
- * Runtime op weight to use in heuristic summarizing.
1247
- * This number is a multiplier on the number of runtime ops we process when running summarize heuristics.
1248
- * For example: (multiplier) * (number of runtime ops) = weighted number of runtime ops
1249
- */
1250
- runtimeOpWeight: number;
1251
- /**
1252
- * Non-runtime op weight to use in heuristic summarizing
1253
- * This number is a multiplier on the number of non-runtime ops we process when running summarize heuristics.
1254
- * For example: (multiplier) * (number of non-runtime ops) = weighted number of non-runtime ops
1255
- */
1256
- nonRuntimeOpWeight: number;
1257
- /**
1258
- * Number of ops since last summary needed before a non-runtime op can trigger running summary heuristics.
1259
- *
1260
- * Note: Any runtime ops sent before the threshold is reached will trigger heuristics normally.
1261
- * This threshold ONLY applies to non-runtime ops triggering summaries.
1262
- *
1263
- * For example: Say the threshold is 20. Sending 19 non-runtime ops will not trigger any heuristic checks.
1264
- * Sending the 20th non-runtime op will trigger the heuristic checks for summarizing.
1265
- */
1266
- nonRuntimeHeuristicThreshold?: number;
1267
- }
1268
-
1269
- /** The properties of an ISequencedDocumentMessage to be stored in the metadata blob in summary. */
1270
- declare type ISummaryMetadataMessage = Pick<ISequencedDocumentMessage, "clientId" | "clientSequenceNumber" | "minimumSequenceNumber" | "referenceSequenceNumber" | "sequenceNumber" | "timestamp" | "type">;
1271
-
1272
- /**
1273
- * Interface for summary nack messages with typed contents.
1274
- */
1275
- export declare interface ISummaryNackMessage extends ISequencedDocumentMessage {
1276
- type: MessageType.SummaryNack;
1277
- contents: ISummaryNack;
1278
- }
1279
-
1280
- /**
1281
- * Interface for summary op messages with typed contents.
1282
- */
1283
- export declare interface ISummaryOpMessage extends ISequencedDocumentMessage {
1284
- type: MessageType.Summarize;
1285
- contents: ISummaryContent;
1286
- }
1287
-
1288
- export declare interface ISummaryRuntimeOptions {
1289
- /** Override summary configurations set by the server. */
1290
- summaryConfigOverrides?: ISummaryConfiguration;
1291
- /**
1292
- * Delay before first attempt to spawn summarizing container.
1293
- *
1294
- * @deprecated Use {@link ISummaryRuntimeOptions.summaryConfigOverrides}'s
1295
- * {@link ISummaryBaseConfiguration.initialSummarizerDelayMs} instead.
1296
- */
1297
- initialSummarizerDelayMs?: number;
1298
- }
1299
-
1300
- /** Results of submitSummary after uploading the tree to storage. */
1301
- export declare interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, "stage"> {
1302
- readonly stage: "upload";
1303
- /** The handle returned by storage pointing to the uploaded summary tree. */
1304
- readonly handle: string;
1305
- /** Time it took to upload the summary tree to storage. */
1306
- readonly uploadDuration: number;
1307
- }
1308
-
1309
- /**
1310
- * Can be useful in testing as well as in places where caller does not use cancellation.
1311
- * This object implements ISummaryCancellationToken interface but cancellation is never leveraged.
1312
- */
1313
- export declare const neverCancelledSummaryToken: ISummaryCancellationToken;
1314
-
1315
- export declare type OpActionEventListener = (op: ISequencedDocumentMessage) => void;
1316
-
1317
- export declare type OpActionEventName = MessageType.Summarize | MessageType.SummaryAck | MessageType.SummaryNack | "default";
1318
-
1319
- /* Excluded from this release type: RecentlyAddedContainerRuntimeMessageDetails */
1320
-
1321
- /**
1322
- * Accepted header keys for requests coming to the runtime.
1323
- */
1324
- export declare enum RuntimeHeaders {
1325
- /** True to wait for a data store to be created and loaded before returning it. */
1326
- wait = "wait",
1327
- /** True if the request is coming from an IFluidHandle. */
1328
- viaHandle = "viaHandle"
1329
- }
1330
-
1331
- /**
1332
- * @deprecated - use ContainerRuntimeMessageType instead
1333
- */
1334
- export declare enum RuntimeMessage {
1335
- FluidDataStoreOp = "component",
1336
- Attach = "attach",
1337
- ChunkedOp = "chunkedOp",
1338
- BlobAttach = "blobAttach",
1339
- Rejoin = "rejoin",
1340
- Alias = "alias",
1341
- Operation = "op"
1342
- }
1343
-
1344
- /** The data in summarizer result when submit summary stage fails. */
1345
- export declare interface SubmitSummaryFailureData extends IRetriableFailureResult {
1346
- stage: SummaryStage;
1347
- }
1348
-
1349
- /**
1350
- * Strict type representing result of a submitSummary attempt.
1351
- * The result consists of 4 possible stages, each with its own data.
1352
- * The data is cumulative, so each stage will contain the data from the previous stages.
1353
- * If the final "submitted" stage is not reached, the result may contain the error object.
1354
- *
1355
- * Stages:
1356
- *
1357
- * 1. "base" - stopped before the summary tree was even generated, and the result only contains the base data
1358
- *
1359
- * 2. "generate" - the summary tree was generated, and the result will contain that tree + stats
1360
- *
1361
- * 3. "upload" - the summary was uploaded to storage, and the result contains the server-provided handle
1362
- *
1363
- * 4. "submit" - the summarize op was submitted, and the result contains the op client sequence number.
1364
- */
1365
- export declare type SubmitSummaryResult = IBaseSummarizeResult | IGenerateSummaryTreeResult | IUploadSummaryResult | ISubmitSummaryOpResult;
1366
-
1367
- /**
1368
- * Summarizer is responsible for coordinating when to generate and send summaries.
1369
- * It is the main entry point for summary work.
1370
- * It is created only by summarizing container (i.e. one with clientType === "summarizer")
1371
- */
1372
- export declare class Summarizer extends TypedEventEmitter<ISummarizerEvents> implements ISummarizer {
1373
- /** Reference to runtime that created this object.
1374
- * i.e. runtime with clientType === "summarizer"
1375
- */
1376
- private readonly runtime;
1377
- private readonly configurationGetter;
1378
- /** Represents an object that can generate summary.
1379
- * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer".
1380
- */
1381
- private readonly internalsProvider;
1382
- readonly summaryCollection: SummaryCollection;
1383
- private readonly runCoordinatorCreateFn;
1384
- get ISummarizer(): this;
1385
- private readonly logger;
1386
- private runningSummarizer?;
1387
- private _disposed;
1388
- private starting;
1389
- private readonly stopDeferred;
1390
- constructor(
1391
- /** Reference to runtime that created this object.
1392
- * i.e. runtime with clientType === "summarizer"
1393
- */
1394
- runtime: ISummarizerRuntime, configurationGetter: () => ISummaryConfiguration,
1395
- /** Represents an object that can generate summary.
1396
- * In practical terms, it's same runtime (this.runtime) with clientType === "summarizer".
1397
- */
1398
- internalsProvider: ISummarizerInternalsProvider, handleContext: IFluidHandleContext, summaryCollection: SummaryCollection, runCoordinatorCreateFn: (runtime: IConnectableRuntime) => Promise<ICancellableSummarizerController>);
1399
- /**
1400
- * Creates a Summarizer and its underlying client.
1401
- * Note that different implementations of ILoader will handle the URL differently.
1402
- * ILoader provided by a ContainerRuntime is a RelativeLoader, which will treat URL's
1403
- * starting with "/" as relative to the Container. The general ILoader
1404
- * interface will expect an absolute URL and will not handle "/".
1405
- * @param loader - the loader that resolves the request
1406
- * @param url - the URL used to resolve the container
1407
- * @deprecated Creating a summarizer is not a publicly supported API. Please remove all usage of this static method.
1408
- */
1409
- static create(loader: ILoader, url: string): Promise<ISummarizer>;
1410
- run(onBehalfOf: string): Promise<SummarizerStopReason>;
1411
- /**
1412
- * Stops the summarizer from running. This will complete
1413
- * the run promise, and also close the container.
1414
- * @param reason - reason code for stopping
1415
- */
1416
- stop(reason: SummarizerStopReason): void;
1417
- close(): void;
1418
- private runCore;
1419
- /**
1420
- * Should we try to run a last summary for the given stop reason?
1421
- * Currently only allows "parentNotConnected"
1422
- * @param stopReason - SummarizerStopReason
1423
- * @returns `true` if the stop reason can run a last summary, otherwise `false`.
1424
- */
1425
- static stopReasonCanRunLastSummary(stopReason: SummarizerStopReason): boolean;
1426
- private _heuristicData;
1427
- /**
1428
- * Put the summarizer in a started state, including creating and initializing the RunningSummarizer.
1429
- * The start request can come either from the SummaryManager (in the auto-summarize case) or from the user
1430
- * (in the on-demand case).
1431
- * @param onBehalfOf - ID of the client that requested that the summarizer start
1432
- * @param runCoordinator - cancellation token
1433
- * @param newConfig - Summary configuration to override the existing config when invoking the RunningSummarizer.
1434
- * @returns A promise that is fulfilled when the RunningSummarizer is ready.
1435
- */
1436
- private start;
1437
- private readonly handleSummarizeEvent;
1438
- /**
1439
- * Disposes of resources after running. This cleanup will
1440
- * clear any outstanding timers and reset some of the state
1441
- * properties.
1442
- * Called by ContainerRuntime when it is disposed, as well as at the end the run().
1443
- */
1444
- dispose(): void;
1445
- summarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;
1446
- enqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;
1447
- recordSummaryAttempt?(summaryRefSeqNum?: number): void;
1448
- }
1449
-
1450
- export declare type SummarizeResultPart<TSuccess, TFailure = undefined> = {
1451
- success: true;
1452
- data: TSuccess;
1453
- } | {
1454
- success: false;
1455
- data: TFailure | undefined;
1456
- message: string;
1457
- error: any;
1458
- };
1459
-
1460
- export declare type SummarizerStopReason =
1461
- /** Summarizer client failed to summarize in all 3 consecutive attempts. */
1462
- "failToSummarize"
1463
- /** Parent client reported that it is no longer connected. */
1464
- | "parentNotConnected"
1465
- /**
1466
- * Parent client reported that it is no longer elected the summarizer.
1467
- * This is the normal flow; a disconnect will always trigger the parent
1468
- * client to no longer be elected as responsible for summaries. Then it
1469
- * tries to stop its spawned summarizer client.
1470
- */
1471
- | "notElectedParent"
1472
- /**
1473
- * We are not already running the summarizer and we are not the current elected client id.
1474
- */
1475
- | "notElectedClient"
1476
- /** Summarizer client was disconnected */
1477
- | "summarizerClientDisconnected"
1478
- /** running summarizer threw an exception */
1479
- | "summarizerException"
1480
- /**
1481
- * The previous summary state on the summarizer is not the most recently acked summary. this also happens when the
1482
- * first submitSummary attempt fails for any reason and there's a 2nd summary attempt without an ack
1483
- */
1484
- | "latestSummaryStateStale";
1485
-
1486
- /**
1487
- * Data structure that looks at the op stream to track summaries as they
1488
- * are broadcast, acked and nacked.
1489
- * It provides functionality for watching specific summaries.
1490
- */
1491
- export declare class SummaryCollection extends TypedEventEmitter<ISummaryCollectionOpEvents> {
1492
- private readonly deltaManager;
1493
- private readonly logger;
1494
- private readonly summaryWatchers;
1495
- private readonly pendingSummaries;
1496
- private refreshWaitNextAck;
1497
- private lastSummaryTimestamp;
1498
- private maxAckWaitTime;
1499
- private pendingAckTimerTimeoutCallback;
1500
- private lastAck;
1501
- get latestAck(): IAckedSummary | undefined;
1502
- emit(event: OpActionEventName, ...args: Parameters<OpActionEventListener>): boolean;
1503
- get opsSinceLastAck(): number;
1504
- addOpListener(listener: () => void): void;
1505
- removeOpListener(listener: () => void): void;
1506
- constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>, logger: ITelemetryLoggerExt);
1507
- /**
1508
- * Creates and returns a summary watcher for a specific client.
1509
- * This will allow for local sent summaries to be better tracked.
1510
- * @param clientId - client id for watcher
1511
- */
1512
- createWatcher(clientId: string): IClientSummaryWatcher;
1513
- removeWatcher(clientId: string): void;
1514
- setPendingAckTimerTimeoutCallback(maxAckWaitTime: number, timeoutCallback: () => void): void;
1515
- unsetPendingAckTimerTimeoutCallback(): void;
1516
- /**
1517
- * Returns a promise that resolves once all pending summary ops
1518
- * have been acked or nacked.
1519
- */
1520
- waitFlushed(): Promise<IAckedSummary | undefined>;
1521
- /**
1522
- * Returns a promise that resolves once a summary is acked that has a reference
1523
- * sequence number greater than or equal to the passed in sequence number.
1524
- * @param referenceSequenceNumber - reference sequence number to wait for
1525
- * @returns The latest acked summary
1526
- */
1527
- waitSummaryAck(referenceSequenceNumber: number): Promise<IAckedSummary>;
1528
- private parseContent;
1529
- /**
1530
- * Handler for ops; only handles ops relating to summaries.
1531
- * @param op - op message to handle
1532
- */
1533
- private handleOp;
1534
- private handleSummaryOp;
1535
- private handleSummaryAck;
1536
- private handleSummaryNack;
1537
- }
1538
-
1539
- /** The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage. */
1540
- export declare type SummaryStage = SubmitSummaryResult["stage"] | "unknown";
1541
-
1542
- /**
1543
- * This function is not supported publicly and exists for e2e testing
1544
- */
1545
- export declare function TEST_requestSummarizer(loader: ILoader, url: string): Promise<ISummarizer>;
1546
-
1547
- /** Tombstone error responses will have this header set to true */
1548
- export declare const TombstoneResponseHeaderKey = "isTombstoned";
1549
-
1550
- /* Excluded from this release type: TypedEventEmitter */
1551
-
1552
- /* Excluded from this release type: unpackRuntimeMessage */
1553
-
1554
- export { }