@fluidframework/container-runtime 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.1

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 (447) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +1 -7
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/container-runtime.api.md +18 -17
  7. package/dist/blobManager.d.ts +8 -3
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +15 -4
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/container-runtime-alpha.d.ts +265 -17
  12. package/dist/container-runtime-beta.d.ts +0 -42
  13. package/dist/container-runtime-public.d.ts +0 -42
  14. package/dist/container-runtime-untrimmed.d.ts +32 -17
  15. package/dist/containerRuntime.d.ts +8 -4
  16. package/dist/containerRuntime.d.ts.map +1 -1
  17. package/dist/containerRuntime.js +15 -29
  18. package/dist/containerRuntime.js.map +1 -1
  19. package/dist/dataStoreContext.d.ts +5 -2
  20. package/dist/dataStoreContext.d.ts.map +1 -1
  21. package/dist/dataStoreContext.js +10 -3
  22. package/dist/dataStoreContext.js.map +1 -1
  23. package/dist/dataStores.d.ts +10 -3
  24. package/dist/dataStores.d.ts.map +1 -1
  25. package/dist/dataStores.js +51 -8
  26. package/dist/dataStores.js.map +1 -1
  27. package/dist/gc/garbageCollection.d.ts.map +1 -1
  28. package/dist/gc/garbageCollection.js +15 -4
  29. package/dist/gc/garbageCollection.js.map +1 -1
  30. package/dist/gc/gcConfigs.d.ts.map +1 -1
  31. package/dist/gc/gcConfigs.js +26 -19
  32. package/dist/gc/gcConfigs.js.map +1 -1
  33. package/dist/gc/gcDefinitions.d.ts +29 -6
  34. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  35. package/dist/gc/gcDefinitions.js +5 -3
  36. package/dist/gc/gcDefinitions.js.map +1 -1
  37. package/dist/gc/gcTelemetry.d.ts +13 -6
  38. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  39. package/dist/gc/gcTelemetry.js +18 -9
  40. package/dist/gc/gcTelemetry.js.map +1 -1
  41. package/dist/gc/index.d.ts +1 -1
  42. package/dist/gc/index.d.ts.map +1 -1
  43. package/dist/gc/index.js +2 -1
  44. package/dist/gc/index.js.map +1 -1
  45. package/dist/messageTypes.d.ts +1 -1
  46. package/dist/messageTypes.js +1 -1
  47. package/dist/messageTypes.js.map +1 -1
  48. package/dist/opLifecycle/definitions.d.ts +1 -1
  49. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  50. package/dist/opLifecycle/definitions.js.map +1 -1
  51. package/dist/opLifecycle/outbox.d.ts +4 -4
  52. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  53. package/dist/opLifecycle/outbox.js +4 -1
  54. package/dist/opLifecycle/outbox.js.map +1 -1
  55. package/dist/packageVersion.d.ts +1 -1
  56. package/dist/packageVersion.d.ts.map +1 -1
  57. package/dist/packageVersion.js +1 -1
  58. package/dist/packageVersion.js.map +1 -1
  59. package/dist/summary/runWhileConnectedCoordinator.d.ts +1 -1
  60. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  61. package/dist/summary/runningSummarizer.d.ts +5 -0
  62. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  63. package/dist/summary/runningSummarizer.js +46 -17
  64. package/dist/summary/runningSummarizer.js.map +1 -1
  65. package/dist/summary/summarizer.d.ts +1 -1
  66. package/dist/summary/summarizer.js +1 -1
  67. package/dist/summary/summarizer.js.map +1 -1
  68. package/dist/summary/summarizerTypes.d.ts +3 -1
  69. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  70. package/dist/summary/summarizerTypes.js.map +1 -1
  71. package/dist/summary/summaryCollection.d.ts +7 -7
  72. package/dist/summary/summaryCollection.js +1 -1
  73. package/dist/summary/summaryCollection.js.map +1 -1
  74. package/lib/{batchTracker.d.ts → batchTracker.d.mts} +1 -1
  75. package/lib/batchTracker.d.mts.map +1 -0
  76. package/lib/{batchTracker.js → batchTracker.mjs} +1 -1
  77. package/lib/batchTracker.mjs.map +1 -0
  78. package/lib/{blobManager.d.ts → blobManager.d.mts} +9 -4
  79. package/lib/blobManager.d.mts.map +1 -0
  80. package/lib/{blobManager.js → blobManager.mjs} +17 -6
  81. package/lib/blobManager.mjs.map +1 -0
  82. package/lib/{connectionTelemetry.d.ts → connectionTelemetry.d.mts} +1 -1
  83. package/lib/connectionTelemetry.d.mts.map +1 -0
  84. package/lib/{connectionTelemetry.js → connectionTelemetry.mjs} +1 -1
  85. package/lib/connectionTelemetry.mjs.map +1 -0
  86. package/lib/{container-runtime-alpha.d.ts → container-runtime-alpha.d.mts} +265 -17
  87. package/lib/{container-runtime-beta.d.ts → container-runtime-beta.d.mts} +0 -42
  88. package/lib/{container-runtime-public.d.ts → container-runtime-public.d.mts} +0 -42
  89. package/lib/{container-runtime-untrimmed.d.ts → container-runtime-untrimmed.d.mts} +32 -17
  90. package/lib/{containerHandleContext.d.ts → containerHandleContext.d.mts} +2 -2
  91. package/lib/containerHandleContext.d.mts.map +1 -0
  92. package/lib/{containerHandleContext.js → containerHandleContext.mjs} +1 -1
  93. package/lib/containerHandleContext.mjs.map +1 -0
  94. package/lib/{containerRuntime.d.ts → containerRuntime.d.mts} +14 -14
  95. package/lib/containerRuntime.d.mts.map +1 -0
  96. package/lib/{containerRuntime.js → containerRuntime.mjs} +31 -22
  97. package/lib/containerRuntime.mjs.map +1 -0
  98. package/lib/{dataStore.d.ts → dataStore.d.mts} +3 -3
  99. package/lib/dataStore.d.mts.map +1 -0
  100. package/lib/{dataStore.js → dataStore.mjs} +1 -1
  101. package/lib/dataStore.mjs.map +1 -0
  102. package/lib/{dataStoreContext.d.ts → dataStoreContext.d.mts} +7 -4
  103. package/lib/dataStoreContext.d.mts.map +1 -0
  104. package/lib/{dataStoreContext.js → dataStoreContext.mjs} +13 -6
  105. package/lib/dataStoreContext.mjs.map +1 -0
  106. package/lib/{dataStoreContexts.d.ts → dataStoreContexts.d.mts} +2 -2
  107. package/lib/dataStoreContexts.d.mts.map +1 -0
  108. package/lib/{dataStoreContexts.js → dataStoreContexts.mjs} +1 -1
  109. package/lib/dataStoreContexts.mjs.map +1 -0
  110. package/lib/{dataStoreRegistry.d.ts → dataStoreRegistry.d.mts} +1 -1
  111. package/lib/dataStoreRegistry.d.mts.map +1 -0
  112. package/lib/{dataStoreRegistry.js → dataStoreRegistry.mjs} +1 -5
  113. package/lib/dataStoreRegistry.mjs.map +1 -0
  114. package/lib/{dataStores.d.ts → dataStores.d.mts} +17 -10
  115. package/lib/dataStores.d.mts.map +1 -0
  116. package/lib/{dataStores.js → dataStores.mjs} +58 -16
  117. package/lib/dataStores.mjs.map +1 -0
  118. package/lib/{deltaManagerProxyBase.d.ts → deltaManagerProxyBase.d.mts} +1 -1
  119. package/lib/deltaManagerProxyBase.d.mts.map +1 -0
  120. package/lib/{deltaManagerProxyBase.js → deltaManagerProxyBase.mjs} +1 -1
  121. package/lib/deltaManagerProxyBase.mjs.map +1 -0
  122. package/lib/{deltaManagerSummarizerProxy.d.ts → deltaManagerSummarizerProxy.d.mts} +2 -2
  123. package/lib/deltaManagerSummarizerProxy.d.mts.map +1 -0
  124. package/lib/{deltaManagerSummarizerProxy.js → deltaManagerSummarizerProxy.mjs} +3 -3
  125. package/lib/deltaManagerSummarizerProxy.mjs.map +1 -0
  126. package/lib/{deltaScheduler.d.ts → deltaScheduler.d.mts} +1 -1
  127. package/lib/deltaScheduler.d.mts.map +1 -0
  128. package/lib/{deltaScheduler.js → deltaScheduler.mjs} +1 -1
  129. package/lib/deltaScheduler.mjs.map +1 -0
  130. package/lib/{error.d.ts → error.d.mts} +1 -1
  131. package/lib/error.d.mts.map +1 -0
  132. package/lib/{error.js → error.mjs} +1 -1
  133. package/lib/error.mjs.map +1 -0
  134. package/lib/gc/{garbageCollection.d.ts → garbageCollection.d.mts} +5 -5
  135. package/lib/gc/garbageCollection.d.mts.map +1 -0
  136. package/lib/gc/{garbageCollection.js → garbageCollection.mjs} +28 -17
  137. package/lib/gc/garbageCollection.mjs.map +1 -0
  138. package/lib/gc/{gcConfigs.d.ts → gcConfigs.d.mts} +3 -3
  139. package/lib/gc/gcConfigs.d.mts.map +1 -0
  140. package/lib/gc/{gcConfigs.js → gcConfigs.mjs} +29 -22
  141. package/lib/gc/gcConfigs.mjs.map +1 -0
  142. package/lib/gc/{gcDefinitions.d.ts → gcDefinitions.d.mts} +33 -10
  143. package/lib/gc/gcDefinitions.d.mts.map +1 -0
  144. package/lib/gc/{gcDefinitions.js → gcDefinitions.mjs} +5 -3
  145. package/lib/gc/gcDefinitions.mjs.map +1 -0
  146. package/lib/gc/{gcHelpers.d.ts → gcHelpers.d.mts} +3 -3
  147. package/lib/gc/{gcHelpers.d.ts.map → gcHelpers.d.mts.map} +1 -1
  148. package/lib/gc/{gcHelpers.js → gcHelpers.mjs} +1 -1
  149. package/lib/gc/gcHelpers.mjs.map +1 -0
  150. package/lib/gc/{gcReferenceGraphAlgorithm.d.ts → gcReferenceGraphAlgorithm.d.mts} +2 -2
  151. package/lib/gc/gcReferenceGraphAlgorithm.d.mts.map +1 -0
  152. package/lib/gc/{gcReferenceGraphAlgorithm.js → gcReferenceGraphAlgorithm.mjs} +1 -1
  153. package/lib/gc/gcReferenceGraphAlgorithm.mjs.map +1 -0
  154. package/lib/gc/{gcSummaryDefinitions.d.ts → gcSummaryDefinitions.d.mts} +1 -1
  155. package/lib/gc/gcSummaryDefinitions.d.mts.map +1 -0
  156. package/lib/gc/{gcSummaryDefinitions.js → gcSummaryDefinitions.mjs} +1 -1
  157. package/lib/gc/gcSummaryDefinitions.mjs.map +1 -0
  158. package/lib/gc/{gcSummaryStateTracker.d.ts → gcSummaryStateTracker.d.mts} +4 -4
  159. package/lib/gc/gcSummaryStateTracker.d.mts.map +1 -0
  160. package/lib/gc/{gcSummaryStateTracker.js → gcSummaryStateTracker.mjs} +2 -2
  161. package/lib/gc/gcSummaryStateTracker.mjs.map +1 -0
  162. package/lib/gc/{gcTelemetry.d.ts → gcTelemetry.d.mts} +18 -11
  163. package/lib/gc/gcTelemetry.d.mts.map +1 -0
  164. package/lib/gc/{gcTelemetry.js → gcTelemetry.mjs} +20 -11
  165. package/lib/gc/gcTelemetry.mjs.map +1 -0
  166. package/lib/gc/{gcUnreferencedStateTracker.d.ts → gcUnreferencedStateTracker.d.mts} +2 -2
  167. package/lib/gc/gcUnreferencedStateTracker.d.mts.map +1 -0
  168. package/lib/gc/{gcUnreferencedStateTracker.js → gcUnreferencedStateTracker.mjs} +2 -2
  169. package/lib/gc/gcUnreferencedStateTracker.mjs.map +1 -0
  170. package/lib/gc/{index.d.ts → index.d.mts} +9 -9
  171. package/lib/gc/index.d.mts.map +1 -0
  172. package/lib/gc/{index.js → index.mjs} +8 -8
  173. package/lib/gc/index.mjs.map +1 -0
  174. package/lib/{index.d.ts → index.d.mts} +8 -8
  175. package/lib/index.d.mts.map +1 -0
  176. package/lib/{index.js → index.mjs} +7 -9
  177. package/lib/index.mjs.map +1 -0
  178. package/lib/{messageTypes.d.ts → messageTypes.d.mts} +5 -5
  179. package/lib/messageTypes.d.mts.map +1 -0
  180. package/lib/{messageTypes.js → messageTypes.mjs} +2 -2
  181. package/lib/messageTypes.mjs.map +1 -0
  182. package/lib/{metadata.d.ts → metadata.d.mts} +1 -1
  183. package/lib/metadata.d.mts.map +1 -0
  184. package/lib/{metadata.js → metadata.mjs} +1 -1
  185. package/lib/metadata.mjs.map +1 -0
  186. package/lib/opLifecycle/{batchManager.d.ts → batchManager.d.mts} +3 -3
  187. package/lib/opLifecycle/batchManager.d.mts.map +1 -0
  188. package/lib/opLifecycle/{batchManager.js → batchManager.mjs} +1 -1
  189. package/lib/opLifecycle/batchManager.mjs.map +1 -0
  190. package/lib/opLifecycle/{definitions.d.ts → definitions.d.mts} +3 -3
  191. package/lib/opLifecycle/definitions.d.mts.map +1 -0
  192. package/lib/opLifecycle/{definitions.js → definitions.mjs} +1 -1
  193. package/lib/opLifecycle/definitions.mjs.map +1 -0
  194. package/lib/opLifecycle/index.d.mts +13 -0
  195. package/lib/opLifecycle/index.d.mts.map +1 -0
  196. package/lib/opLifecycle/index.mjs +12 -0
  197. package/lib/opLifecycle/index.mjs.map +1 -0
  198. package/lib/opLifecycle/{opCompressor.d.ts → opCompressor.d.mts} +2 -2
  199. package/lib/opLifecycle/opCompressor.d.mts.map +1 -0
  200. package/lib/opLifecycle/{opCompressor.js → opCompressor.mjs} +3 -3
  201. package/lib/opLifecycle/opCompressor.mjs.map +1 -0
  202. package/lib/opLifecycle/{opDecompressor.d.ts → opDecompressor.d.mts} +2 -2
  203. package/lib/opLifecycle/opDecompressor.d.mts.map +1 -0
  204. package/lib/opLifecycle/{opDecompressor.js → opDecompressor.mjs} +2 -2
  205. package/lib/opLifecycle/opDecompressor.mjs.map +1 -0
  206. package/lib/opLifecycle/{opGroupingManager.d.ts → opGroupingManager.d.mts} +2 -2
  207. package/lib/opLifecycle/opGroupingManager.d.mts.map +1 -0
  208. package/lib/opLifecycle/{opGroupingManager.js → opGroupingManager.mjs} +1 -1
  209. package/lib/opLifecycle/opGroupingManager.mjs.map +1 -0
  210. package/lib/opLifecycle/{opSplitter.d.ts → opSplitter.d.mts} +2 -2
  211. package/lib/opLifecycle/opSplitter.d.mts.map +1 -0
  212. package/lib/opLifecycle/{opSplitter.js → opSplitter.mjs} +3 -3
  213. package/lib/opLifecycle/opSplitter.mjs.map +1 -0
  214. package/lib/opLifecycle/{outbox.d.ts → outbox.d.mts} +11 -11
  215. package/lib/opLifecycle/outbox.d.mts.map +1 -0
  216. package/lib/opLifecycle/{outbox.js → outbox.mjs} +6 -3
  217. package/lib/opLifecycle/outbox.mjs.map +1 -0
  218. package/lib/opLifecycle/{remoteMessageProcessor.d.ts → remoteMessageProcessor.d.mts} +5 -5
  219. package/lib/opLifecycle/remoteMessageProcessor.d.mts.map +1 -0
  220. package/lib/opLifecycle/{remoteMessageProcessor.js → remoteMessageProcessor.mjs} +2 -2
  221. package/lib/opLifecycle/remoteMessageProcessor.mjs.map +1 -0
  222. package/lib/{opProperties.d.ts → opProperties.d.mts} +1 -1
  223. package/lib/opProperties.d.mts.map +1 -0
  224. package/lib/{opProperties.js → opProperties.mjs} +1 -1
  225. package/lib/opProperties.mjs.map +1 -0
  226. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  227. package/lib/packageVersion.d.mts.map +1 -0
  228. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  229. package/lib/packageVersion.mjs.map +1 -0
  230. package/lib/{pendingStateManager.d.ts → pendingStateManager.d.mts} +2 -2
  231. package/lib/pendingStateManager.d.mts.map +1 -0
  232. package/lib/{pendingStateManager.js → pendingStateManager.mjs} +2 -2
  233. package/lib/pendingStateManager.mjs.map +1 -0
  234. package/lib/{scheduleManager.d.ts → scheduleManager.d.mts} +1 -5
  235. package/lib/scheduleManager.d.mts.map +1 -0
  236. package/lib/{scheduleManager.js → scheduleManager.mjs} +3 -3
  237. package/lib/scheduleManager.mjs.map +1 -0
  238. package/lib/{storageServiceWithAttachBlobs.d.ts → storageServiceWithAttachBlobs.d.mts} +1 -1
  239. package/lib/storageServiceWithAttachBlobs.d.mts.map +1 -0
  240. package/lib/{storageServiceWithAttachBlobs.js → storageServiceWithAttachBlobs.mjs} +1 -1
  241. package/lib/storageServiceWithAttachBlobs.mjs.map +1 -0
  242. package/lib/summary/{index.d.ts → index.d.mts} +13 -13
  243. package/lib/summary/index.d.mts.map +1 -0
  244. package/lib/summary/{index.js → index.mjs} +12 -12
  245. package/lib/summary/index.mjs.map +1 -0
  246. package/lib/summary/{orderedClientElection.d.ts → orderedClientElection.d.mts} +1 -5
  247. package/lib/summary/orderedClientElection.d.mts.map +1 -0
  248. package/lib/summary/{orderedClientElection.js → orderedClientElection.mjs} +2 -2
  249. package/lib/summary/orderedClientElection.mjs.map +1 -0
  250. package/lib/summary/{runWhileConnectedCoordinator.d.ts → runWhileConnectedCoordinator.d.mts} +3 -3
  251. package/lib/summary/runWhileConnectedCoordinator.d.mts.map +1 -0
  252. package/lib/summary/{runWhileConnectedCoordinator.js → runWhileConnectedCoordinator.mjs} +1 -1
  253. package/lib/summary/runWhileConnectedCoordinator.mjs.map +1 -0
  254. package/lib/summary/{runningSummarizer.d.ts → runningSummarizer.d.mts} +10 -5
  255. package/lib/summary/runningSummarizer.d.mts.map +1 -0
  256. package/lib/summary/{runningSummarizer.js → runningSummarizer.mjs} +50 -21
  257. package/lib/summary/runningSummarizer.mjs.map +1 -0
  258. package/lib/summary/{summarizer.d.ts → summarizer.d.mts} +6 -6
  259. package/lib/summary/summarizer.d.mts.map +1 -0
  260. package/lib/summary/{summarizer.js → summarizer.mjs} +5 -5
  261. package/lib/summary/summarizer.mjs.map +1 -0
  262. package/lib/summary/{summarizerClientElection.d.ts → summarizerClientElection.d.mts} +3 -3
  263. package/lib/summary/summarizerClientElection.d.mts.map +1 -0
  264. package/lib/summary/{summarizerClientElection.js → summarizerClientElection.mjs} +1 -1
  265. package/lib/summary/summarizerClientElection.mjs.map +1 -0
  266. package/lib/summary/{summarizerHeuristics.d.ts → summarizerHeuristics.d.mts} +4 -4
  267. package/lib/summary/summarizerHeuristics.d.mts.map +1 -0
  268. package/lib/summary/{summarizerHeuristics.js → summarizerHeuristics.mjs} +1 -1
  269. package/lib/summary/summarizerHeuristics.mjs.map +1 -0
  270. package/lib/summary/summarizerNode/{index.d.ts → index.d.mts} +4 -4
  271. package/lib/summary/summarizerNode/index.d.mts.map +1 -0
  272. package/lib/summary/summarizerNode/{index.js → index.mjs} +3 -3
  273. package/lib/summary/summarizerNode/index.mjs.map +1 -0
  274. package/lib/summary/summarizerNode/{summarizerNode.d.ts → summarizerNode.d.mts} +2 -2
  275. package/lib/summary/summarizerNode/summarizerNode.d.mts.map +1 -0
  276. package/lib/summary/summarizerNode/{summarizerNode.js → summarizerNode.mjs} +2 -2
  277. package/lib/summary/summarizerNode/summarizerNode.mjs.map +1 -0
  278. package/lib/summary/summarizerNode/{summarizerNodeUtils.d.ts → summarizerNodeUtils.d.mts} +1 -1
  279. package/lib/summary/summarizerNode/summarizerNodeUtils.d.mts.map +1 -0
  280. package/lib/summary/summarizerNode/{summarizerNodeUtils.js → summarizerNodeUtils.mjs} +1 -1
  281. package/lib/summary/summarizerNode/summarizerNodeUtils.mjs.map +1 -0
  282. package/lib/summary/summarizerNode/{summarizerNodeWithGc.d.ts → summarizerNodeWithGc.d.mts} +3 -3
  283. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.mts.map +1 -0
  284. package/lib/summary/summarizerNode/{summarizerNodeWithGc.js → summarizerNodeWithGc.mjs} +4 -4
  285. package/lib/summary/summarizerNode/summarizerNodeWithGc.mjs.map +1 -0
  286. package/lib/summary/{summarizerTypes.d.ts → summarizerTypes.d.mts} +7 -5
  287. package/lib/summary/summarizerTypes.d.mts.map +1 -0
  288. package/lib/summary/{summarizerTypes.js → summarizerTypes.mjs} +1 -1
  289. package/lib/summary/summarizerTypes.mjs.map +1 -0
  290. package/lib/summary/{summaryCollection.d.ts → summaryCollection.d.mts} +8 -8
  291. package/lib/summary/summaryCollection.d.mts.map +1 -0
  292. package/lib/summary/{summaryCollection.js → summaryCollection.mjs} +2 -2
  293. package/lib/summary/summaryCollection.mjs.map +1 -0
  294. package/lib/summary/{summaryFormat.d.ts → summaryFormat.d.mts} +2 -2
  295. package/lib/summary/summaryFormat.d.mts.map +1 -0
  296. package/lib/summary/{summaryFormat.js → summaryFormat.mjs} +1 -1
  297. package/lib/summary/summaryFormat.mjs.map +1 -0
  298. package/lib/summary/{summaryGenerator.d.ts → summaryGenerator.d.mts} +3 -3
  299. package/lib/summary/summaryGenerator.d.mts.map +1 -0
  300. package/lib/summary/{summaryGenerator.js → summaryGenerator.mjs} +1 -1
  301. package/lib/summary/summaryGenerator.mjs.map +1 -0
  302. package/lib/summary/{summaryManager.d.ts → summaryManager.d.mts} +5 -5
  303. package/lib/summary/summaryManager.d.mts.map +1 -0
  304. package/lib/summary/{summaryManager.js → summaryManager.mjs} +2 -2
  305. package/lib/summary/summaryManager.mjs.map +1 -0
  306. package/lib/{throttler.d.ts → throttler.d.mts} +1 -1
  307. package/lib/throttler.d.mts.map +1 -0
  308. package/lib/{throttler.js → throttler.mjs} +1 -1
  309. package/lib/throttler.mjs.map +1 -0
  310. package/package.json +145 -39
  311. package/src/blobManager.ts +15 -4
  312. package/src/containerRuntime.ts +15 -4
  313. package/src/dataStoreContext.ts +11 -4
  314. package/src/dataStores.ts +61 -7
  315. package/src/gc/garbageCollection.ts +18 -4
  316. package/src/gc/gcConfigs.ts +28 -20
  317. package/src/gc/gcDefinitions.ts +30 -6
  318. package/src/gc/gcTelemetry.ts +19 -9
  319. package/src/gc/index.ts +3 -0
  320. package/src/messageTypes.ts +1 -1
  321. package/src/opLifecycle/definitions.ts +1 -1
  322. package/src/opLifecycle/outbox.ts +5 -2
  323. package/src/packageVersion.ts +1 -1
  324. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  325. package/src/summary/runningSummarizer.ts +58 -25
  326. package/src/summary/summarizer.ts +1 -1
  327. package/src/summary/summarizerTypes.ts +3 -1
  328. package/src/summary/summaryCollection.ts +7 -7
  329. package/tsconfig.json +6 -4
  330. package/lib/batchTracker.d.ts.map +0 -1
  331. package/lib/batchTracker.js.map +0 -1
  332. package/lib/blobManager.d.ts.map +0 -1
  333. package/lib/blobManager.js.map +0 -1
  334. package/lib/connectionTelemetry.d.ts.map +0 -1
  335. package/lib/connectionTelemetry.js.map +0 -1
  336. package/lib/containerHandleContext.d.ts.map +0 -1
  337. package/lib/containerHandleContext.js.map +0 -1
  338. package/lib/containerRuntime.d.ts.map +0 -1
  339. package/lib/containerRuntime.js.map +0 -1
  340. package/lib/dataStore.d.ts.map +0 -1
  341. package/lib/dataStore.js.map +0 -1
  342. package/lib/dataStoreContext.d.ts.map +0 -1
  343. package/lib/dataStoreContext.js.map +0 -1
  344. package/lib/dataStoreContexts.d.ts.map +0 -1
  345. package/lib/dataStoreContexts.js.map +0 -1
  346. package/lib/dataStoreRegistry.d.ts.map +0 -1
  347. package/lib/dataStoreRegistry.js.map +0 -1
  348. package/lib/dataStores.d.ts.map +0 -1
  349. package/lib/dataStores.js.map +0 -1
  350. package/lib/deltaManagerProxyBase.d.ts.map +0 -1
  351. package/lib/deltaManagerProxyBase.js.map +0 -1
  352. package/lib/deltaManagerSummarizerProxy.d.ts.map +0 -1
  353. package/lib/deltaManagerSummarizerProxy.js.map +0 -1
  354. package/lib/deltaScheduler.d.ts.map +0 -1
  355. package/lib/deltaScheduler.js.map +0 -1
  356. package/lib/error.d.ts.map +0 -1
  357. package/lib/error.js.map +0 -1
  358. package/lib/gc/garbageCollection.d.ts.map +0 -1
  359. package/lib/gc/garbageCollection.js.map +0 -1
  360. package/lib/gc/gcConfigs.d.ts.map +0 -1
  361. package/lib/gc/gcConfigs.js.map +0 -1
  362. package/lib/gc/gcDefinitions.d.ts.map +0 -1
  363. package/lib/gc/gcDefinitions.js.map +0 -1
  364. package/lib/gc/gcHelpers.js.map +0 -1
  365. package/lib/gc/gcReferenceGraphAlgorithm.d.ts.map +0 -1
  366. package/lib/gc/gcReferenceGraphAlgorithm.js.map +0 -1
  367. package/lib/gc/gcSummaryDefinitions.d.ts.map +0 -1
  368. package/lib/gc/gcSummaryDefinitions.js.map +0 -1
  369. package/lib/gc/gcSummaryStateTracker.d.ts.map +0 -1
  370. package/lib/gc/gcSummaryStateTracker.js.map +0 -1
  371. package/lib/gc/gcTelemetry.d.ts.map +0 -1
  372. package/lib/gc/gcTelemetry.js.map +0 -1
  373. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +0 -1
  374. package/lib/gc/gcUnreferencedStateTracker.js.map +0 -1
  375. package/lib/gc/index.d.ts.map +0 -1
  376. package/lib/gc/index.js.map +0 -1
  377. package/lib/index.d.ts.map +0 -1
  378. package/lib/index.js.map +0 -1
  379. package/lib/messageTypes.d.ts.map +0 -1
  380. package/lib/messageTypes.js.map +0 -1
  381. package/lib/metadata.d.ts.map +0 -1
  382. package/lib/metadata.js.map +0 -1
  383. package/lib/opLifecycle/batchManager.d.ts.map +0 -1
  384. package/lib/opLifecycle/batchManager.js.map +0 -1
  385. package/lib/opLifecycle/definitions.d.ts.map +0 -1
  386. package/lib/opLifecycle/definitions.js.map +0 -1
  387. package/lib/opLifecycle/index.d.ts +0 -13
  388. package/lib/opLifecycle/index.d.ts.map +0 -1
  389. package/lib/opLifecycle/index.js +0 -12
  390. package/lib/opLifecycle/index.js.map +0 -1
  391. package/lib/opLifecycle/opCompressor.d.ts.map +0 -1
  392. package/lib/opLifecycle/opCompressor.js.map +0 -1
  393. package/lib/opLifecycle/opDecompressor.d.ts.map +0 -1
  394. package/lib/opLifecycle/opDecompressor.js.map +0 -1
  395. package/lib/opLifecycle/opGroupingManager.d.ts.map +0 -1
  396. package/lib/opLifecycle/opGroupingManager.js.map +0 -1
  397. package/lib/opLifecycle/opSplitter.d.ts.map +0 -1
  398. package/lib/opLifecycle/opSplitter.js.map +0 -1
  399. package/lib/opLifecycle/outbox.d.ts.map +0 -1
  400. package/lib/opLifecycle/outbox.js.map +0 -1
  401. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +0 -1
  402. package/lib/opLifecycle/remoteMessageProcessor.js.map +0 -1
  403. package/lib/opProperties.d.ts.map +0 -1
  404. package/lib/opProperties.js.map +0 -1
  405. package/lib/packageVersion.d.ts.map +0 -1
  406. package/lib/packageVersion.js.map +0 -1
  407. package/lib/pendingStateManager.d.ts.map +0 -1
  408. package/lib/pendingStateManager.js.map +0 -1
  409. package/lib/scheduleManager.d.ts.map +0 -1
  410. package/lib/scheduleManager.js.map +0 -1
  411. package/lib/storageServiceWithAttachBlobs.d.ts.map +0 -1
  412. package/lib/storageServiceWithAttachBlobs.js.map +0 -1
  413. package/lib/summary/index.d.ts.map +0 -1
  414. package/lib/summary/index.js.map +0 -1
  415. package/lib/summary/orderedClientElection.d.ts.map +0 -1
  416. package/lib/summary/orderedClientElection.js.map +0 -1
  417. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +0 -1
  418. package/lib/summary/runWhileConnectedCoordinator.js.map +0 -1
  419. package/lib/summary/runningSummarizer.d.ts.map +0 -1
  420. package/lib/summary/runningSummarizer.js.map +0 -1
  421. package/lib/summary/summarizer.d.ts.map +0 -1
  422. package/lib/summary/summarizer.js.map +0 -1
  423. package/lib/summary/summarizerClientElection.d.ts.map +0 -1
  424. package/lib/summary/summarizerClientElection.js.map +0 -1
  425. package/lib/summary/summarizerHeuristics.d.ts.map +0 -1
  426. package/lib/summary/summarizerHeuristics.js.map +0 -1
  427. package/lib/summary/summarizerNode/index.d.ts.map +0 -1
  428. package/lib/summary/summarizerNode/index.js.map +0 -1
  429. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +0 -1
  430. package/lib/summary/summarizerNode/summarizerNode.js.map +0 -1
  431. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +0 -1
  432. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +0 -1
  433. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +0 -1
  434. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +0 -1
  435. package/lib/summary/summarizerTypes.d.ts.map +0 -1
  436. package/lib/summary/summarizerTypes.js.map +0 -1
  437. package/lib/summary/summaryCollection.d.ts.map +0 -1
  438. package/lib/summary/summaryCollection.js.map +0 -1
  439. package/lib/summary/summaryFormat.d.ts.map +0 -1
  440. package/lib/summary/summaryFormat.js.map +0 -1
  441. package/lib/summary/summaryGenerator.d.ts.map +0 -1
  442. package/lib/summary/summaryGenerator.js.map +0 -1
  443. package/lib/summary/summaryManager.d.ts.map +0 -1
  444. package/lib/summary/summaryManager.js.map +0 -1
  445. package/lib/throttler.d.ts.map +0 -1
  446. package/lib/throttler.js.map +0 -1
  447. package/tsconfig.esnext.json +0 -7
@@ -97,4 +97,4 @@ export class SummarizerClientElection extends TypedEventEmitter {
97
97
  }
98
98
  }
99
99
  SummarizerClientElection.clientDetailsPermitElection = (details) => details.capabilities.interactive || details.type === summarizerClientType;
100
- //# sourceMappingURL=summarizerClientElection.js.map
100
+ //# sourceMappingURL=summarizerClientElection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerClientElection.mjs","sourceRoot":"","sources":["../../src/summary/summarizerClientElection.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,iBAAiB,EAAE,MAAM,8BAA8B;OACzD,EAAkB,WAAW,EAAE,MAAM,sCAAsC;AAQlF,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAWjD;;;;GAIG;AACH,MAAM,OAAO,wBACZ,SAAQ,iBAAkD;IAiB1D,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,QAAQ,CAAC;IACpD,CAAC;IACD,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,QAAQ,CAAC;IACpD,CAAC;IAED,YACkB,MAA2B,EAC3B,iBAA6D,EAC9D,cAAsC,EACrC,sBAA8B;QAE/C,KAAK,EAAE,CAAC;QALS,WAAM,GAAN,MAAM,CAAqB;QAC3B,sBAAiB,GAAjB,iBAAiB,CAA4C;QAC9D,mBAAc,GAAd,cAAc,CAAwB;QACrC,2BAAsB,GAAtB,sBAAsB,CAAQ;QAlBhD;;;;WAIG;QACK,oBAAe,GAAG,CAAC,CAAC;QAgB3B,6FAA6F;QAC7F,2CAA2C;QAC3C,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,EAAE,cAAc,EAAE,EAAE,EAAE;YAC3D,MAAM,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;YAC7C,IAAI,eAAe,KAAK,SAAS,EAAE;gBAClC,2EAA2E;gBAC3E,uEAAuE;gBACvE,2EAA2E;gBAC3E,yDAAyD;gBACzD,IAAI,IAAI,CAAC,cAAc,CAAC,aAAa,GAAG,CAAC,EAAE;oBAC1C,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E,4BAA4B;gBAC5B,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAC;aACvD;YACD,yDAAyD;YACzD,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,SAAS;QACf,MAAM,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,GACjE,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO;YACN,eAAe;YACf,eAAe;YACf,sBAAsB,EAAE,IAAI,CAAC,0BAA0B,IAAI,sBAAsB;SACjF,CAAC;IACH,CAAC;IAEM,MAAM,CAAC,gBAAgB,CAAC,MAAsB;QACpD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;QACtC,IAAI,OAAO,KAAK,SAAS,EAAE;YAC1B,+BAA+B;YAC/B,OAAO,IAAI,CAAC;SACZ;QACD,OAAO,wBAAwB,CAAC,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC;;AAEsB,oDAA2B,GAAG,CAAC,OAAuB,EAAW,EAAE,CACzF,OAAO,CAAC,YAAY,CAAC,WAAW,IAAI,OAAO,CAAC,IAAI,KAAK,oBAAoB,AADxB,CACyB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider } from \"@fluidframework/core-interfaces\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport { IClientDetails, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIOrderedClientElection,\n\tISerializedElection,\n\tITrackedClient,\n} from \"./orderedClientElection\";\nimport { ISummaryCollectionOpEvents } from \"./summaryCollection\";\n\nexport const summarizerClientType = \"summarizer\";\n\nexport interface ISummarizerClientElectionEvents extends IEvent {\n\t(event: \"electedSummarizerChanged\", handler: () => void): void;\n}\n\nexport interface ISummarizerClientElection extends IEventProvider<ISummarizerClientElectionEvents> {\n\treadonly electedClientId: string | undefined;\n\treadonly electedParentId: string | undefined;\n}\n\n/**\n * This class encapsulates logic around tracking the elected summarizer client.\n * It will handle updating the elected client when a summary ack hasn't been seen\n * for some configured number of ops.\n */\nexport class SummarizerClientElection\n\textends TypedEventEmitter<ISummarizerClientElectionEvents>\n\timplements ISummarizerClientElection\n{\n\t/**\n\t * Used to calculate number of ops since last summary ack for the current elected client.\n\t * This will be undefined if there is no elected summarizer, or no summary ack has been\n\t * observed since this client was elected.\n\t * When a summary ack comes in, this will be set to the sequence number of the summary ack.\n\t */\n\tprivate lastSummaryAckSeqForClient: number | undefined;\n\t/**\n\t * Used to prevent excess logging by recording the sequence number that we last reported at,\n\t * and making sure we don't report another event to telemetry. If things work as intended,\n\t * this is not needed, otherwise it could report an event on every op in worst case scenario.\n\t */\n\tprivate lastReportedSeq = 0;\n\n\tpublic get electedClientId() {\n\t\treturn this.clientElection.electedClient?.clientId;\n\t}\n\tpublic get electedParentId() {\n\t\treturn this.clientElection.electedParent?.clientId;\n\t}\n\n\tconstructor(\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly summaryCollection: IEventProvider<ISummaryCollectionOpEvents>,\n\t\tpublic readonly clientElection: IOrderedClientElection,\n\t\tprivate readonly maxOpsSinceLastSummary: number,\n\t) {\n\t\tsuper();\n\t\t// On every inbound op, if enough ops pass without seeing a summary ack (per elected client),\n\t\t// elect a new client and log to telemetry.\n\t\tthis.summaryCollection.on(\"default\", ({ sequenceNumber }) => {\n\t\t\tconst electedClientId = this.electedClientId;\n\t\t\tif (electedClientId === undefined) {\n\t\t\t\t// Reset election if no elected client, but eligible clients are connected.\n\t\t\t\t// This should be uncommon, but is possible if the initial state of the\n\t\t\t\t// ordered client election contains an undefined client id or one not found\n\t\t\t\t// in the quorum (the latter would already log an error).\n\t\t\t\tif (this.clientElection.eligibleCount > 0) {\n\t\t\t\t\tthis.clientElection.resetElectedClient(sequenceNumber);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst electionSequenceNumber = this.clientElection.electionSequenceNumber;\n\t\t\tconst opsWithoutSummary =\n\t\t\t\tsequenceNumber - (this.lastSummaryAckSeqForClient ?? electionSequenceNumber);\n\t\t\tif (opsWithoutSummary > this.maxOpsSinceLastSummary) {\n\t\t\t\t// Log and elect a new summarizer client.\n\t\t\t\tconst opsSinceLastReport = sequenceNumber - this.lastReportedSeq;\n\t\t\t\tif (opsSinceLastReport > this.maxOpsSinceLastSummary) {\n\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\teventName: \"ElectedClientNotSummarizing\",\n\t\t\t\t\t\telectedClientId,\n\t\t\t\t\t\tlastSummaryAckSeqForClient: this.lastSummaryAckSeqForClient,\n\t\t\t\t\t\telectionSequenceNumber,\n\t\t\t\t\t\tnextElectedClientId: this.clientElection.peekNextElectedClient()?.clientId,\n\t\t\t\t\t});\n\t\t\t\t\tthis.lastReportedSeq = sequenceNumber;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t// When a summary ack comes in, reset our op seq counter.\n\t\tthis.summaryCollection.on(MessageType.SummaryAck, (op) => {\n\t\t\tthis.lastSummaryAckSeqForClient = op.sequenceNumber;\n\t\t});\n\n\t\t// Use oldest client election for unanimously and deterministically deciding\n\t\t// which client should summarize.\n\t\tthis.clientElection.on(\"election\", (client, sequenceNumber) => {\n\t\t\tthis.lastSummaryAckSeqForClient = undefined;\n\t\t\tif (client === undefined && this.clientElection.eligibleCount > 0) {\n\t\t\t\t// If no client is valid for election, reset to the oldest again.\n\t\t\t\t// Also make extra sure not to get stuck in an infinite loop here:\n\t\t\t\t// If there are no eligible clients, just wait until a client joins\n\t\t\t\t// and will be auto-elected.\n\t\t\t\tthis.clientElection.resetElectedClient(sequenceNumber);\n\t\t\t}\n\t\t\t// Election can trigger a change in SummaryManager state.\n\t\t\tthis.emit(\"electedSummarizerChanged\");\n\t\t});\n\t}\n\n\tpublic serialize(): ISerializedElection {\n\t\tconst { electedClientId, electedParentId, electionSequenceNumber } =\n\t\t\tthis.clientElection.serialize();\n\t\treturn {\n\t\t\telectedClientId,\n\t\t\telectedParentId,\n\t\t\telectionSequenceNumber: this.lastSummaryAckSeqForClient ?? electionSequenceNumber,\n\t\t};\n\t}\n\n\tpublic static isClientEligible(client: ITrackedClient): boolean {\n\t\tconst details = client.client.details;\n\t\tif (details === undefined) {\n\t\t\t// Very old clients back-compat\n\t\t\treturn true;\n\t\t}\n\t\treturn SummarizerClientElection.clientDetailsPermitElection(details);\n\t}\n\n\tpublic static readonly clientDetailsPermitElection = (details: IClientDetails): boolean =>\n\t\tdetails.capabilities.interactive || details.type === summarizerClientType;\n}\n"]}
@@ -3,9 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
- import { ISummaryConfigurationHeuristics } from "../containerRuntime";
7
- import { ISummarizeHeuristicData, ISummarizeHeuristicRunner, ISummarizeAttempt, ISummaryHeuristicStrategy } from "./summarizerTypes";
8
- import { SummarizeReason } from "./summaryGenerator";
6
+ import { ISummaryConfigurationHeuristics } from "../containerRuntime.mjs";
7
+ import { ISummarizeHeuristicData, ISummarizeHeuristicRunner, ISummarizeAttempt, ISummaryHeuristicStrategy } from "./summarizerTypes.mjs";
8
+ import { SummarizeReason } from "./summaryGenerator.mjs";
9
9
  /** Simple implementation of class for tracking summarize heuristic data. */
10
10
  export declare class SummarizeHeuristicData implements ISummarizeHeuristicData {
11
11
  lastOpSequenceNumber: number;
@@ -58,4 +58,4 @@ export declare class SummarizeHeuristicRunner implements ISummarizeHeuristicRunn
58
58
  shouldRunLastSummary(): boolean;
59
59
  dispose(): void;
60
60
  }
61
- //# sourceMappingURL=summarizerHeuristics.d.ts.map
61
+ //# sourceMappingURL=summarizerHeuristics.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":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C,QAAQ,CAAC,mBAAmB;IARrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;gBAG/C,aAAa,EAAE,uBAAuB,EACtC,aAAa,EAAE,+BAA+B,EAC/D,YAAY,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,EAC9B,MAAM,EAAE,mBAAmB,EAC3B,mBAAmB,GAAE,yBAAyB,EAA2C;IAe3G,IAAW,QAAQ,IAAI,MAAM,CAiB5B;IAED,IAAW,eAAe,IAAI,MAAM,CAKnC;IAEM,KAAK;IAIL,GAAG;IAUH,oBAAoB,IAAI,OAAO;IAkB/B,OAAO;CAGd"}
@@ -148,4 +148,4 @@ class WeightedOpsSummaryHeuristicStrategy {
148
148
  function getDefaultSummaryHeuristicStrategies() {
149
149
  return [new MaxTimeSummaryHeuristicStrategy(), new WeightedOpsSummaryHeuristicStrategy()];
150
150
  }
151
- //# sourceMappingURL=summarizerHeuristics.js.map
151
+ //# sourceMappingURL=summarizerHeuristics.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerHeuristics.mjs","sourceRoot":"","sources":["../../src/summary/summarizerHeuristics.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,KAAK,EAAE,MAAM,4BAA4B;AAUlD,4EAA4E;AAC5E,MAAM,OAAO,sBAAsB;IAElC,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC1B,CAAC;IAGD,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACpC,CAAC;IAED,IAAW,mBAAmB;QAC7B,OAAO,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,mBAAmB,CAAC;IAC/D,CAAC;IAyBD,YACQ,oBAA4B;IACnC,wFAAwF;IACxF,eAAkC;QAF3B,yBAAoB,GAApB,oBAAoB,CAAQ;QAxB7B,qBAAgB,GAAY,KAAK,CAAC;QAElC,iB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A8B,SAAS,CAAC;IASxE,CAAC;IAPO,gBAAgB,CACtB,aAA8C,EAC9C,aAAsC;QAEtC,MAAM,oBAAoB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC,qBAAqB,CAAC,WAAW,CAAC;QAC1F,OAAO,oBAAoB,GAAG,aAAa,CAAC,OAAO,CAAC;IACrD,CAAC;CACD;AAED,SAAS,sBAAsB,CAC9B,cAAsB,EACtB,iBAAyB,EACzB,eAAuB,EACvB,kBAA0B;IAE1B,OAAO,eAAe,GAAG,cAAc,GAAG,kBAAkB,GAAG,iBAAiB,CAAC;AAClF,CAAC;AAED,2GAA2G;AAC3G,MAAM,mCAAmC;IAAzC;QACiB,oBAAe,GAA8B,QAAQ,CAAC;IAcvE,CAAC;IAZO,gBAAgB,CACtB,aAA8C,EAC9C,aAAsC;QAEtC,MAAM,gBAAgB,GAAG,sBAAsB,CAC9C,aAAa,CAAC,aAAa,EAC3B,aAAa,CAAC,gBAAgB,EAC9B,aAAa,CAAC,eAAe,EAC7B,aAAa,CAAC,kBAAkB,CAChC,CAAC;QACF,OAAO,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC;IAChD,CAAC;CACD;AAED,SAAS,oCAAoC;IAC5C,OAAO,CAAC,IAAI,+BAA+B,EAAE,EAAE,IAAI,mCAAmC,EAAE,CAAC,CAAC;AAC3F,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils\";\nimport { Timer } from \"@fluidframework/core-utils\";\nimport { ISummaryConfigurationHeuristics } from \"../containerRuntime\";\nimport {\n\tISummarizeHeuristicData,\n\tISummarizeHeuristicRunner,\n\tISummarizeAttempt,\n\tISummaryHeuristicStrategy,\n} from \"./summarizerTypes\";\nimport { SummarizeReason } from \"./summaryGenerator\";\n\n/** Simple implementation of class for tracking summarize heuristic data. */\nexport class SummarizeHeuristicData implements ISummarizeHeuristicData {\n\tprotected _lastAttempt: ISummarizeAttempt;\n\tpublic get lastAttempt(): ISummarizeAttempt {\n\t\treturn this._lastAttempt;\n\t}\n\n\tprotected _lastSuccessfulSummary: Readonly<ISummarizeAttempt>;\n\tpublic get lastSuccessfulSummary(): Readonly<ISummarizeAttempt> {\n\t\treturn this._lastSuccessfulSummary;\n\t}\n\n\tpublic get opsSinceLastSummary(): number {\n\t\treturn this.numNonRuntimeOpsBefore + this.numRuntimeOpsBefore;\n\t}\n\n\tpublic hasMissingOpData: boolean = false;\n\n\tpublic totalOpsSize: number = 0;\n\t/**\n\t * Cumulative size in bytes of all the ops at the beginning of the summarization attempt.\n\t * Is used to adjust totalOpsSize appropriately after successful summarization.\n\t */\n\tprivate totalOpsSizeBefore: number = 0;\n\n\tpublic numNonRuntimeOps: number = 0;\n\t/**\n\t * Number of non-runtime ops at beginning of attempting to summarize.\n\t * Is used to adjust numNonRuntimeOps appropriately after successful summarization.\n\t */\n\tprivate numNonRuntimeOpsBefore: number = 0;\n\n\tpublic numRuntimeOps: number = 0;\n\t/**\n\t * Number of runtime ops at beginning of attempting to summarize.\n\t * Is used to adjust numRuntimeOps appropriately after successful summarization.\n\t */\n\tprivate numRuntimeOpsBefore: number = 0;\n\n\tconstructor(\n\t\tpublic lastOpSequenceNumber: number,\n\t\t/** Baseline attempt data used for comparisons with subsequent attempts/calculations. */\n\t\tattemptBaseline: ISummarizeAttempt,\n\t) {\n\t\tthis._lastAttempt = attemptBaseline;\n\t\tthis._lastSuccessfulSummary = { ...attemptBaseline };\n\t}\n\n\tpublic updateWithLastSummaryAckInfo(lastSummary: Readonly<ISummarizeAttempt>) {\n\t\tthis._lastAttempt = lastSummary;\n\t\tthis._lastSuccessfulSummary = { ...lastSummary };\n\t}\n\n\tpublic recordAttempt(refSequenceNumber?: number) {\n\t\tthis._lastAttempt = {\n\t\t\trefSequenceNumber: refSequenceNumber ?? this.lastOpSequenceNumber,\n\t\t\tsummaryTime: Date.now(),\n\t\t};\n\n\t\tthis.numNonRuntimeOpsBefore = this.numNonRuntimeOps;\n\t\tthis.numRuntimeOpsBefore = this.numRuntimeOps;\n\t\tthis.totalOpsSizeBefore = this.totalOpsSize;\n\t}\n\n\tpublic markLastAttemptAsSuccessful() {\n\t\tthis._lastSuccessfulSummary = { ...this.lastAttempt };\n\n\t\tthis.numNonRuntimeOps -= this.numNonRuntimeOpsBefore;\n\t\tthis.numNonRuntimeOpsBefore = 0;\n\n\t\tthis.numRuntimeOps -= this.numRuntimeOpsBefore;\n\t\tthis.numRuntimeOpsBefore = 0;\n\n\t\tthis.totalOpsSize -= this.totalOpsSizeBefore;\n\t\tthis.totalOpsSizeBefore = 0;\n\t}\n}\n\n/**\n * This class contains the heuristics for when to summarize.\n */\nexport class SummarizeHeuristicRunner implements ISummarizeHeuristicRunner {\n\tprivate readonly idleTimer: Timer | undefined;\n\tprivate readonly runSummarize: (reason: SummarizeReason) => void;\n\n\tpublic constructor(\n\t\tprivate readonly heuristicData: ISummarizeHeuristicData,\n\t\tprivate readonly configuration: ISummaryConfigurationHeuristics,\n\t\ttrySummarize: (reason: SummarizeReason) => void,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t\tprivate readonly summarizeStrategies: ISummaryHeuristicStrategy[] = getDefaultSummaryHeuristicStrategies(),\n\t) {\n\t\tthis.idleTimer = new Timer(this.idleTime, () => this.runSummarize(\"idle\"));\n\n\t\tthis.runSummarize = (reason: SummarizeReason) => {\n\t\t\tthis.idleTimer?.clear();\n\n\t\t\t// We shouldn't attempt a summary if there are no new processed ops\n\t\t\tconst opsSinceLastAck = this.opsSinceLastAck;\n\t\t\tif (opsSinceLastAck > 0) {\n\t\t\t\ttrySummarize(reason);\n\t\t\t}\n\t\t};\n\t}\n\n\tpublic get idleTime(): number {\n\t\tconst maxIdleTime = this.configuration.maxIdleTime;\n\t\tconst minIdleTime = this.configuration.minIdleTime;\n\t\tconst weightedNumOfOps = getWeightedNumberOfOps(\n\t\t\tthis.heuristicData.numRuntimeOps,\n\t\t\tthis.heuristicData.numNonRuntimeOps,\n\t\t\tthis.configuration.runtimeOpWeight,\n\t\t\tthis.configuration.nonRuntimeOpWeight,\n\t\t);\n\t\tconst pToMaxOps = (weightedNumOfOps * 1.0) / this.configuration.maxOps;\n\n\t\tif (pToMaxOps >= 1) {\n\t\t\treturn minIdleTime;\n\t\t}\n\n\t\t// Return a ratioed idle time based on the percentage of ops\n\t\treturn maxIdleTime - (maxIdleTime - minIdleTime) * pToMaxOps;\n\t}\n\n\tpublic get opsSinceLastAck(): number {\n\t\treturn (\n\t\t\tthis.heuristicData.lastOpSequenceNumber -\n\t\t\tthis.heuristicData.lastSuccessfulSummary.refSequenceNumber\n\t\t);\n\t}\n\n\tpublic start() {\n\t\tthis.idleTimer?.start(this.idleTime);\n\t}\n\n\tpublic run() {\n\t\tfor (const strategy of this.summarizeStrategies) {\n\t\t\tif (strategy.shouldRunSummary(this.configuration, this.heuristicData)) {\n\t\t\t\treturn this.runSummarize(strategy.summarizeReason);\n\t\t\t}\n\t\t}\n\n\t\tthis.idleTimer?.restart(this.idleTime);\n\t}\n\n\tpublic shouldRunLastSummary(): boolean {\n\t\tconst weightedOpsSinceLastAck = getWeightedNumberOfOps(\n\t\t\tthis.heuristicData.numRuntimeOps,\n\t\t\tthis.heuristicData.numNonRuntimeOps,\n\t\t\tthis.configuration.runtimeOpWeight,\n\t\t\tthis.configuration.nonRuntimeOpWeight,\n\t\t);\n\t\tconst minOpsForLastSummaryAttempt = this.configuration.minOpsForLastSummaryAttempt;\n\n\t\tthis.logger.sendTelemetryEvent({\n\t\t\teventName: \"ShouldRunLastSummary\",\n\t\t\tweightedOpsSinceLastAck,\n\t\t\tminOpsForLastSummaryAttempt,\n\t\t});\n\n\t\treturn weightedOpsSinceLastAck >= minOpsForLastSummaryAttempt;\n\t}\n\n\tpublic dispose() {\n\t\tthis.idleTimer?.clear();\n\t}\n}\n\n/** Strategy used to run a summary when it's been a while since our last successful summary */\nclass MaxTimeSummaryHeuristicStrategy implements ISummaryHeuristicStrategy {\n\tpublic readonly summarizeReason: Readonly<SummarizeReason> = \"maxTime\";\n\n\tpublic shouldRunSummary(\n\t\tconfiguration: ISummaryConfigurationHeuristics,\n\t\theuristicData: ISummarizeHeuristicData,\n\t): boolean {\n\t\tconst timeSinceLastSummary = Date.now() - heuristicData.lastSuccessfulSummary.summaryTime;\n\t\treturn timeSinceLastSummary > configuration.maxTime;\n\t}\n}\n\nfunction getWeightedNumberOfOps(\n\truntimeOpCount: number,\n\tnonRuntimeOpCount: number,\n\truntimeOpWeight: number,\n\tnonRuntimeOpWeight: number,\n): number {\n\treturn runtimeOpWeight * runtimeOpCount + nonRuntimeOpWeight * nonRuntimeOpCount;\n}\n\n/** Strategy used to do a weighted analysis on the ops we've processed since the last successful summary */\nclass WeightedOpsSummaryHeuristicStrategy implements ISummaryHeuristicStrategy {\n\tpublic readonly summarizeReason: Readonly<SummarizeReason> = \"maxOps\";\n\n\tpublic shouldRunSummary(\n\t\tconfiguration: ISummaryConfigurationHeuristics,\n\t\theuristicData: ISummarizeHeuristicData,\n\t): boolean {\n\t\tconst weightedNumOfOps = getWeightedNumberOfOps(\n\t\t\theuristicData.numRuntimeOps,\n\t\t\theuristicData.numNonRuntimeOps,\n\t\t\tconfiguration.runtimeOpWeight,\n\t\t\tconfiguration.nonRuntimeOpWeight,\n\t\t);\n\t\treturn weightedNumOfOps > configuration.maxOps;\n\t}\n}\n\nfunction getDefaultSummaryHeuristicStrategies() {\n\treturn [new MaxTimeSummaryHeuristicStrategy(), new WeightedOpsSummaryHeuristicStrategy()];\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { IRefreshSummaryResult, ISummarizerNodeRootContract, ValidateSummaryResult, } from "./summarizerNodeUtils";
6
- export { IRootSummarizerNode, createRootSummarizerNode } from "./summarizerNode";
7
- export { IRootSummarizerNodeWithGC, createRootSummarizerNodeWithGC } from "./summarizerNodeWithGc";
8
- //# sourceMappingURL=index.d.ts.map
5
+ export { IRefreshSummaryResult, ISummarizerNodeRootContract, ValidateSummaryResult, } from "./summarizerNodeUtils.mjs";
6
+ export { IRootSummarizerNode, createRootSummarizerNode } from "./summarizerNode.mjs";
7
+ export { IRootSummarizerNodeWithGC, createRootSummarizerNodeWithGC } from "./summarizerNodeWithGc.mjs";
8
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,qBAAqB,EACrB,2BAA2B,EAC3B,qBAAqB,GACrB;OACM,EAAE,mBAAmB,EAAE,wBAAwB,EAAE;OACjD,EAAE,yBAAyB,EAAE,8BAA8B,EAAE"}
@@ -2,6 +2,6 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { createRootSummarizerNode } from "./summarizerNode";
6
- export { createRootSummarizerNodeWithGC } from "./summarizerNodeWithGc";
7
- //# sourceMappingURL=index.js.map
5
+ export { createRootSummarizerNode } from "./summarizerNode.mjs";
6
+ export { createRootSummarizerNodeWithGC } from "./summarizerNodeWithGc.mjs";
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/summary/summarizerNode/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAOI,EAAuB,wBAAwB,EAAE;OACjD,EAA6B,8BAA8B,EAAE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tIRefreshSummaryResult,\n\tISummarizerNodeRootContract,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils\";\nexport { IRootSummarizerNode, createRootSummarizerNode } from \"./summarizerNode\";\nexport { IRootSummarizerNodeWithGC, createRootSummarizerNodeWithGC } from \"./summarizerNodeWithGc\";\n"]}
@@ -6,7 +6,7 @@ import { ITelemetryBaseLogger, ITelemetryErrorEvent } from "@fluidframework/core
6
6
  import { ISummarizerNode, ISummarizerNodeConfig, ISummarizeResult, CreateChildSummarizerNodeParam, SummarizeInternalFn, ITelemetryContext } from "@fluidframework/runtime-definitions";
7
7
  import { ISequencedDocumentMessage, ISnapshotTree } from "@fluidframework/protocol-definitions";
8
8
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
9
- import { EscapedPath, ICreateChildDetails, IInitialSummary, IRefreshSummaryResult, ISummarizerNodeRootContract, SummaryNode, ValidateSummaryResult } from "./summarizerNodeUtils";
9
+ import { EscapedPath, ICreateChildDetails, IInitialSummary, IRefreshSummaryResult, ISummarizerNodeRootContract, SummaryNode, ValidateSummaryResult } from "./summarizerNodeUtils.mjs";
10
10
  export interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {
11
11
  }
12
12
  /**
@@ -164,4 +164,4 @@ export declare class SummarizerNode implements IRootSummarizerNode {
164
164
  * @param config - Configure behavior of summarizer node
165
165
  */
166
166
  export declare const createRootSummarizerNode: (logger: ITelemetryLoggerExt, summarizeInternalFn: SummarizeInternalFn, changeSequenceNumber: number, referenceSequenceNumber: number | undefined, config?: ISummarizerNodeConfig) => IRootSummarizerNode;
167
- //# sourceMappingURL=summarizerNode.d.ts.map
167
+ //# sourceMappingURL=summarizerNode.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerNode.d.mts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC;OACrF,EACN,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAEhB,8BAA8B,EAE9B,mBAAmB,EACnB,iBAAiB,EAEjB,MAAM,qCAAqC;OACrC,EACN,yBAA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eAAe;IAwBX,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAIxD;;;;;OAKG;IACH,SAAS,CAAC,wBAAwB,CACjC,EAAE,EAAE,MAAM,EACV,WAAW,EAAE,8BAA8B,GACzC,mBAAmB;IA2FtB;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM;IAoBjE,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW;IAI7D;;OAEG;IACI,mBAAmB,IAAI,OAAO;IAIrC;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,oBAAoB,GAAG,KAAK;CAWvE;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,WAC5B,mBAAmB,uBACN,mBAAmB,wBAClB,MAAM,2BACH,MAAM,GAAG,SAAS,WACnC,qBAAqB,KAC3B,mBAYD,CAAC"}
@@ -7,7 +7,7 @@ import { SummaryType, } from "@fluidframework/protocol-definitions";
7
7
  import { createChildLogger, LoggingError, PerformanceEvent, TelemetryDataTag, tagCodeArtifacts, } from "@fluidframework/telemetry-utils";
8
8
  import { assert, unreachableCase } from "@fluidframework/core-utils";
9
9
  import { convertToSummaryTree, calculateStats, mergeStats } from "@fluidframework/runtime-utils";
10
- import { EscapedPath, parseSummaryForSubtrees, parseSummaryTreeForSubtrees, SummaryNode, } from "./summarizerNodeUtils";
10
+ import { EscapedPath, parseSummaryForSubtrees, parseSummaryTreeForSubtrees, SummaryNode, } from "./summarizerNodeUtils.mjs";
11
11
  /**
12
12
  * Encapsulates the summarizing work and state of an individual tree node in the
13
13
  * summary tree. It tracks changes and allows for optimizations when unchanged, or
@@ -518,4 +518,4 @@ export class SummarizerNode {
518
518
  export const createRootSummarizerNode = (logger, summarizeInternalFn, changeSequenceNumber, referenceSequenceNumber, config = {}) => new SummarizerNode(logger, summarizeInternalFn, config, changeSequenceNumber, referenceSequenceNumber === undefined
519
519
  ? undefined
520
520
  : SummaryNode.createForRoot(referenceSequenceNumber), undefined /* initialSummary */, undefined /* wipSummaryLogger */, "" /* telemetryNodeId */);
521
- //# sourceMappingURL=summarizerNode.js.map
521
+ //# sourceMappingURL=summarizerNode.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerNode.mjs","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAMN,0BAA0B,GAI1B,MAAM,qCAAqC;OACrC,EAEN,WAAW,GAGX,MAAM,sCAAsC;OACtC,EAEN,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,iCAAiC;OACjC,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,4BAA4B;OAC7D,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,+BAA+B;OACzF,EACN,WAAW,EAKX,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,GAEX;AAID;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IAC1B;;;OAGG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,cAAc,EAAE,uBAAuB,IAAI,CAAC,CAAC;IAC1D,CAAC;IAUD;;;OAGG;IACH,YACC,UAAgC,EACf,mBAAwC,EACzD,MAA6B,EACrB,qBAA6B;IACrC,8CAA8C;IACtC,cAA4B,EACnB,cAAgC,EACvC,gBAAuC;IACjD,oEAAoE;IAC1D,eAAwB;QARjB,wBAAmB,GAAnB,mBAAmB,CAAqB;QAEjD,0BAAqB,GAArB,qBAAqB,CAAQ;QAE7B,mBAAc,GAAd,cAAc,CAAc;QACnB,mBAAc,GAAd,cAAc,CAAkB;QACvC,qBAAgB,GAAhB,gBAAgB,CAAuB;QAEvC,oBAAe,GAAf,eAAe,CAAS;QAtBhB,aAAQ,GAAG,IAAI,GAAG,EA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oBAAoB,EACpB,uBAAuB,KAAK,SAAS;IACpC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,CAAC,EACrD,SAAS,CAAC,oBAAoB,EAC9B,SAAS,CAAC,sBAAsB,EAChC,EAAE,CAAC,qBAAqB,CACxB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger, ITelemetryErrorEvent } from \"@fluidframework/core-interfaces\";\nimport {\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tSummarizeInternalFn,\n\tITelemetryContext,\n\tIExperimentalIncrementalSummaryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tISequencedDocumentMessage,\n\tSummaryType,\n\tISnapshotTree,\n\tSummaryObject,\n} from \"@fluidframework/protocol-definitions\";\nimport {\n\tITelemetryLoggerExt,\n\tcreateChildLogger,\n\tLoggingError,\n\tPerformanceEvent,\n\tTelemetryDataTag,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils\";\nimport { convertToSummaryTree, calculateStats, mergeStats } from \"@fluidframework/runtime-utils\";\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIInitialSummary,\n\tIRefreshSummaryResult,\n\tISummarizerNodeRootContract,\n\tparseSummaryForSubtrees,\n\tparseSummaryTreeForSubtrees,\n\tSummaryNode,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils\";\n\nexport interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRootContract {}\n\n/**\n * Encapsulates the summarizing work and state of an individual tree node in the\n * summary tree. It tracks changes and allows for optimizations when unchanged, or\n * can allow for fallback summaries to be generated when an error is encountered.\n * Usage is for the root node to call startSummary first to begin tracking a WIP\n * (work in progress) summary. Then all nodes will call summarize to summaries their\n * individual parts. Once completed and uploaded to storage, the root node will call\n * completeSummary or clearSummary to clear the WIP summary tracking state if something\n * went wrong. The SummarizerNodes will track all pending summaries that have been\n * recorded by the completeSummary call. When one of them is acked, the root node should\n * call refreshLatestSummary to inform the tree of SummarizerNodes of the new baseline\n * latest successful summary.\n */\nexport class SummarizerNode implements IRootSummarizerNode {\n\t/**\n\t * The reference sequence number of the most recent acked summary.\n\t * Returns 0 if there is not yet an acked summary.\n\t */\n\tpublic get referenceSequenceNumber() {\n\t\treturn this._latestSummary?.referenceSequenceNumber ?? 0;\n\t}\n\n\tprotected readonly children = new Map<string, SummarizerNode>();\n\tprotected readonly pendingSummaries = new Map<string, SummaryNode>();\n\tprotected wipReferenceSequenceNumber: number | undefined;\n\tprivate wipLocalPaths: { localPath: EscapedPath; additionalPath?: EscapedPath } | undefined;\n\tprivate wipSkipRecursion = false;\n\n\tprotected readonly logger: ITelemetryLoggerExt;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNode to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly summarizeInternalFn: SummarizeInternalFn,\n\t\tconfig: ISummarizerNodeConfig,\n\t\tprivate _changeSequenceNumber: number,\n\t\t/** Undefined means created without summary */\n\t\tprivate _latestSummary?: SummaryNode,\n\t\tprivate readonly initialSummary?: IInitialSummary,\n\t\tprotected wipSummaryLogger?: ITelemetryBaseLogger,\n\t\t/** A unique id of this node to be logged when sending telemetry. */\n\t\tprotected telemetryNodeId?: string,\n\t) {\n\t\tthis.canReuseHandle = config.canReuseHandle ?? true;\n\t\t// All logs posted by the summarizer node should include the telemetryNodeId.\n\t\tthis.logger = createChildLogger({\n\t\t\tlogger: baseLogger,\n\t\t\tproperties: {\n\t\t\t\tall: tagCodeArtifacts({ id: this.telemetryNodeId }),\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryBaseLogger) {\n\t\tassert(\n\t\t\tthis.wipSummaryLogger === undefined,\n\t\t\t0x19f /* \"wipSummaryLogger should not be set yet in startSummary\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber === undefined,\n\t\t\t0x1a0 /* \"Already tracking a summary\" */,\n\t\t);\n\n\t\tthis.wipSummaryLogger = summaryLogger;\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.startSummary(referenceSequenceNumber, this.wipSummaryLogger);\n\t\t}\n\t\tthis.wipReferenceSequenceNumber = referenceSequenceNumber;\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\tassert(\n\t\t\tthis.isSummaryInProgress(),\n\t\t\t0x1a1 /* \"summarize should not be called when not tracking the summary\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.wipSummaryLogger !== undefined,\n\t\t\t0x1a2 /* \"wipSummaryLogger should have been set in startSummary or ctor\" */,\n\t\t);\n\n\t\t// Try to reuse the tree if unchanged\n\t\tif (this.canReuseHandle && !fullTree && !this.hasChanged()) {\n\t\t\tconst latestSummary = this._latestSummary;\n\t\t\tif (latestSummary !== undefined) {\n\t\t\t\tthis.wipLocalPaths = {\n\t\t\t\t\tlocalPath: latestSummary.localPath,\n\t\t\t\t\tadditionalPath: latestSummary.additionalPath,\n\t\t\t\t};\n\t\t\t\tthis.wipSkipRecursion = true;\n\t\t\t\tconst stats = mergeStats();\n\t\t\t\tstats.handleNodeCount++;\n\t\t\t\treturn {\n\t\t\t\t\tsummary: {\n\t\t\t\t\t\ttype: SummaryType.Handle,\n\t\t\t\t\t\thandle: latestSummary.fullPath.path,\n\t\t\t\t\t\thandleType: SummaryType.Tree,\n\t\t\t\t\t},\n\t\t\t\t\tstats,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\t// This assert is the same the other 0a1x1 assert `isSummaryInProgress`, the only difference is that typescript\n\t\t// complains if this assert isn't done this way\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t0x5df /* Summarize should not be called when not tracking the summary */,\n\t\t);\n\t\tconst incrementalSummaryContext: IExperimentalIncrementalSummaryContext | undefined =\n\t\t\tthis._latestSummary !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\tsummarySequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t\t\t\tlatestSummarySequenceNumber: this._latestSummary.referenceSequenceNumber,\n\t\t\t\t\t\t// TODO: remove summaryPath\n\t\t\t\t\t\tsummaryPath: this._latestSummary.fullPath.path,\n\t\t\t\t }\n\t\t\t\t: undefined;\n\n\t\tconst result = await this.summarizeInternalFn(\n\t\t\tfullTree,\n\t\t\ttrue,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\t\tthis.wipLocalPaths = { localPath: EscapedPath.create(result.id) };\n\t\tif (result.pathPartsForChildren !== undefined) {\n\t\t\tthis.wipLocalPaths.additionalPath = EscapedPath.createAndConcat(\n\t\t\t\tresult.pathPartsForChildren,\n\t\t\t);\n\t\t}\n\t\treturn { summary: result.summary, stats: result.stats };\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct, i.e., summarize should have run for all non-skipped\n\t * nodes. This will only be called for the root summarizer node and is called by it recursively on all child nodes.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tpublic validateSummary(): ValidateSummaryResult {\n\t\treturn this.validateSummaryCore(false /* parentSkipRecursion */);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., summarize should have run for all\n\t * non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasSummarizeMissed(parentSkipRecursion)) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotSummarize\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\tif (parentSkipRecursion) {\n\t\t\treturn { success: true };\n\t\t}\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst result = child.validateSummaryCore(this.wipSkipRecursion || parentSkipRecursion);\n\t\t\t// If any child fails, return the failure.\n\t\t\tif (!result.success) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn { success: true };\n\t}\n\n\tprivate wasSummarizeMissed(parentSkipRecursion: boolean): boolean {\n\t\tassert(\n\t\t\tthis.wipSummaryLogger !== undefined,\n\t\t\t0x6fc /* wipSummaryLogger should have been set in startSummary or ctor */,\n\t\t);\n\t\tassert(this.wipReferenceSequenceNumber !== undefined, 0x6fd /* Not tracking a summary */);\n\n\t\t// If the parent node skipped recursion, it did not call summarize on this node. So, summarize was not missed\n\t\t// but was intentionally not called.\n\t\t// Otherwise, summarize should have been called on this node and wipLocalPaths must be set.\n\t\tif (parentSkipRecursion || this.wipLocalPaths !== undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * The absence of wip local path indicates that summarize was not called for this node. Return failure.\n\t\t * This can happen if:\n\t\t * 1. A child node was created after summarize was already called on the parent. For example, a data store\n\t\t * is realized (loaded) after summarize was called on it creating summarizer nodes for its DDSes. In this case,\n\t\t * parentSkipRecursion will be true and the if block above would handle it.\n\t\t * 2. A new node was created but summarize was never called on it. This can mean that the summary that is\n\t\t * generated may not have the data from this node. We should not continue, log and throw an error. This\n\t\t * will help us identify these cases and take appropriate action.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending summary\n\t * queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t */\n\tpublic completeSummary(proposalHandle: string, validate: boolean) {\n\t\tthis.completeSummaryCore(\n\t\t\tproposalHandle,\n\t\t\tundefined /* parentPath */,\n\t\t\tfalse /* parentSkipRecursion */,\n\t\t\tvalidate,\n\t\t);\n\t}\n\n\t/**\n\t * Recursive implementation for completeSummary, with additional internal-only parameters.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentPath - The path of the parent node which is used to build the path of this node.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t * @param validate - true to validate that the in-progress summary is correct for all nodes.\n\t */\n\tprotected completeSummaryCore(\n\t\tproposalHandle: string,\n\t\tparentPath: EscapedPath | undefined,\n\t\tparentSkipRecursion: boolean,\n\t\tvalidate: boolean,\n\t) {\n\t\tif (validate && this.wasSummarizeMissed(parentSkipRecursion)) {\n\t\t\tthis.throwUnexpectedError({\n\t\t\t\teventName: \"NodeDidNotSummarize\",\n\t\t\t\tproposalHandle,\n\t\t\t});\n\t\t}\n\n\t\tassert(this.wipReferenceSequenceNumber !== undefined, 0x1a4 /* \"Not tracking a summary\" */);\n\t\tlet localPathsToUse = this.wipLocalPaths;\n\n\t\tif (parentSkipRecursion) {\n\t\t\tconst latestSummary = this._latestSummary;\n\t\t\tif (latestSummary !== undefined) {\n\t\t\t\t// This case the parent node created a failure summary or was reused.\n\t\t\t\t// This node and all children should only try to reference their path\n\t\t\t\t// by its last known good state in the actual summary tree.\n\t\t\t\t// If parent fails or is reused, the child summarize is not called so\n\t\t\t\t// it did not get a chance to change its paths.\n\t\t\t\t// In this case, essentially only propagate the new summary ref seq num.\n\t\t\t\tlocalPathsToUse = {\n\t\t\t\t\tlocalPath: latestSummary.localPath,\n\t\t\t\t\tadditionalPath: latestSummary.additionalPath,\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// This case the child is added after the latest non-failure summary.\n\t\t\t\t// This node and all children should consider themselves as still not\n\t\t\t\t// having a successful summary yet.\n\t\t\t\t// We cannot \"reuse\" this node if unchanged since that summary, because\n\t\t\t\t// handles will be unable to point to that node. It never made it to the\n\t\t\t\t// tree itself, and only exists as an attach op in the _outstandingOps.\n\t\t\t\tthis.clearSummary();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If localPathsToUse is undefined, it means summarize didn't run for this node and in that case the validate\n\t\t// step should have failed.\n\t\tassert(localPathsToUse !== undefined, 0x6fe /* summarize didn't run for node */);\n\t\tconst summary = new SummaryNode({\n\t\t\t...localPathsToUse,\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\tbasePath: parentPath,\n\t\t});\n\t\tconst fullPathForChildren = summary.fullPathForChildren;\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.completeSummaryCore(\n\t\t\t\tproposalHandle,\n\t\t\t\tfullPathForChildren,\n\t\t\t\tthis.wipSkipRecursion || parentSkipRecursion,\n\t\t\t\tvalidate,\n\t\t\t);\n\t\t}\n\t\t// Note that this overwrites existing pending summary with\n\t\t// the same proposalHandle. If proposalHandle is something like\n\t\t// a hash or unique identifier, this should be fine. If storage\n\t\t// can return the same proposalHandle for a different summary,\n\t\t// this should still be okay, because we should be proposing the\n\t\t// newer one later which would have to overwrite the previous one.\n\t\tthis.pendingSummaries.set(proposalHandle, summary);\n\t\tthis.clearSummary();\n\t}\n\n\tpublic clearSummary() {\n\t\tthis.wipReferenceSequenceNumber = undefined;\n\t\tthis.wipLocalPaths = undefined;\n\t\tthis.wipSkipRecursion = false;\n\t\tthis.wipSummaryLogger = undefined;\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.clearSummary();\n\t\t}\n\t}\n\n\t/**\n\t * Refreshes the latest summary tracked by this node. If we have a pending summary for the given proposal handle,\n\t * it becomes the latest summary. If the current summary is already ahead, we skip the update.\n\t * If the current summary is behind, then we do not refresh.\n\t *\n\t * @returns true if the summary is tracked by this node, false otherwise.\n\t */\n\tpublic async refreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult> {\n\t\tconst eventProps: {\n\t\t\tproposalHandle: string | undefined;\n\t\t\tsummaryRefSeq: number;\n\t\t\treferenceSequenceNumber: number;\n\t\t\tisSummaryTracked?: boolean;\n\t\t\tpendingSummaryFound?: boolean;\n\t\t} = {\n\t\t\tproposalHandle,\n\t\t\tsummaryRefSeq,\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t};\n\t\treturn PerformanceEvent.timedExecAsync(\n\t\t\tthis.logger,\n\t\t\t{\n\t\t\t\teventName: \"refreshLatestSummary\",\n\t\t\t\t...eventProps,\n\t\t\t},\n\t\t\tasync (event) => {\n\t\t\t\t// Refresh latest summary should not happen while a summary is in progress. If it does, it can result\n\t\t\t\t// in inconsistent state, so, we should not continue;\n\t\t\t\tif (this.isSummaryInProgress()) {\n\t\t\t\t\tthrow new LoggingError(\"UnexpectedRefreshDuringSummarize\", {\n\t\t\t\t\t\tinProgressSummaryRefSeq: this.wipReferenceSequenceNumber,\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tlet isSummaryTracked = false;\n\t\t\t\tlet isSummaryNewer = false;\n\n\t\t\t\tif (summaryRefSeq > this.referenceSequenceNumber) {\n\t\t\t\t\tisSummaryNewer = true;\n\t\t\t\t}\n\t\t\t\tconst maybeSummaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\t\tif (maybeSummaryNode !== undefined) {\n\t\t\t\t\tthis.refreshLatestSummaryFromPending(\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\tmaybeSummaryNode.referenceSequenceNumber,\n\t\t\t\t\t);\n\t\t\t\t\tisSummaryTracked = true;\n\t\t\t\t}\n\t\t\t\tevent.end({ ...eventProps, isSummaryNewer, pendingSummaryFound: isSummaryTracked });\n\t\t\t\treturn { isSummaryTracked, isSummaryNewer };\n\t\t\t},\n\t\t\t{ start: true, end: true, cancel: \"error\" },\n\t\t);\n\t}\n\t/**\n\t * Called when we get an ack from the server for a summary we've just sent. Updates the reference state of this node\n\t * from the state in the pending summary queue.\n\t * @param proposalHandle - Handle for the current proposal.\n\t * @param referenceSequenceNumber - Reference sequence number of sent summary.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\tif (summaryNode === undefined) {\n\t\t\t// This should only happen if parent skipped recursion AND no prior summary existed.\n\t\t\tassert(\n\t\t\t\tthis._latestSummary === undefined,\n\t\t\t\t0x1a6 /* \"Not found pending summary, but this node has previously completed a summary\" */,\n\t\t\t);\n\t\t\treturn;\n\t\t} else {\n\t\t\tassert(\n\t\t\t\treferenceSequenceNumber === summaryNode.referenceSequenceNumber,\n\t\t\t\t0x1a7 /* Pending summary reference sequence number should be consistent */,\n\t\t\t);\n\n\t\t\t// Clear earlier pending summaries\n\t\t\tthis.pendingSummaries.delete(proposalHandle);\n\t\t}\n\n\t\tthis.refreshLatestSummaryCore(referenceSequenceNumber);\n\n\t\tthis._latestSummary = summaryNode;\n\t\t// Propagate update to all child nodes\n\t\tfor (const child of this.children.values()) {\n\t\t\tchild.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t\t}\n\t}\n\n\tprivate refreshLatestSummaryCore(referenceSequenceNumber: number): void {\n\t\tfor (const [key, value] of this.pendingSummaries) {\n\t\t\tif (value.referenceSequenceNumber < referenceSequenceNumber) {\n\t\t\t\tthis.pendingSummaries.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic updateBaseSummaryState(snapshot: ISnapshotTree) {\n\t\t// Check base summary to see if it has any additional path parts\n\t\t// separating child SummarizerNodes. Checks for .channels subtrees.\n\t\tconst { childrenPathPart } = parseSummaryForSubtrees(snapshot);\n\t\tif (childrenPathPart !== undefined && this._latestSummary !== undefined) {\n\t\t\tthis._latestSummary.additionalPath = EscapedPath.create(childrenPathPart);\n\t\t}\n\t}\n\n\tpublic recordChange(op: ISequencedDocumentMessage): void {\n\t\tthis.invalidate(op.sequenceNumber);\n\t}\n\n\tpublic invalidate(sequenceNumber: number): void {\n\t\tif (sequenceNumber > this._changeSequenceNumber) {\n\t\t\tthis._changeSequenceNumber = sequenceNumber;\n\t\t}\n\t}\n\n\t/**\n\t * True if a change has been recorded with sequence number exceeding\n\t * the latest successfully acked summary reference sequence number.\n\t * False implies that the previous summary can be reused.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this._changeSequenceNumber > this.referenceSequenceNumber;\n\t}\n\n\tpublic get latestSummary(): Readonly<SummaryNode> | undefined {\n\t\treturn this._latestSummary;\n\t}\n\n\tprotected readonly canReuseHandle: boolean;\n\n\tpublic createChild(\n\t\t/** Summarize function */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/** Initial id or path part of this node */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfig = {},\n\t): ISummarizerNode {\n\t\tassert(!this.children.has(id), 0x1ab /* \"Create SummarizerNode child already exists\" */);\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNode(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\tconfig,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.latestSummary,\n\t\t\tcreateDetails.initialSummary,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too. Same goes for pendingSummaries we might\n\t\t// have outstanding on the parent in case we realize nodes in between Summary Op and Summary Ack.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\tpublic getChild(id: string): ISummarizerNode | undefined {\n\t\treturn this.children.get(id);\n\t}\n\n\t/**\n\t * Returns the details needed to create a child node.\n\t * @param id - Initial id or path part of the child node.\n\t * @param createParam - Information needed to create the node.\n\t * @returns the details needed to create the child node.\n\t */\n\tprotected getCreateDetailsForChild(\n\t\tid: string,\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t): ICreateChildDetails {\n\t\tlet initialSummary: IInitialSummary | undefined;\n\t\tlet latestSummary: SummaryNode | undefined;\n\t\tlet changeSequenceNumber: number;\n\n\t\tconst parentLatestSummary = this._latestSummary;\n\t\tswitch (createParam.type) {\n\t\t\tcase CreateSummarizerNodeSource.FromAttach: {\n\t\t\t\tif (\n\t\t\t\t\tparentLatestSummary !== undefined &&\n\t\t\t\t\tcreateParam.sequenceNumber <= parentLatestSummary.referenceSequenceNumber\n\t\t\t\t) {\n\t\t\t\t\t// Prioritize latest summary if it was after this node was attached.\n\t\t\t\t\tlatestSummary = parentLatestSummary.createForChild(id);\n\t\t\t\t} else {\n\t\t\t\t\tconst summary = convertToSummaryTree(\n\t\t\t\t\t\tcreateParam.snapshot,\n\t\t\t\t\t) as ISummaryTreeWithStats;\n\t\t\t\t\tinitialSummary = {\n\t\t\t\t\t\tsequenceNumber: createParam.sequenceNumber,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tsummary,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tchangeSequenceNumber = createParam.sequenceNumber;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase CreateSummarizerNodeSource.FromSummary: {\n\t\t\t\tif (this.initialSummary === undefined) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\t!!parentLatestSummary,\n\t\t\t\t\t\t0x1ac /* \"Cannot create child from summary if parent does not have latest summary\" */,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t// fallthrough to local\n\t\t\t}\n\t\t\tcase CreateSummarizerNodeSource.Local: {\n\t\t\t\tconst parentInitialSummary = this.initialSummary;\n\t\t\t\tif (parentInitialSummary !== undefined) {\n\t\t\t\t\tlet childSummary: SummaryObject | undefined;\n\t\t\t\t\tif (parentInitialSummary.summary !== undefined) {\n\t\t\t\t\t\tconst { childrenTree } = parseSummaryTreeForSubtrees(\n\t\t\t\t\t\t\tparentInitialSummary.summary.summary,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tchildrenTree.type === SummaryType.Tree,\n\t\t\t\t\t\t\t0x1d6 /* \"Parent summary object is not a tree\" */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tchildSummary = childrenTree.tree[id];\n\t\t\t\t\t}\n\t\t\t\t\tif (createParam.type === CreateSummarizerNodeSource.FromSummary) {\n\t\t\t\t\t\t// Locally created would not have differential subtree.\n\t\t\t\t\t\tassert(!!childSummary, 0x1ad /* \"Missing child summary tree\" */);\n\t\t\t\t\t}\n\t\t\t\t\tlet childSummaryWithStats: ISummaryTreeWithStats | undefined;\n\t\t\t\t\tif (childSummary !== undefined) {\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\tchildSummary.type === SummaryType.Tree,\n\t\t\t\t\t\t\t0x1ae /* \"Child summary object is not a tree\" */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tchildSummaryWithStats = {\n\t\t\t\t\t\t\tsummary: childSummary,\n\t\t\t\t\t\t\tstats: calculateStats(childSummary),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tinitialSummary = {\n\t\t\t\t\t\tsequenceNumber: parentInitialSummary.sequenceNumber,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tsummary: childSummaryWithStats,\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tlatestSummary = parentLatestSummary?.createForChild(id);\n\t\t\t\tchangeSequenceNumber = parentLatestSummary?.referenceSequenceNumber ?? -1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tconst type = (createParam as unknown as CreateChildSummarizerNodeParam).type;\n\t\t\t\tunreachableCase(createParam, `Unexpected CreateSummarizerNodeSource: ${type}`);\n\t\t\t}\n\t\t}\n\n\t\tconst childtelemetryNodeId = `${this.telemetryNodeId ?? \"\"}/${id}`;\n\n\t\treturn {\n\t\t\tinitialSummary,\n\t\t\tlatestSummary,\n\t\t\tchangeSequenceNumber,\n\t\t\ttelemetryNodeId: childtelemetryNodeId,\n\t\t};\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t *\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNode, id: string) {\n\t\t// If a summary is in progress, this child was created after the summary started. So, we need to update the\n\t\t// child's summary state as well.\n\t\tif (this.isSummaryInProgress()) {\n\t\t\tchild.wipReferenceSequenceNumber = this.wipReferenceSequenceNumber;\n\t\t}\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tif (child._latestSummary !== undefined) {\n\t\t\tfor (const [key, value] of this.pendingSummaries.entries()) {\n\t\t\t\tconst newLatestSummaryNode = new SummaryNode({\n\t\t\t\t\treferenceSequenceNumber: value.referenceSequenceNumber,\n\t\t\t\t\tbasePath: child._latestSummary.basePath,\n\t\t\t\t\tlocalPath: child._latestSummary.localPath,\n\t\t\t\t});\n\n\t\t\t\tchild.addPendingSummary(key, newLatestSummaryNode);\n\t\t\t}\n\t\t}\n\t}\n\n\tprotected addPendingSummary(key: string, summary: SummaryNode) {\n\t\tthis.pendingSummaries.set(key, summary);\n\t}\n\n\t/**\n\t * Tells whether summary tracking is in progress. True if \"startSummary\" API is called before summarize.\n\t */\n\tpublic isSummaryInProgress(): boolean {\n\t\treturn this.wipReferenceSequenceNumber !== undefined;\n\t}\n\n\t/**\n\t * Creates and throws an error due to unexpected conditions.\n\t */\n\tprotected throwUnexpectedError(eventProps: ITelemetryErrorEvent): never {\n\t\tconst error = new LoggingError(eventProps.eventName, {\n\t\t\t...eventProps,\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t...tagCodeArtifacts({\n\t\t\t\tid: this.telemetryNodeId,\n\t\t\t}),\n\t\t});\n\t\tthis.logger.sendErrorEvent(eventProps, error);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Creates a root summarizer node.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n */\nexport const createRootSummarizerNode = (\n\tlogger: ITelemetryLoggerExt,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfig = {},\n): IRootSummarizerNode =>\n\tnew SummarizerNode(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber === undefined\n\t\t\t? undefined\n\t\t\t: SummaryNode.createForRoot(referenceSequenceNumber),\n\t\tundefined /* initialSummary */,\n\t\tundefined /* wipSummaryLogger */,\n\t\t\"\" /* telemetryNodeId */,\n\t);\n"]}
@@ -118,4 +118,4 @@ export declare function parseSummaryForSubtrees(baseSummary: ISnapshotTree): ISu
118
118
  * @param baseSummary - summary to check
119
119
  */
120
120
  export declare function parseSummaryTreeForSubtrees(summary: ISummaryTree): ISubtreeInfo<SummaryObject>;
121
- //# sourceMappingURL=summarizerNodeUtils.d.ts.map
121
+ //# sourceMappingURL=summarizerNodeUtils.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerNodeUtils.d.mts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iCAAiC;OAChF,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC;OAC1F,EAAoB,qBAAqB,EAAE,MAAM,qCAAqC;AAE7F,MAAM,WAAW,qBAAqB;IACrC,4DAA4D;IAC5D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sFAAsF;IACtF,cAAc,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IACA,OAAO,EAAE,IAAI,CAAC;CACb,GACD;IACA,OAAO,EAAE,KAAK,CAAC;IACf,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,EAAE,EAAE;QACH,GAAG,EAAE,gBAAgB,CAAC,YAAY,CAAC;QACnC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;KAC1B,CAAC;IACF,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEL,MAAM,WAAW,2BAA2B;IAC3C,YAAY,CAAC,uBAAuB,EAAE,MAAM,EAAE,aAAa,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACxF,eAAe,IAAI,qBAAqB,CAAC;IACzC,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IACjE,YAAY,IAAI,IAAI,CAAC;IACrB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M,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,sCAAsC;IACtC,cAAc,EAAE,eAAe,GAAG,SAAS,CAAC;IAC5C,2CAA2C;IAC3C,aAAa,EAAE,WAAW,GAAG,SAAS,CAAC;IACvC,yDAAyD;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa;IACpE,4CAA4C;IAC5C,YAAY,EAAE,CAAC,CAAC;IAChB,uDAAuD;IACvD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;CACrC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,aAAa,GAAG,YAAY,CAAC,aAAa,CAAC,CAa/F;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,YAAY,GAAG,YAAY,CAAC,aAAa,CAAC,CAa9F"}
@@ -120,4 +120,4 @@ export function parseSummaryTreeForSubtrees(summary) {
120
120
  childrenPathPart: undefined,
121
121
  };
122
122
  }
123
- //# sourceMappingURL=summarizerNodeUtils.js.map
123
+ //# sourceMappingURL=summarizerNodeUtils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerNodeUtils.mjs","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAII,EAAE,gBAAgB,EAAyB,MAAM,qCAAqC;AA0C7F,+DAA+D;AAC/D,MAAM,OAAO,WAAW;IACvB,YAAoC,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAC7C,MAAM,CAAC,MAAM,CAAC,IAAY;QAChC,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI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gBAAgB,CAAC,CAAC;IACvD,IAAI,eAAe,KAAK,SAAS,EAAE;QAClC,OAAO;YACN,YAAY,EAAE,eAAe;YAC7B,gBAAgB,EAAE,gBAAgB;SAClC,CAAC;KACF;IACD,OAAO;QACN,YAAY,EAAE,OAAO;QACrB,gBAAgB,EAAE,SAAS;KAC3B,CAAC;AACH,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, TelemetryDataTag } from \"@fluidframework/telemetry-utils\";\nimport { ISnapshotTree, ISummaryTree, SummaryObject } from \"@fluidframework/protocol-definitions\";\nimport { channelsTreeName, ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\n\nexport interface IRefreshSummaryResult {\n\t/** Tells whether this summary is tracked by this client. */\n\tisSummaryTracked: boolean;\n\t/** Tells whether this summary is newer than the latest one tracked by this client. */\n\tisSummaryNewer: boolean;\n}\n\n/**\n * Return type of validateSummary function. In case of success, the object returned should have success: true.\n * In case of failure, the object returned should have success: false and additional properties to indicate what\n * the failure was, where it was, can it be retried, etc.\n */\nexport type ValidateSummaryResult =\n\t| {\n\t\t\tsuccess: true;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\t/** The failure reason */\n\t\t\treason: string;\n\t\t\t/** id of the node that failed during validation */\n\t\t\tid: {\n\t\t\t\ttag: TelemetryDataTag.CodeArtifact;\n\t\t\t\tvalue: string | undefined;\n\t\t\t};\n\t\t\t/** If the error can be retried, time to wait before retrying */\n\t\t\tretryAfterSeconds?: number;\n\t };\n\nexport interface ISummarizerNodeRootContract {\n\tstartSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt): void;\n\tvalidateSummary(): ValidateSummaryResult;\n\tcompleteSummary(proposalHandle: string, validate: boolean): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult>;\n}\n\n/** Path for nodes in a tree with escaped special characters */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic static createAndConcat(pathParts: string[]): EscapedPath {\n\t\tlet ret = EscapedPath.create(pathParts[0] ?? \"\");\n\t\tfor (let i = 1; i < pathParts.length; i++) {\n\t\t\tret = ret.concat(EscapedPath.create(pathParts[i]));\n\t\t}\n\t\treturn ret;\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\tpublic concat(path: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(`${this.path}/${path.path}`);\n\t}\n}\n\n/** Information about a summary relevant to a specific node in the tree */\nexport class SummaryNode {\n\t/** Creates an instance that is valid for the root with specific basePath and localPath */\n\tpublic static createForRoot(referenceSequenceNumber: number): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber,\n\t\t\tbasePath: undefined,\n\t\t\tlocalPath: EscapedPath.create(\"\"), // root hard-coded to \"\"\n\t\t});\n\t}\n\n\t/** Summary reference sequence number, i.e. last sequence number seen when it was created */\n\tpublic get referenceSequenceNumber(): number {\n\t\treturn this.summary.referenceSequenceNumber;\n\t}\n\t/** Full path to parent node, or undefined if this is the root */\n\tpublic get basePath(): EscapedPath | undefined {\n\t\treturn this.summary.basePath;\n\t}\n\t/** Relative path to this node from its parent node */\n\tpublic get localPath(): EscapedPath {\n\t\treturn this.summary.localPath;\n\t}\n\t/** Relative path from this node to its node innermost base summary */\n\tpublic get additionalPath(): EscapedPath | undefined {\n\t\treturn this.summary.additionalPath;\n\t}\n\tpublic set additionalPath(additionalPath: EscapedPath | undefined) {\n\t\tthis.summary.additionalPath = additionalPath;\n\t}\n\tconstructor(\n\t\tprivate readonly summary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {}\n\n\t/** Gets the full path to this node, to be used when sending a handle */\n\tpublic get fullPath(): EscapedPath {\n\t\treturn this.basePath?.concat(this.localPath) ?? this.localPath;\n\t}\n\n\t/**\n\t * Gets the full path to this node's innermost base summary.\n\t * The children nodes can use this as their basePath to determine their path.\n\t */\n\tpublic get fullPathForChildren(): EscapedPath {\n\t\treturn this.additionalPath !== undefined\n\t\t\t? this.fullPath.concat(this.additionalPath)\n\t\t\t: this.fullPath;\n\t}\n\n\t/**\n\t * Creates a new node within the same summary for a child of this node.\n\t * @param id - id of the child node\n\t */\n\tpublic createForChild(id: string): SummaryNode {\n\t\treturn new SummaryNode({\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tbasePath: this.fullPathForChildren,\n\t\t\tlocalPath: EscapedPath.create(id),\n\t\t});\n\t}\n}\n\n/**\n * Information about the initial summary tree found from an attach op.\n */\nexport interface IInitialSummary {\n\tsequenceNumber: number;\n\tid: string;\n\tsummary: ISummaryTreeWithStats | undefined;\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\n\t/** Summary from attach op if known */\n\tinitialSummary: IInitialSummary | undefined;\n\t/** Latest summary from server node data */\n\tlatestSummary: SummaryNode | undefined;\n\t/** Sequence number of latest known change to the node */\n\tchangeSequenceNumber: number;\n\t/** A unique id of this child to be logged when sending telemetry. */\n\ttelemetryNodeId: string;\n}\n\nexport interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {\n\t/** Tree to use to find children subtrees */\n\tchildrenTree: T;\n\t/** Additional path part where children are isolated */\n\tchildrenPathPart: string | undefined;\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryForSubtrees(baseSummary: ISnapshotTree): ISubtreeInfo<ISnapshotTree> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = baseSummary.trees[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: baseSummary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n\n/**\n * Checks if the summary contains .channels subtree where the children subtrees\n * would be located if exists.\n * @param baseSummary - summary to check\n */\nexport function parseSummaryTreeForSubtrees(summary: ISummaryTree): ISubtreeInfo<SummaryObject> {\n\t// New versions of snapshots have child nodes isolated in .channels subtree\n\tconst channelsSubtree = summary.tree[channelsTreeName];\n\tif (channelsSubtree !== undefined) {\n\t\treturn {\n\t\t\tchildrenTree: channelsSubtree,\n\t\t\tchildrenPathPart: channelsTreeName,\n\t\t};\n\t}\n\treturn {\n\t\tchildrenTree: summary,\n\t\tchildrenPathPart: undefined,\n\t};\n}\n"]}
@@ -5,8 +5,8 @@
5
5
  import { ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
6
  import { CreateChildSummarizerNodeParam, IGarbageCollectionData, IGarbageCollectionDetailsBase, ISummarizeInternalResult, ISummarizeResult, ISummarizerNodeConfigWithGC, ISummarizerNodeWithGC, SummarizeInternalFn, ITelemetryContext, IExperimentalIncrementalSummaryContext } from "@fluidframework/runtime-definitions";
7
7
  import { ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
8
- import { SummarizerNode } from "./summarizerNode";
9
- import { EscapedPath, IInitialSummary, ISummarizerNodeRootContract, SummaryNode, ValidateSummaryResult } from "./summarizerNodeUtils";
8
+ import { SummarizerNode } from "./summarizerNode.mjs";
9
+ import { EscapedPath, IInitialSummary, ISummarizerNodeRootContract, SummaryNode, ValidateSummaryResult } from "./summarizerNodeUtils.mjs";
10
10
  export interface IRootSummarizerNodeWithGC extends ISummarizerNodeWithGC, ISummarizerNodeRootContract {
11
11
  }
12
12
  /**
@@ -150,4 +150,4 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
150
150
  * @param baseGCDetailsP - Function to get the initial GC details of this node
151
151
  */
152
152
  export declare const createRootSummarizerNodeWithGC: (logger: ITelemetryBaseLogger, summarizeInternalFn: SummarizeInternalFn, changeSequenceNumber: number, referenceSequenceNumber: number | undefined, config?: ISummarizerNodeConfigWithGC, getGCDataFn?: ((fullGC?: boolean) => Promise<IGarbageCollectionData>) | undefined, getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>) => IRootSummarizerNodeWithGC;
153
- //# sourceMappingURL=summarizerNodeWithGc.d.ts.map
153
+ //# sourceMappingURL=summarizerNodeWithGc.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerNodeWithGc.d.mts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,mBAAmB,EAInB,MAAM,iCAAiC;OAEjC,EACN,8BAA8B,EAC9B,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,EACxB,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,sCAAsC,EACtC,MAAM,qCAAqC;OAErC,EAAE,oBAAoB,EAAE,MAAM,iCAAiC;OAE/D,EAAE,cAAc,EAAE;OAClB,EACN,WAAW,EAEX,eAAe,EACf,2BAA2B,EAC3B,WAAW,EACX,qBAAqB,EACrB;AAED,MAAM,WAAW,yBAChB,SAAQ,qBAAqB,EAC5B,2BAA2B;CAAG;AAiBhC;;;;;;;;;;;;GAYG;AACH,qBAAa,oBAAqB,SAAQ,cAAe,YAAW,yBAAyB;IAkC3F,OAAO,CAAC,QAAQ,CAAC,WAAW;IAY5B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IA5C9B,OAAO,CAAC,uBAAuB,CAAqB;IAGpD,OAAO,CAAC,mBAAmB,CAAuB;IAGlD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6C;IAG5E,OAAO,CAAC,mBAAmB,CAAkB;IAG7C,OA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LoggingError, TelemetryDataTag, tagCodeArtifacts, } from "@fluidframework/telemetry-utils";
6
6
  import { assert, LazyPromise } from "@fluidframework/core-utils";
7
7
  import { unpackChildNodesUsedRoutes } from "@fluidframework/runtime-utils";
8
- import { cloneGCData, unpackChildNodesGCDetails } from "../../gc";
9
- import { SummarizerNode } from "./summarizerNode";
10
- import { SummaryNode, } from "./summarizerNodeUtils";
8
+ import { cloneGCData, unpackChildNodesGCDetails } from "../../gc/index.mjs";
9
+ import { SummarizerNode } from "./summarizerNode.mjs";
10
+ import { SummaryNode, } from "./summarizerNodeUtils.mjs";
11
11
  // Extend SummaryNode to add used routes tracking to it.
12
12
  class SummaryNodeWithGC extends SummaryNode {
13
13
  constructor(serializedUsedRoutes, summary) {
@@ -367,4 +367,4 @@ export class SummarizerNodeWithGC extends SummarizerNode {
367
367
  export const createRootSummarizerNodeWithGC = (logger, summarizeInternalFn, changeSequenceNumber, referenceSequenceNumber, config = {}, getGCDataFn, getBaseGCDetailsFn) => new SummarizerNodeWithGC(logger, summarizeInternalFn, config, changeSequenceNumber, referenceSequenceNumber === undefined
368
368
  ? undefined
369
369
  : SummaryNode.createForRoot(referenceSequenceNumber), undefined /* initialSummary */, undefined /* wipSummaryLogger */, getGCDataFn, getBaseGCDetailsFn, "" /* telemetryId */);
370
- //# sourceMappingURL=summarizerNodeWithGc.js.map
370
+ //# sourceMappingURL=summarizerNodeWithGc.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerNodeWithGc.mjs","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeWithGc.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAEN,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,GAChB,MAAM,iCAAiC;OACjC,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,4BAA4B;OAazD,EAAE,0BAA0B,EAAE,MAAM,+BAA+B;OAEnE,EAAE,WAAW,EAAE,yBAAyB,EAAE;OAC1C,EAAE,cAAc,E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AI,CAAC,UAAU,IAAI,IAAI,CAAC,mBAAmB,EAAE,EAAE;YACnD,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC/D;IACF,CAAC;IAED;;OAEG;IACO,UAAU;QACnB,OAAO,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC5D,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACK,mBAAmB;QAC1B,mEAAmE;QACnE,IAAI,IAAI,CAAC,UAAU,EAAE;YACpB,OAAO,KAAK,CAAC;SACb;QAED,OAAO,CACN,IAAI,CAAC,mBAAmB,KAAK,SAAS;YACtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAC5E,CAAC;IACH,CAAC;CACD;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAC7C,MAA4B,EAC5B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAsC,EAAE,EACxC,WAAmE,EACnE,kBAAiE,EACrC,EAAE,CAC9B,IAAI,oBAAoB,CACvB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,oBAAoB,EACpB,uBAAuB,KAAK,SAAS;IACpC,CAAC,CAAC,SAAS;IACX,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,uBAAuB,CAAC,EACrD,SAAS,CAAC,oBAAoB,EAC9B,SAAS,CAAC,sBAAsB,EAChC,WAAW,EACX,kBAAkB,EAClB,EAAE,CAAC,iBAAiB,CACpB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tITelemetryLoggerExt,\n\tLoggingError,\n\tTelemetryDataTag,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils\";\nimport { assert, LazyPromise } from \"@fluidframework/core-utils\";\nimport {\n\tCreateChildSummarizerNodeParam,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeInternalResult,\n\tISummarizeResult,\n\tISummarizerNodeConfigWithGC,\n\tISummarizerNodeWithGC,\n\tSummarizeInternalFn,\n\tITelemetryContext,\n\tIExperimentalIncrementalSummaryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport { unpackChildNodesUsedRoutes } from \"@fluidframework/runtime-utils\";\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { cloneGCData, unpackChildNodesGCDetails } from \"../../gc\";\nimport { SummarizerNode } from \"./summarizerNode\";\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIInitialSummary,\n\tISummarizerNodeRootContract,\n\tSummaryNode,\n\tValidateSummaryResult,\n} from \"./summarizerNodeUtils\";\n\nexport interface IRootSummarizerNodeWithGC\n\textends ISummarizerNodeWithGC,\n\t\tISummarizerNodeRootContract {}\n\n// Extend SummaryNode to add used routes tracking to it.\nclass SummaryNodeWithGC extends SummaryNode {\n\tconstructor(\n\t\tpublic readonly serializedUsedRoutes: string | undefined,\n\t\tsummary: {\n\t\t\treadonly referenceSequenceNumber: number;\n\t\t\treadonly basePath: EscapedPath | undefined;\n\t\t\treadonly localPath: EscapedPath;\n\t\t\tadditionalPath?: EscapedPath;\n\t\t},\n\t) {\n\t\tsuper(summary);\n\t}\n}\n\n/**\n * Extends the functionality of SummarizerNode to manage this node's garbage collection data:\n *\n * - Adds a new API `getGCData` to return GC data of this node.\n *\n * - Caches the result of `getGCData` to be used if nothing changes between summaries.\n *\n * - Manages the used routes of this node. These are used to identify if this node is referenced in the document\n * and to determine if the node's used state changed since last summary.\n *\n * - Adds trackState param to summarize. If trackState is false, it bypasses the SummarizerNode and calls\n * directly into summarizeInternal method.\n */\nexport class SummarizerNodeWithGC extends SummarizerNode implements IRootSummarizerNodeWithGC {\n\t// Tracks the work-in-progress used routes during summary.\n\tprivate wipSerializedUsedRoutes: string | undefined;\n\n\t// This is the last known used routes of this node as seen by the server as part of a summary.\n\tprivate referenceUsedRoutes: string[] | undefined;\n\n\t// The base GC details of this node used to initialize the GC state.\n\tprivate readonly baseGCDetailsP: LazyPromise<IGarbageCollectionDetailsBase>;\n\n\t// Keeps track of whether we have loaded the base details to ensure that we only do it once.\n\tprivate baseGCDetailsLoaded: boolean = false;\n\n\t// The base GC details for the child nodes. This is passed to child nodes when creating them.\n\tprivate readonly childNodesBaseGCDetailsP: LazyPromise<\n\t\tMap<string, IGarbageCollectionDetailsBase>\n\t>;\n\n\tprivate gcData: IGarbageCollectionData | undefined;\n\n\t// Set used routes to have self route by default. This makes the node referenced by default. This is done to ensure\n\t// that this node is not marked as collected when running GC has been disabled. Once, the option to disable GC is\n\t// removed (from runGC flag in IContainerRuntimeOptions), this should be changed to be have no routes by default.\n\tprivate usedRoutes: string[] = [\"\"];\n\n\t// True if GC is disabled for this node. If so, do not track GC specific state for a summary.\n\tprivate readonly gcDisabled: boolean;\n\n\t/**\n\t * Do not call constructor directly.\n\t * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.\n\t */\n\tpublic constructor(\n\t\tlogger: ITelemetryBaseLogger,\n\t\tprivate readonly summarizeFn: (\n\t\t\tfullTree: boolean,\n\t\t\ttrackState: boolean,\n\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t) => Promise<ISummarizeInternalResult>,\n\t\tconfig: ISummarizerNodeConfigWithGC,\n\t\tchangeSequenceNumber: number,\n\t\t/** Undefined means created without summary */\n\t\tlatestSummary?: SummaryNode,\n\t\tinitialSummary?: IInitialSummary,\n\t\twipSummaryLogger?: ITelemetryBaseLogger,\n\t\tprivate readonly getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t\t/** A unique id of this node to be logged when sending telemetry. */\n\t\ttelemetryId?: string,\n\t) {\n\t\tsuper(\n\t\t\tlogger,\n\t\t\tasync (\n\t\t\t\tfullTree: boolean,\n\t\t\t\t_trackState: boolean,\n\t\t\t\ttelemetryContext?: ITelemetryContext,\n\t\t\t\tincrementalSummaryContext?: IExperimentalIncrementalSummaryContext,\n\t\t\t) =>\n\t\t\t\tsummarizeFn(\n\t\t\t\t\tfullTree,\n\t\t\t\t\ttrue /* trackState */,\n\t\t\t\t\ttelemetryContext,\n\t\t\t\t\tincrementalSummaryContext,\n\t\t\t\t),\n\t\t\tconfig,\n\t\t\tchangeSequenceNumber,\n\t\t\tlatestSummary,\n\t\t\tinitialSummary,\n\t\t\twipSummaryLogger,\n\t\t\ttelemetryId,\n\t\t);\n\n\t\tthis.gcDisabled = config.gcDisabled === true;\n\n\t\tthis.baseGCDetailsP = new LazyPromise(async () => {\n\t\t\treturn (await getBaseGCDetailsFn?.()) ?? { usedRoutes: [] };\n\t\t});\n\n\t\tthis.childNodesBaseGCDetailsP = new LazyPromise(async () => {\n\t\t\tawait this.loadBaseGCDetails();\n\t\t\treturn unpackChildNodesGCDetails({ gcData: this.gcData, usedRoutes: this.usedRoutes });\n\t\t});\n\t}\n\n\t/**\n\t * Loads state from this node's initial GC summary details. This contains the following data from the last summary\n\t * seen by the server for this client:\n\t * - usedRoutes: This is used to figure out if the used state of this node changed since last summary.\n\t * - gcData: The garbage collection data of this node that is required for running GC.\n\t */\n\tprivate async loadBaseGCDetails() {\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tconst baseGCDetails = await this.baseGCDetailsP;\n\n\t\t// Possible race - If there were parallel calls to loadBaseGCDetails, we want to make sure that we update\n\t\t// the state from the base details only once.\n\t\tif (this.baseGCDetailsLoaded) {\n\t\t\treturn;\n\t\t}\n\t\tthis.baseGCDetailsLoaded = true;\n\n\t\t// Update GC data, used routes and reference used routes. The used routes are sorted because they are compared\n\t\t// across GC runs to check if they changed. Sorting ensures that the elements are in the same order.\n\t\t// If the GC details has GC data, initialize our GC data from it.\n\t\tif (baseGCDetails.gcData !== undefined) {\n\t\t\tthis.gcData = cloneGCData(baseGCDetails.gcData);\n\t\t}\n\t\tif (baseGCDetails.usedRoutes !== undefined) {\n\t\t\tthis.usedRoutes = Array.from(baseGCDetails.usedRoutes).sort();\n\t\t\tthis.referenceUsedRoutes = Array.from(baseGCDetails.usedRoutes).sort();\n\t\t}\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean = true,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummarizeResult> {\n\t\t// If GC is not disabled and a summary is in progress, GC should have run and updated the used routes for this\n\t\t// summary by calling updateUsedRoutes which sets wipSerializedUsedRoutes.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes !== undefined,\n\t\t\t\t0x1b1 /* \"wip used routes should be set if tracking a summary\" */,\n\t\t\t);\n\t\t}\n\n\t\t// If trackState is true, get summary from base summarizer node which tracks summary state.\n\t\t// If trackState is false, get summary from summarizeInternal.\n\t\treturn trackState\n\t\t\t? super.summarize(fullTree, true /* trackState */, telemetryContext)\n\t\t\t: this.summarizeFn(fullTree, trackState, telemetryContext);\n\t}\n\n\t/**\n\t * Returns the GC data of this node. If nothing has changed since last summary, it tries to reuse the data from\n\t * the previous summary. Else, it gets new GC data from the underlying Fluid object.\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tassert(\n\t\t\t!this.gcDisabled,\n\t\t\t0x1b2 /* \"Getting GC data should not be called when GC is disabled!\" */,\n\t\t);\n\t\tassert(\n\t\t\tthis.getGCDataFn !== undefined,\n\t\t\t0x1b3 /* \"GC data cannot be retrieved without getGCDataFn\" */,\n\t\t);\n\n\t\t// Load GC details from the initial summary, if not already loaded. If this is the first time this function is\n\t\t// called and the node's data has not changed since last summary, the GC data in initial details is returned.\n\t\tawait this.loadBaseGCDetails();\n\n\t\t// If there is no new data since last summary and we have GC data from the previous run, return it. The previous\n\t\t// GC data may not be available if loaded from a snapshot with either GC disabled or before GC was added.\n\t\t// Note - canReuseHandle is checked to be consistent with summarize - generate GC data for nodes for which\n\t\t// summary must be generated.\n\t\tif (this.canReuseHandle && !fullGC && !this.hasDataChanged() && this.gcData !== undefined) {\n\t\t\treturn cloneGCData(this.gcData);\n\t\t}\n\n\t\tconst gcData = await this.getGCDataFn(fullGC);\n\t\tthis.gcData = cloneGCData(gcData);\n\t\treturn gcData;\n\t}\n\n\t/**\n\t * Called during the start of a summary. Updates the work-in-progress used routes.\n\t */\n\tpublic startSummary(referenceSequenceNumber: number, summaryLogger: ITelemetryLoggerExt) {\n\t\t// If GC is disabled, skip setting wip used routes since we should not track GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tassert(\n\t\t\t\tthis.wipSerializedUsedRoutes === undefined,\n\t\t\t\t0x1b4 /* \"We should not already be tracking used routes when to track a new summary\" */,\n\t\t\t);\n\t\t}\n\t\tsuper.startSummary(referenceSequenceNumber, summaryLogger);\n\t}\n\n\t/**\n\t * Validates that the in-progress summary is correct for all nodes, i.e., GC should have run for non-skipped nodes.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when running GC.\n\t * In that case, the children will not have work-in-progress state.\n\t *\n\t * @returns ValidateSummaryResult which contains a boolean success indicating whether the validation was successful.\n\t * In case of failure, additional information is returned indicating type of failure and where it was.\n\t */\n\tprotected validateSummaryCore(parentSkipRecursion: boolean): ValidateSummaryResult {\n\t\tif (this.wasGCMissed()) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\treason: \"NodeDidNotRunGC\",\n\t\t\t\tid: {\n\t\t\t\t\ttag: TelemetryDataTag.CodeArtifact,\n\t\t\t\t\tvalue: this.telemetryNodeId,\n\t\t\t\t},\n\t\t\t\t// These errors are usually transient and should go away when summarize / GC is retried.\n\t\t\t\tretryAfterSeconds: 1,\n\t\t\t};\n\t\t}\n\t\treturn super.validateSummaryCore(parentSkipRecursion);\n\t}\n\n\tprivate wasGCMissed(): boolean {\n\t\t// If GC is disabled, it should not have run so it was not missed.\n\t\t// Otherwise, GC should have been called on this node and wipSerializedUsedRoutes must be set.\n\t\tif (this.gcDisabled || this.wipSerializedUsedRoutes !== undefined) {\n\t\t\treturn false;\n\t\t}\n\t\t/**\n\t\t * The absence of wip used routes indicates that GC was not run on this node. This can happen if:\n\t\t * 1. A child node was created after GC was already run on the parent. For example, a data store\n\t\t * is realized (loaded) after GC was run on it creating summarizer nodes for its DDSes. In this\n\t\t * case, the parent will pass on used routes to the child nodes and it will have wip used routes.\n\t\t * 2. A new node was created but GC was never run on it. This can mean that the GC data generated\n\t\t * during summarize is incomplete.\n\t\t *\n\t\t * This happens due to scenarios such as data store created during summarize. Such errors should go away when\n\t\t * summarize is attempted again.\n\t\t */\n\t\treturn true;\n\t}\n\n\t/**\n\t * Called after summary has been uploaded to the server. Add the work-in-progress state to the pending\n\t * summary queue. We track this until we get an ack from the server for this summary.\n\t * @param proposalHandle - The handle of the summary that was uploaded to the server.\n\t * @param parentPath - The path of the parent node which is used to build the path of this node.\n\t * @param parentSkipRecursion - true if the parent of this node skipped recursing the child nodes when summarizing.\n\t * In that case, the children will not have work-in-progress state.\n\t * @param validate - true to validate that the in-progress summary is correct for all nodes.\n\t */\n\tprotected completeSummaryCore(\n\t\tproposalHandle: string,\n\t\tparentPath: EscapedPath | undefined,\n\t\tparentSkipRecursion: boolean,\n\t\tvalidate: boolean,\n\t) {\n\t\tif (validate && this.wasGCMissed()) {\n\t\t\tthis.throwUnexpectedError({\n\t\t\t\teventName: \"NodeDidNotRunGC\",\n\t\t\t\tproposalHandle,\n\t\t\t});\n\t\t}\n\n\t\tlet wipSerializedUsedRoutes: string | undefined;\n\t\t// If GC is disabled, don't set wip used routes.\n\t\tif (!this.gcDisabled) {\n\t\t\twipSerializedUsedRoutes = this.wipSerializedUsedRoutes;\n\t\t}\n\n\t\tsuper.completeSummaryCore(proposalHandle, parentPath, parentSkipRecursion, validate);\n\n\t\t// If GC is disabled, skip setting pending summary with GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (summaryNode !== undefined) {\n\t\t\t\tconst summaryNodeWithGC = new SummaryNodeWithGC(\n\t\t\t\t\twipSerializedUsedRoutes,\n\t\t\t\t\tsummaryNode,\n\t\t\t\t);\n\t\t\t\tthis.pendingSummaries.set(proposalHandle, summaryNodeWithGC);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the work-in-progress state.\n\t */\n\tpublic clearSummary() {\n\t\tthis.wipSerializedUsedRoutes = undefined;\n\t\tsuper.clearSummary();\n\t}\n\n\t/**\n\t * Called when we get an ack from the server for a summary we sent. Update the reference state of this node\n\t * from the state in the pending summary queue.\n\t */\n\tprotected refreshLatestSummaryFromPending(\n\t\tproposalHandle: string,\n\t\treferenceSequenceNumber: number,\n\t): void {\n\t\t// If GC is disabled, skip setting referenced used routes since we are not tracking GC state.\n\t\tif (!this.gcDisabled) {\n\t\t\tconst summaryNode = this.pendingSummaries.get(proposalHandle);\n\t\t\tif (summaryNode !== undefined) {\n\t\t\t\t// If a pending summary exists, it must have used routes since GC is enabled.\n\t\t\t\tconst summaryNodeWithGC = summaryNode as SummaryNodeWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes === undefined) {\n\t\t\t\t\tconst error = new LoggingError(\"MissingGCStateInPendingSummary\", {\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\treferenceSequenceNumber,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tid: this.telemetryNodeId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t\tthis.logger.sendErrorEvent(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\teventName: error.message,\n\t\t\t\t\t\t},\n\t\t\t\t\t\terror,\n\t\t\t\t\t);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t\tthis.referenceUsedRoutes = JSON.parse(summaryNodeWithGC.serializedUsedRoutes);\n\t\t\t}\n\t\t}\n\n\t\treturn super.refreshLatestSummaryFromPending(proposalHandle, referenceSequenceNumber);\n\t}\n\n\t/**\n\t * Override the createChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic createChild(\n\t\t/** Summarize function */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/** Initial id or path part of this node */\n\t\tid: string,\n\t\t/**\n\t\t * Information needed to create the node.\n\t\t * If it is from a base summary, it will assert that a summary has been seen.\n\t\t * Attach information if it is created from an attach op.\n\t\t */\n\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\tconfig: ISummarizerNodeConfigWithGC = {},\n\t\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\t\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n\t): ISummarizerNodeWithGC {\n\t\tassert(!this.children.has(id), 0x1b6 /* \"Create SummarizerNode child already exists\" */);\n\t\t/**\n\t\t * Update the child node's base GC details from this node's current GC details instead of updating from the base\n\t\t * GC details of this node. This will handle scenarios where the GC details was updated during refresh from\n\t\t * snapshot and the child node wasn't created then. If a child is created after that, its GC details should be\n\t\t * the one from the downloaded snapshot and not the base GC details.\n\t\t */\n\t\tconst getChildBaseGCDetailsFn = async () => {\n\t\t\tconst childNodesBaseGCDetails = await this.childNodesBaseGCDetailsP;\n\t\t\treturn childNodesBaseGCDetails.get(id) ?? {};\n\t\t};\n\n\t\tconst createDetails: ICreateChildDetails = this.getCreateDetailsForChild(id, createParam);\n\t\tconst child = new SummarizerNodeWithGC(\n\t\t\tthis.logger,\n\t\t\tsummarizeInternalFn,\n\t\t\t{\n\t\t\t\t...config,\n\t\t\t\t// Propagate our gcDisabled state to the child if its not explicity specified in child's config.\n\t\t\t\tgcDisabled: config.gcDisabled ?? this.gcDisabled,\n\t\t\t},\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.latestSummary,\n\t\t\tcreateDetails.initialSummary,\n\t\t\tthis.wipSummaryLogger,\n\t\t\tgetGCDataFn,\n\t\t\tgetChildBaseGCDetailsFn,\n\t\t\tcreateDetails.telemetryNodeId,\n\t\t);\n\n\t\t// There may be additional state that has to be updated in this child. For example, if a summary is being\n\t\t// tracked, the child's summary tracking state needs to be updated too.\n\t\tthis.maybeUpdateChildState(child, id);\n\n\t\tthis.children.set(id, child);\n\t\treturn child;\n\t}\n\n\t/**\n\t * Updates the state of the child if required. For example, if a summary is currently being tracked, the child's\n\t * summary tracking state needs to be updated too.\n\t * Also, in case a child node gets realized in between Summary Op and Summary Ack, let's initialize the child's\n\t * pending summary as well. Finally, if the pendingSummaries entries have serializedRoutes, replicate them to the\n\t * pendingSummaries from the child nodes.\n\t * @param child - The child node whose state is to be updated.\n\t * @param id - Initial id or path part of this node\n\t */\n\tprotected maybeUpdateChildState(child: SummarizerNodeWithGC, id: string) {\n\t\tsuper.maybeUpdateChildState(child, id);\n\n\t\t// In case we have pending summaries on the parent, let's initialize it on the child.\n\t\tif (child.latestSummary !== undefined) {\n\t\t\tfor (const [key, value] of this.pendingSummaries.entries()) {\n\t\t\t\tconst summaryNodeWithGC = value as SummaryNodeWithGC;\n\t\t\t\tif (summaryNodeWithGC.serializedUsedRoutes !== undefined) {\n\t\t\t\t\tconst childNodeUsedRoutes = unpackChildNodesUsedRoutes(\n\t\t\t\t\t\tJSON.parse(summaryNodeWithGC.serializedUsedRoutes),\n\t\t\t\t\t);\n\t\t\t\t\tconst newSerializedRoutes = childNodeUsedRoutes.get(id) ?? [\"\"];\n\t\t\t\t\tconst newLatestSummaryNode = new SummaryNodeWithGC(\n\t\t\t\t\t\tJSON.stringify(newSerializedRoutes),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treferenceSequenceNumber: value.referenceSequenceNumber,\n\t\t\t\t\t\t\tbasePath: child.latestSummary.basePath,\n\t\t\t\t\t\t\tlocalPath: child.latestSummary.localPath,\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t\tchild.addPendingSummary(key, newLatestSummaryNode);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes the child node with the given id.\n\t */\n\tpublic deleteChild(id: string): void {\n\t\tthis.children.delete(id);\n\t}\n\n\t/**\n\t * Override the getChild method to return an instance of SummarizerNodeWithGC.\n\t */\n\tpublic getChild(id: string): ISummarizerNodeWithGC | undefined {\n\t\treturn this.children.get(id) as SummarizerNodeWithGC;\n\t}\n\n\tpublic isReferenced(): boolean {\n\t\treturn this.usedRoutes.includes(\"\") || this.usedRoutes.includes(\"/\");\n\t}\n\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Sort the given routes before updating. This will ensure that the routes compared in hasUsedStateChanged()\n\t\t// are in the same order.\n\t\tthis.usedRoutes = usedRoutes.sort();\n\n\t\t// If GC is not disabled and a summary is in progress, update the work-in-progress used routes so that it can\n\t\t// be tracked for this summary.\n\t\tif (!this.gcDisabled && this.isSummaryInProgress()) {\n\t\t\tthis.wipSerializedUsedRoutes = JSON.stringify(this.usedRoutes);\n\t\t}\n\t}\n\n\t/**\n\t * Override the hasChanged method. If this node data or its used state changed, the node is considered changed.\n\t */\n\tprotected hasChanged(): boolean {\n\t\treturn this.hasDataChanged() || this.hasUsedStateChanged();\n\t}\n\n\t/**\n\t * This tells whether the data in this node has changed or not.\n\t */\n\tprivate hasDataChanged(): boolean {\n\t\treturn super.hasChanged();\n\t}\n\n\t/**\n\t * This tells whether the used state of this node has changed since last successful summary. If the used routes\n\t * of this node changed, its used state is considered changed. Basically, if this node or any of its child nodes\n\t * was previously used and became unused (or vice versa), its used state has changed.\n\t */\n\tprivate hasUsedStateChanged(): boolean {\n\t\t// If GC is disabled, we are not tracking used state, return false.\n\t\tif (this.gcDisabled) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (\n\t\t\tthis.referenceUsedRoutes === undefined ||\n\t\t\tJSON.stringify(this.usedRoutes) !== JSON.stringify(this.referenceUsedRoutes)\n\t\t);\n\t}\n}\n\n/**\n * Creates a root summarizer node with GC functionality built-in.\n * @param logger - Logger to use within SummarizerNode\n * @param summarizeInternalFn - Function to generate summary\n * @param changeSequenceNumber - Sequence number of latest change to new node/subtree\n * @param referenceSequenceNumber - Reference sequence number of last acked summary,\n * or undefined if not loaded from summary\n * @param config - Configure behavior of summarizer node\n * @param getGCDataFn - Function to get the GC data of this node\n * @param baseGCDetailsP - Function to get the initial GC details of this node\n */\nexport const createRootSummarizerNodeWithGC = (\n\tlogger: ITelemetryBaseLogger,\n\tsummarizeInternalFn: SummarizeInternalFn,\n\tchangeSequenceNumber: number,\n\treferenceSequenceNumber: number | undefined,\n\tconfig: ISummarizerNodeConfigWithGC = {},\n\tgetGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,\n\tgetBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,\n): IRootSummarizerNodeWithGC =>\n\tnew SummarizerNodeWithGC(\n\t\tlogger,\n\t\tsummarizeInternalFn,\n\t\tconfig,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber === undefined\n\t\t\t? undefined\n\t\t\t: SummaryNode.createForRoot(referenceSequenceNumber),\n\t\tundefined /* initialSummary */,\n\t\tundefined /* wipSummaryLogger */,\n\t\tgetGCDataFn,\n\t\tgetBaseGCDetailsFn,\n\t\t\"\" /* telemetryId */,\n\t);\n"]}
@@ -7,9 +7,9 @@ import { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from "@fluidframewor
7
7
  import { ContainerWarning, IDeltaManager } from "@fluidframework/container-definitions";
8
8
  import { ISequencedDocumentMessage, ISummaryTree, IDocumentMessage } from "@fluidframework/protocol-definitions";
9
9
  import { ISummaryStats } from "@fluidframework/runtime-definitions";
10
- import { ISummaryConfigurationHeuristics } from "../containerRuntime";
11
- import { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from "./summaryCollection";
12
- import { SummarizeReason } from "./summaryGenerator";
10
+ import { ISummaryConfigurationHeuristics } from "../containerRuntime.mjs";
11
+ import { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from "./summaryCollection.mjs";
12
+ import { SummarizeReason } from "./summaryGenerator.mjs";
13
13
  /**
14
14
  * Similar to AbortSignal, but using promise instead of events
15
15
  * @param T - cancellation reason type
@@ -126,6 +126,8 @@ export interface ISubmitSummaryOptions extends ISummarizeOptions {
126
126
  export interface IOnDemandSummarizeOptions extends ISummarizeOptions {
127
127
  /** Reason for generating summary. */
128
128
  readonly reason: string;
129
+ /** In case of a failure, will attempt to retry based on if the failure is retriable. */
130
+ readonly retryOnFailure?: boolean;
129
131
  }
130
132
  /**
131
133
  * Options to use when enqueueing a summarize attempt.
@@ -361,7 +363,7 @@ export interface ISummarizerEvents extends IEvent {
361
363
  (event: "summarize", listener: (props: ISummarizeEventProps) => void): any;
362
364
  }
363
365
  /**
364
- * @internal
366
+ * @alpha
365
367
  */
366
368
  export interface ISummarizer extends IEventProvider<ISummarizerEvents> {
367
369
  /**
@@ -524,4 +526,4 @@ export interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {
524
526
  summarizerSuccessfulAttempts: () => number;
525
527
  }
526
528
  export {};
527
- //# sourceMappingURL=summarizerTypes.d.ts.map
529
+ //# sourceMappingURL=summarizerTypes.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerTypes.d.mts","sourceRoot":"","sources":["../../src/summary/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,MAAM,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,iCAAiC;OACvF,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,iCA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yDAAyD;GACvD,uBAAuB;AACzB,oHAAoH;GAClH,gBAAgB;AAClB,mHAAmH;GACjH,OAAO,CAAC;AAEX,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC3C,oBAAoB,EACpB,2CAA2C,CAC3C,GACA,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,2CAA2C,CAAC,CAAC,CAAC;AAElF,MAAM,WAAW,yBAA0B,SAAQ,2BAA2B;IAC7E,0CAA0C;IAC1C,cAAc,EAAE,MAAM,MAAM,CAAC;IAC7B,kDAAkD;IAClD,4BAA4B,EAAE,MAAM,MAAM,CAAC;CAC3C"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=summarizerTypes.js.map
6
+ //# sourceMappingURL=summarizerTypes.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summarizerTypes.mjs","sourceRoot":"","sources":["../../src/summary/summarizerTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IEvent, IEventProvider, ITelemetryProperties } from \"@fluidframework/core-interfaces\";\nimport { ITelemetryLoggerExt, ITelemetryLoggerPropertyBag } from \"@fluidframework/telemetry-utils\";\nimport { ContainerWarning, IDeltaManager } from \"@fluidframework/container-definitions\";\nimport {\n\tISequencedDocumentMessage,\n\tISummaryTree,\n\tIDocumentMessage,\n} from \"@fluidframework/protocol-definitions\";\nimport { ISummaryStats } from \"@fluidframework/runtime-definitions\";\nimport { ISummaryConfigurationHeuristics } from \"../containerRuntime\";\nimport { ISummaryAckMessage, ISummaryNackMessage, ISummaryOpMessage } from \"./summaryCollection\";\nimport { SummarizeReason } from \"./summaryGenerator\";\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @param T - cancellation reason type\n * @alpha\n */\nexport interface ICancellationToken<T> {\n\t/** Tells if this cancellable token is cancelled */\n\treadonly cancelled: boolean;\n\t/**\n\t * Promise that gets fulfilled when this cancellable token is cancelled\n\t * @returns reason of cancellation\n\t */\n\treadonly waitCancelled: Promise<T>;\n}\n\n/**\n * Similar to AbortSignal, but using promise instead of events\n * @alpha\n */\nexport type ISummaryCancellationToken = ICancellationToken<SummarizerStopReason>;\n\n/**\n * Data required to update internal tracking state after receiving a Summary Ack.\n * @alpha\n */\nexport interface IRefreshSummaryAckOptions {\n\t/** Handle from the ack's summary op. */\n\treadonly proposalHandle: string | undefined;\n\t/** Handle from the summary ack just received */\n\treadonly ackHandle: string;\n\t/** Reference sequence number from the ack's summary op */\n\treadonly summaryRefSeq: number;\n\t/** Telemetry logger to which telemetry events will be forwarded. */\n\treadonly summaryLogger: ITelemetryLoggerExt;\n}\n\n/**\n * @alpha\n */\nexport interface ISummarizerInternalsProvider {\n\t/** Encapsulates the work to walk the internals of the running container to generate a summary */\n\tsubmitSummary(options: ISubmitSummaryOptions): Promise<SubmitSummaryResult>;\n\n\t/** Callback whenever a new SummaryAck is received, to update internal tracking state */\n\trefreshLatestSummaryAck(options: IRefreshSummaryAckOptions): Promise<void>;\n}\n\n/**\n * @deprecated Options that control the behavior of a running summarizer.\n * @public\n * */\nexport interface ISummarizerOptions {\n\t/**\n\t * Set to true to disable the default heuristics from running; false by default.\n\t * This affects only the heuristics around when a summarizer should\n\t * submit summaries. So when it is disabled, summarizer clients should\n\t * not be expected to summarize unless an on-demand summary is requested.\n\t */\n\tdisableHeuristics: boolean;\n}\n\n/**\n * @internal\n */\nexport interface ISummarizingWarning extends ContainerWarning {\n\treadonly errorType: \"summarizingError\";\n\treadonly logged: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface IConnectableRuntime {\n\treadonly disposed: boolean;\n\treadonly connected: boolean;\n\treadonly clientId: string | undefined;\n\tonce(event: \"connected\" | \"disconnected\" | \"dispose\", listener: () => void): this;\n}\n\n/**\n * @alpha\n */\nexport interface ISummarizerRuntime extends IConnectableRuntime {\n\treadonly logger: ITelemetryLoggerExt;\n\t/** clientId of parent (non-summarizing) container that owns summarizer container */\n\treadonly summarizerClientId: string | undefined;\n\treadonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\tdisposeFn(): void;\n\tcloseFn(): void;\n\ton(\n\t\tevent: \"op\",\n\t\tlistener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,\n\t): this;\n\toff(\n\t\tevent: \"op\",\n\t\tlistener: (op: ISequencedDocumentMessage, runtimeMessage?: boolean) => void,\n\t): this;\n}\n\n/**\n * Options affecting summarize behavior.\n * @alpha\n */\nexport interface ISummarizeOptions {\n\t/** True to generate the full tree with no handle reuse optimizations; defaults to false */\n\treadonly fullTree?: boolean;\n\t/**\n\t * True to ask the server what the latest summary is first; defaults to false\n\t *\n\t * @deprecated Summarize will not refresh latest snapshot state anymore. Instead it updates the cache and closes.\n\t * It's expected a new summarizer client will be created, likely by the same parent.\n\t */\n\treadonly refreshLatestAck?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface ISubmitSummaryOptions extends ISummarizeOptions {\n\t/** Logger to use for correlated summary events */\n\treadonly summaryLogger: ITelemetryLoggerExt;\n\t/** Tells when summary process should be cancelled */\n\treadonly cancellationToken: ISummaryCancellationToken;\n\t/** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt. */\n\treadonly finalAttempt?: boolean;\n}\n\n/**\n * @alpha\n */\nexport interface IOnDemandSummarizeOptions extends ISummarizeOptions {\n\t/** Reason for generating summary. */\n\treadonly reason: string;\n\t/** In case of a failure, will attempt to retry based on if the failure is retriable. */\n\treadonly retryOnFailure?: boolean;\n}\n\n/**\n * Options to use when enqueueing a summarize attempt.\n * @alpha\n */\nexport interface IEnqueueSummarizeOptions extends IOnDemandSummarizeOptions {\n\t/** If specified, The summarize attempt will not occur until after this sequence number. */\n\treadonly afterSequenceNumber?: number;\n\n\t/**\n\t * True to override the existing enqueued summarize attempt if there is one.\n\t * This will guarantee that this attempt gets enqueued. If override is false,\n\t * than an existing enqueued summarize attempt will block a new one from being\n\t * enqueued. There can only be one enqueued at a time. Defaults to false.\n\t */\n\treadonly override?: boolean;\n}\n\n/**\n * In addition to the normal summary tree + stats, this contains additional stats\n * only relevant at the root of the tree.\n * @alpha\n */\nexport interface IGeneratedSummaryStats extends ISummaryStats {\n\t/** The total number of data stores in the container. */\n\treadonly dataStoreCount: number;\n\t/** The number of data stores that were summarized in this summary. */\n\treadonly summarizedDataStoreCount: number;\n\t/** The number of data stores whose GC reference state was updated in this summary. */\n\treadonly gcStateUpdatedDataStoreCount?: number;\n\t/** The size of the gc blobs in this summary. */\n\treadonly gcTotalBlobsSize?: number;\n\t/** The number of gc blobs in this summary. */\n\treadonly gcBlobNodeCount?: number;\n\t/** The summary number for a container's summary. Incremented on summaries throughout its lifetime. */\n\treadonly summaryNumber: number;\n}\n\n/**\n * Base results for all submitSummary attempts.\n * @alpha\n */\nexport interface IBaseSummarizeResult {\n\treadonly stage: \"base\";\n\t/** Error object related to failed summarize attempt. */\n\treadonly error: any;\n\t/** Reference sequence number as of the generate summary attempt. */\n\treadonly referenceSequenceNumber: number;\n\treadonly minimumSequenceNumber: number;\n}\n\n/**\n * Results of submitSummary after generating the summary tree.\n * @alpha\n */\nexport interface IGenerateSummaryTreeResult extends Omit<IBaseSummarizeResult, \"stage\"> {\n\treadonly stage: \"generate\";\n\t/** Generated summary tree. */\n\treadonly summaryTree: ISummaryTree;\n\t/** Stats for generated summary tree. */\n\treadonly summaryStats: IGeneratedSummaryStats;\n\t/** Time it took to generate the summary tree and stats. */\n\treadonly generateDuration: number;\n\t/** True if the full tree regeneration with no handle reuse optimizations was forced. */\n\treadonly forcedFullTree: boolean;\n}\n\n/**\n * Results of submitSummary after uploading the tree to storage.\n * @alpha\n */\nexport interface IUploadSummaryResult extends Omit<IGenerateSummaryTreeResult, \"stage\"> {\n\treadonly stage: \"upload\";\n\t/** The handle returned by storage pointing to the uploaded summary tree. */\n\treadonly handle: string;\n\t/** Time it took to upload the summary tree to storage. */\n\treadonly uploadDuration: number;\n}\n\n/**\n * Results of submitSummary after submitting the summarize op.\n * @alpha\n */\nexport interface ISubmitSummaryOpResult extends Omit<IUploadSummaryResult, \"stage\" | \"error\"> {\n\treadonly stage: \"submit\";\n\t/** The client sequence number of the summarize op submitted for the summary. */\n\treadonly clientSequenceNumber: number;\n\t/** Time it took to submit the summarize op to the broadcasting service. */\n\treadonly submitOpDuration: number;\n}\n\n/**\n * Strict type representing result of a submitSummary attempt.\n * The result consists of 4 possible stages, each with its own data.\n * The data is cumulative, so each stage will contain the data from the previous stages.\n * If the final \"submitted\" stage is not reached, the result may contain the error object.\n *\n * Stages:\n *\n * 1. \"base\" - stopped before the summary tree was even generated, and the result only contains the base data\n *\n * 2. \"generate\" - the summary tree was generated, and the result will contain that tree + stats\n *\n * 3. \"upload\" - the summary was uploaded to storage, and the result contains the server-provided handle\n *\n * 4. \"submit\" - the summarize op was submitted, and the result contains the op client sequence number.\n * @alpha\n */\nexport type SubmitSummaryResult =\n\t| IBaseSummarizeResult\n\t| IGenerateSummaryTreeResult\n\t| IUploadSummaryResult\n\t| ISubmitSummaryOpResult;\n\n/**\n * The stages of Summarize, used to describe how far progress succeeded in case of a failure at a later stage.\n * @alpha\n */\nexport type SummaryStage = SubmitSummaryResult[\"stage\"] | \"unknown\";\n\n/**\n * Type for summarization failures that are retriable.\n * @alpha\n */\nexport interface IRetriableFailureResult {\n\treadonly retryAfterSeconds?: number;\n}\n\n/**\n * The data in summarizer result when submit summary stage fails.\n * @alpha\n */\nexport interface SubmitSummaryFailureData extends IRetriableFailureResult {\n\tstage: SummaryStage;\n}\n\n/**\n * @alpha\n */\nexport interface IBroadcastSummaryResult {\n\treadonly summarizeOp: ISummaryOpMessage;\n\treadonly broadcastDuration: number;\n}\n\n/**\n * @alpha\n */\nexport interface IAckSummaryResult {\n\treadonly summaryAckOp: ISummaryAckMessage;\n\treadonly ackNackDuration: number;\n}\n\n/**\n * @alpha\n */\nexport interface INackSummaryResult extends IRetriableFailureResult {\n\treadonly summaryNackOp: ISummaryNackMessage;\n\treadonly ackNackDuration: number;\n}\n\n/**\n * @alpha\n */\nexport type SummarizeResultPart<TSuccess, TFailure = undefined> =\n\t| {\n\t\t\tsuccess: true;\n\t\t\tdata: TSuccess;\n\t }\n\t| {\n\t\t\tsuccess: false;\n\t\t\tdata: TFailure | undefined;\n\t\t\tmessage: string;\n\t\t\terror: any;\n\t };\n\n/**\n * @alpha\n */\nexport interface ISummarizeResults {\n\t/** Resolves when we generate, upload, and submit the summary. */\n\treadonly summarySubmitted: Promise<\n\t\tSummarizeResultPart<SubmitSummaryResult, SubmitSummaryFailureData>\n\t>;\n\t/** Resolves when we observe our summarize op broadcast. */\n\treadonly summaryOpBroadcasted: Promise<SummarizeResultPart<IBroadcastSummaryResult>>;\n\t/** Resolves when we receive a summaryAck or summaryNack. */\n\treadonly receivedSummaryAckOrNack: Promise<\n\t\tSummarizeResultPart<IAckSummaryResult, INackSummaryResult>\n\t>;\n}\n\n/**\n * @alpha\n */\nexport type EnqueueSummarizeResult =\n\t| (ISummarizeResults & {\n\t\t\t/**\n\t\t\t * Indicates that another summarize attempt is not already enqueued,\n\t\t\t * and this attempt has been enqueued.\n\t\t\t */\n\t\t\treadonly alreadyEnqueued?: undefined;\n\t })\n\t| (ISummarizeResults & {\n\t\t\t/** Indicates that another summarize attempt was already enqueued. */\n\t\t\treadonly alreadyEnqueued: true;\n\t\t\t/**\n\t\t\t * Indicates that the other enqueued summarize attempt was abandoned,\n\t\t\t * and this attempt has been enqueued enqueued.\n\t\t\t */\n\t\t\treadonly overridden: true;\n\t })\n\t| {\n\t\t\t/** Indicates that another summarize attempt was already enqueued. */\n\t\t\treadonly alreadyEnqueued: true;\n\t\t\t/**\n\t\t\t * Indicates that the other enqueued summarize attempt remains enqueued,\n\t\t\t * and this attempt has not been enqueued.\n\t\t\t */\n\t\t\treadonly overridden?: undefined;\n\t };\n\n/**\n * @alpha\n */\nexport type SummarizerStopReason =\n\t/** Summarizer client failed to summarize in all 3 consecutive attempts. */\n\t| \"failToSummarize\"\n\t/** Parent client reported that it is no longer connected. */\n\t| \"parentNotConnected\"\n\t/**\n\t * Parent client reported that it is no longer elected the summarizer.\n\t * This is the normal flow; a disconnect will always trigger the parent\n\t * client to no longer be elected as responsible for summaries. Then it\n\t * tries to stop its spawned summarizer client.\n\t */\n\t| \"notElectedParent\"\n\t/**\n\t * We are not already running the summarizer and we are not the current elected client id.\n\t */\n\t| \"notElectedClient\"\n\t/** Summarizer client was disconnected */\n\t| \"summarizerClientDisconnected\"\n\t/** running summarizer threw an exception */\n\t| \"summarizerException\"\n\t/**\n\t * The previous summary state on the summarizer is not the most recently acked summary. this also happens when the\n\t * first submitSummary attempt fails for any reason and there's a 2nd summary attempt without an ack\n\t */\n\t| \"latestSummaryStateStale\";\n\n/**\n * @alpha\n */\nexport interface ISummarizeEventProps {\n\tresult: \"success\" | \"failure\" | \"canceled\";\n\tcurrentAttempt: number;\n\tmaxAttempts: number;\n\terror?: any;\n}\n\n/**\n * @alpha\n */\nexport interface ISummarizerEvents extends IEvent {\n\t(event: \"summarize\", listener: (props: ISummarizeEventProps) => void);\n}\n\n/**\n * @alpha\n */\nexport interface ISummarizer extends IEventProvider<ISummarizerEvents> {\n\t/**\n\t * Allows {@link ISummarizer} to be used with our {@link @fluidframework/core-interfaces#FluidObject} pattern.\n\t */\n\treadonly ISummarizer?: ISummarizer;\n\n\t/*\n\t * Asks summarizer to move to exit.\n\t * Summarizer will finish current processes, which may take a while.\n\t * For example, summarizer may complete last summary before exiting.\n\t */\n\tstop(reason: SummarizerStopReason): void;\n\n\t/* Closes summarizer. Any pending processes (summary in flight) are abandoned. */\n\tclose(): void;\n\n\trun(onBehalfOf: string, disableHeuristics?: boolean): Promise<SummarizerStopReason>;\n\n\t/**\n\t * Attempts to generate a summary on demand. If already running, takes no action.\n\t * @param options - options controlling the summarize attempt\n\t * @returns an alreadyRunning promise if a summarize attempt is already in progress,\n\t * which will resolve when the current attempt completes. At that point caller can\n\t * decide to try again or not. Otherwise, it will return an object containing promises\n\t * that resolve as the summarize attempt progresses. They will resolve with success\n\t * false if a failure is encountered.\n\t */\n\tsummarizeOnDemand(options: IOnDemandSummarizeOptions): ISummarizeResults;\n\t/**\n\t * Enqueue an attempt to summarize after the specified sequence number.\n\t * If afterSequenceNumber is provided, the summarize attempt is \"enqueued\"\n\t * to run once an eligible op comes in with sequenceNumber \\>= afterSequenceNumber.\n\t * @param options - options controlling the summarize attempt\n\t * @returns an object containing an alreadyEnqueued flag to indicate if another\n\t * summarize attempt has already been enqueued. It also may contain an overridden flag\n\t * when alreadyEnqueued is true, that indicates whether this attempt forced the\n\t * previous attempt to abort. If this attempt becomes enqueued, it returns an object\n\t * containing promises that resolve as the summarize attempt progresses. They will\n\t * resolve with success false if a failure is encountered.\n\t */\n\tenqueueSummarize(options: IEnqueueSummarizeOptions): EnqueueSummarizeResult;\n}\n\n/** Data about an attempt to summarize used for heuristics. */\nexport interface ISummarizeAttempt {\n\t/** Reference sequence number when summary was generated or attempted */\n\treadonly refSequenceNumber: number;\n\n\t/** Time of summary attempt after it was sent or attempted */\n\treadonly summaryTime: number;\n\n\t/** Sequence number of summary op */\n\tsummarySequenceNumber?: number;\n}\n\n/** Data relevant for summary heuristics. */\nexport interface ISummarizeHeuristicData {\n\t/** Latest received op sequence number */\n\tlastOpSequenceNumber: number;\n\n\t/** Most recent summary attempt from this client */\n\treadonly lastAttempt: ISummarizeAttempt;\n\n\t/** Most recent summary that received an ack */\n\treadonly lastSuccessfulSummary: Readonly<ISummarizeAttempt>;\n\n\t/** Number of runtime ops since last summary */\n\tnumRuntimeOps: number;\n\n\t/** Number of non-runtime ops since last summary */\n\tnumNonRuntimeOps: number;\n\n\t/** Cumulative size in bytes of all the ops since the last summary */\n\ttotalOpsSize: number;\n\n\t/** Wether or not this instance contains adjusted metrics due to missing op data */\n\thasMissingOpData: boolean;\n\n\t/**\n\t * Updates lastAttempt and lastSuccessfulAttempt based on the last summary.\n\t * @param lastSummary - last ack summary\n\t */\n\tupdateWithLastSummaryAckInfo(lastSummary: ISummarizeAttempt): void;\n\n\t/**\n\t * Records a summary attempt. If the attempt was successfully sent,\n\t * provide the reference sequence number, otherwise it will be set\n\t * to the last seen op sequence number.\n\t * @param referenceSequenceNumber - reference sequence number of sent summary\n\t */\n\trecordAttempt(referenceSequenceNumber?: number): void;\n\n\t/** Mark that the last sent summary attempt has received an ack */\n\tmarkLastAttemptAsSuccessful(): void;\n\n\topsSinceLastSummary: number;\n}\n\n/** Responsible for running heuristics determining when to summarize. */\nexport interface ISummarizeHeuristicRunner {\n\t/** Start specific heuristic trackers (ex: idle timer) */\n\tstart(): void;\n\n\t/** Runs the heuristics to determine if it should try to summarize */\n\trun(): void;\n\n\t/** Runs a different heuristic to check if it should summarize before closing */\n\tshouldRunLastSummary(): boolean;\n\n\t/** Disposes of resources */\n\tdispose(): void;\n}\n\ntype ISummarizeTelemetryRequiredProperties =\n\t/** Reason code for attempting to summarize */\n\t\"summarizeReason\";\n\ntype ISummarizeTelemetryOptionalProperties =\n\t/** Number of attempts within the last time window, used for calculating the throttle delay. */\n\t| \"summaryAttempts\"\n\t/** Number of attempts within the current phase (currently capped at 2 ) */\n\t| \"summaryAttemptsPerPhase\"\n\t/** One-based count of phases we've attempted (used to index into an array of ISummarizeOptions */\n\t| \"summaryAttemptPhase\"\n\t/** Summarization may be attempted multiple times. This tells whether this is the final summarization attempt */\n\t| \"finalAttempt\"\n\t| keyof ISummarizeOptions;\n\nexport type ISummarizeTelemetryProperties = Pick<\n\tITelemetryProperties,\n\tISummarizeTelemetryRequiredProperties\n> &\n\tPartial<Pick<ITelemetryProperties, ISummarizeTelemetryOptionalProperties>>;\n\n/** Strategy used to heuristically determine when we should run a summary */\nexport interface ISummaryHeuristicStrategy {\n\t/** Summarize reason for this summarize heuristic strategy (ex: \"maxTime\") */\n\tsummarizeReason: Readonly<SummarizeReason>;\n\n\t/**\n\t * Determines if this strategy's summarize criteria been met\n\t * @param configuration - summary configuration we are to check against\n\t * @param heuristicData - heuristic data used to confirm conditions are met\n\t */\n\tshouldRunSummary(\n\t\tconfiguration: ISummaryConfigurationHeuristics,\n\t\theuristicData: ISummarizeHeuristicData,\n\t): boolean;\n}\n\ntype SummaryGeneratorRequiredTelemetryProperties =\n\t/** True to generate the full tree with no handle reuse optimizations */\n\t| \"fullTree\"\n\t/** Time since we last attempted to generate a summary */\n\t| \"timeSinceLastAttempt\"\n\t/** Time since we last successfully generated a summary */\n\t| \"timeSinceLastSummary\";\n\ntype SummaryGeneratorOptionalTelemetryProperties =\n\t/** Reference sequence number as of the generate summary attempt. */\n\t| \"referenceSequenceNumber\"\n\t/** minimum sequence number (at the reference sequence number) */\n\t| \"minimumSequenceNumber\"\n\t/** Delta between the current reference sequence number and the reference sequence number of the last attempt */\n\t| \"opsSinceLastAttempt\"\n\t/** Delta between the current reference sequence number and the reference sequence number of the last summary */\n\t| \"opsSinceLastSummary\"\n\t/**\n\t * Delta in sum of op sizes between the current reference sequence number and the reference\n\t * sequence number of the last summary\n\t */\n\t| \"opsSizesSinceLastSummary\"\n\t/** Delta between the number of non-runtime ops since the last summary */\n\t| \"nonRuntimeOpsSinceLastSummary\"\n\t/** Delta between the number of runtime ops since the last summary */\n\t| \"runtimeOpsSinceLastSummary\"\n\t/** Wether or not this instance contains adjusted metrics due to missing op data */\n\t| \"hasMissingOpData\"\n\t/** Time it took to generate the summary tree and stats. */\n\t| \"generateDuration\"\n\t/** The handle returned by storage pointing to the uploaded summary tree. */\n\t| \"handle\"\n\t/** Time it took to upload the summary tree to storage. */\n\t| \"uploadDuration\"\n\t/** The client sequence number of the summarize op submitted for the summary. */\n\t| \"clientSequenceNumber\"\n\t/** Time it took for this summary to be acked after it was generated */\n\t| \"ackWaitDuration\"\n\t/** Reference sequence number of the ack/nack message */\n\t| \"ackNackSequenceNumber\"\n\t/** Actual sequence number of the summary op proposal. */\n\t| \"summarySequenceNumber\"\n\t/** Optional Retry-After time in seconds. If specified, the client should wait this many seconds before retrying. */\n\t| \"nackRetryAfter\"\n\t/** The stage at which the submit summary method failed at. This can help determine what type of failure we have */\n\t| \"stage\";\n\nexport type SummaryGeneratorTelemetry = Pick<\n\tITelemetryProperties,\n\tSummaryGeneratorRequiredTelemetryProperties\n> &\n\tPartial<Pick<ITelemetryProperties, SummaryGeneratorOptionalTelemetryProperties>>;\n\nexport interface ISummarizeRunnerTelemetry extends ITelemetryLoggerPropertyBag {\n\t/** Number of times the summarizer run. */\n\tsummarizeCount: () => number;\n\t/** Number of successful attempts to summarize. */\n\tsummarizerSuccessfulAttempts: () => number;\n}\n"]}