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