@fluidframework/container-runtime 2.13.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/.eslintrc.cjs +36 -0
  2. package/CHANGELOG.md +46 -0
  3. package/api-report/container-runtime.legacy.alpha.api.md +9 -203
  4. package/container-runtime.test-files.tar +0 -0
  5. package/dist/batchTracker.d.ts.map +1 -1
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager/blobManager.d.ts +5 -1
  8. package/dist/blobManager/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager/blobManager.js +16 -2
  10. package/dist/blobManager/blobManager.js.map +1 -1
  11. package/dist/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  12. package/dist/blobManager/blobManagerSnapSum.js.map +1 -1
  13. package/dist/channelCollection.d.ts +23 -12
  14. package/dist/channelCollection.d.ts.map +1 -1
  15. package/dist/channelCollection.js +22 -12
  16. package/dist/channelCollection.js.map +1 -1
  17. package/dist/connectionTelemetry.d.ts.map +1 -1
  18. package/dist/connectionTelemetry.js +6 -2
  19. package/dist/connectionTelemetry.js.map +1 -1
  20. package/dist/containerHandleContext.d.ts +1 -1
  21. package/dist/containerHandleContext.d.ts.map +1 -1
  22. package/dist/containerHandleContext.js.map +1 -1
  23. package/dist/containerRuntime.d.ts +74 -65
  24. package/dist/containerRuntime.d.ts.map +1 -1
  25. package/dist/containerRuntime.js +53 -37
  26. package/dist/containerRuntime.js.map +1 -1
  27. package/dist/dataStore.d.ts +7 -3
  28. package/dist/dataStore.d.ts.map +1 -1
  29. package/dist/dataStore.js +2 -1
  30. package/dist/dataStore.js.map +1 -1
  31. package/dist/dataStoreContext.d.ts +41 -25
  32. package/dist/dataStoreContext.d.ts.map +1 -1
  33. package/dist/dataStoreContext.js +31 -18
  34. package/dist/dataStoreContext.js.map +1 -1
  35. package/dist/dataStoreContexts.d.ts +6 -2
  36. package/dist/dataStoreContexts.d.ts.map +1 -1
  37. package/dist/dataStoreContexts.js +6 -2
  38. package/dist/dataStoreContexts.js.map +1 -1
  39. package/dist/dataStoreRegistry.d.ts +1 -1
  40. package/dist/dataStoreRegistry.d.ts.map +1 -1
  41. package/dist/dataStoreRegistry.js.map +1 -1
  42. package/dist/deltaManagerProxies.d.ts +1 -17
  43. package/dist/deltaManagerProxies.d.ts.map +1 -1
  44. package/dist/deltaManagerProxies.js.map +1 -1
  45. package/dist/deltaScheduler.d.ts +9 -6
  46. package/dist/deltaScheduler.d.ts.map +1 -1
  47. package/dist/deltaScheduler.js +95 -89
  48. package/dist/deltaScheduler.js.map +1 -1
  49. package/dist/gc/garbageCollection.d.ts +21 -7
  50. package/dist/gc/garbageCollection.d.ts.map +1 -1
  51. package/dist/gc/garbageCollection.js +12 -5
  52. package/dist/gc/garbageCollection.js.map +1 -1
  53. package/dist/gc/gcConfigs.d.ts +11 -0
  54. package/dist/gc/gcConfigs.d.ts.map +1 -1
  55. package/dist/gc/gcConfigs.js +3 -2
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +210 -70
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +39 -13
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +6 -2
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js +6 -2
  64. package/dist/gc/gcHelpers.js.map +1 -1
  65. package/dist/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  66. package/dist/gc/gcSummaryDefinitions.d.ts +18 -6
  67. package/dist/gc/gcSummaryDefinitions.d.ts.map +1 -1
  68. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  69. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  70. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  71. package/dist/gc/gcTelemetry.d.ts +33 -11
  72. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  73. package/dist/gc/gcTelemetry.js +6 -2
  74. package/dist/gc/gcTelemetry.js.map +1 -1
  75. package/dist/gc/gcUnreferencedStateTracker.d.ts +42 -13
  76. package/dist/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  77. package/dist/gc/gcUnreferencedStateTracker.js +27 -9
  78. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  79. package/dist/gc/index.d.ts +1 -0
  80. package/dist/gc/index.d.ts.map +1 -1
  81. package/dist/gc/index.js +3 -1
  82. package/dist/gc/index.js.map +1 -1
  83. package/dist/inboundBatchAggregator.d.ts +34 -0
  84. package/dist/inboundBatchAggregator.d.ts.map +1 -0
  85. package/dist/inboundBatchAggregator.js +185 -0
  86. package/dist/inboundBatchAggregator.js.map +1 -0
  87. package/dist/index.d.ts +1 -1
  88. package/dist/index.d.ts.map +1 -1
  89. package/dist/index.js.map +1 -1
  90. package/dist/legacy.d.ts +0 -4
  91. package/dist/messageTypes.d.ts +14 -5
  92. package/dist/messageTypes.d.ts.map +1 -1
  93. package/dist/messageTypes.js.map +1 -1
  94. package/dist/metadata.d.ts +12 -4
  95. package/dist/metadata.d.ts.map +1 -1
  96. package/dist/metadata.js +6 -2
  97. package/dist/metadata.js.map +1 -1
  98. package/dist/opLifecycle/batchManager.d.ts +9 -3
  99. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  100. package/dist/opLifecycle/batchManager.js +3 -1
  101. package/dist/opLifecycle/batchManager.js.map +1 -1
  102. package/dist/opLifecycle/duplicateBatchDetector.d.ts +9 -3
  103. package/dist/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
  104. package/dist/opLifecycle/duplicateBatchDetector.js +9 -3
  105. package/dist/opLifecycle/duplicateBatchDetector.js.map +1 -1
  106. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  107. package/dist/opLifecycle/opCompressor.js.map +1 -1
  108. package/dist/opLifecycle/opDecompressor.d.ts +3 -1
  109. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  110. package/dist/opLifecycle/opDecompressor.js +12 -7
  111. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  112. package/dist/opLifecycle/opGroupingManager.d.ts +0 -1
  113. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  114. package/dist/opLifecycle/opGroupingManager.js +5 -4
  115. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  116. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  117. package/dist/opLifecycle/opSplitter.js +2 -0
  118. package/dist/opLifecycle/opSplitter.js.map +1 -1
  119. package/dist/opLifecycle/outbox.d.ts +1 -1
  120. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  121. package/dist/opLifecycle/outbox.js +6 -1
  122. package/dist/opLifecycle/outbox.js.map +1 -1
  123. package/dist/opLifecycle/remoteMessageProcessor.d.ts +9 -3
  124. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  125. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  126. package/dist/package.json +2 -1
  127. package/dist/packageVersion.d.ts +1 -1
  128. package/dist/packageVersion.js +1 -1
  129. package/dist/packageVersion.js.map +1 -1
  130. package/dist/pendingStateManager.d.ts +19 -7
  131. package/dist/pendingStateManager.d.ts.map +1 -1
  132. package/dist/pendingStateManager.js +13 -5
  133. package/dist/pendingStateManager.js.map +1 -1
  134. package/dist/summary/documentSchema.d.ts.map +1 -1
  135. package/dist/summary/documentSchema.js +2 -0
  136. package/dist/summary/documentSchema.js.map +1 -1
  137. package/dist/summary/index.d.ts +1 -1
  138. package/dist/summary/index.d.ts.map +1 -1
  139. package/dist/summary/index.js.map +1 -1
  140. package/dist/summary/orderedClientElection.d.ts +93 -31
  141. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  142. package/dist/summary/orderedClientElection.js +15 -5
  143. package/dist/summary/orderedClientElection.js.map +1 -1
  144. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  145. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  146. package/dist/summary/runningSummarizer.d.ts +17 -6
  147. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  148. package/dist/summary/runningSummarizer.js +12 -4
  149. package/dist/summary/runningSummarizer.js.map +1 -1
  150. package/dist/summary/summarizer.d.ts +9 -5
  151. package/dist/summary/summarizer.d.ts.map +1 -1
  152. package/dist/summary/summarizer.js +9 -3
  153. package/dist/summary/summarizer.js.map +1 -1
  154. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  155. package/dist/summary/summarizerClientElection.js.map +1 -1
  156. package/dist/summary/summarizerHeuristics.d.ts +6 -2
  157. package/dist/summary/summarizerHeuristics.d.ts.map +1 -1
  158. package/dist/summary/summarizerHeuristics.js +12 -4
  159. package/dist/summary/summarizerHeuristics.js.map +1 -1
  160. package/dist/summary/summarizerNode/summarizerNode.d.ts +24 -8
  161. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  162. package/dist/summary/summarizerNode/summarizerNode.js +15 -5
  163. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  164. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
  165. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  166. package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -1
  167. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  168. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +12 -4
  169. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  170. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +12 -4
  171. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  172. package/dist/summary/summarizerTypes.d.ts +246 -135
  173. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  174. package/dist/summary/summarizerTypes.js.map +1 -1
  175. package/dist/summary/summaryCollection.d.ts.map +1 -1
  176. package/dist/summary/summaryCollection.js +1 -2
  177. package/dist/summary/summaryCollection.js.map +1 -1
  178. package/dist/summary/summaryFormat.d.ts +24 -8
  179. package/dist/summary/summaryFormat.d.ts.map +1 -1
  180. package/dist/summary/summaryFormat.js.map +1 -1
  181. package/dist/summary/summaryGenerator.d.ts +9 -3
  182. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  183. package/dist/summary/summaryGenerator.js +3 -1
  184. package/dist/summary/summaryGenerator.js.map +1 -1
  185. package/dist/summary/summaryManager.d.ts +8 -4
  186. package/dist/summary/summaryManager.d.ts.map +1 -1
  187. package/dist/summary/summaryManager.js +12 -4
  188. package/dist/summary/summaryManager.js.map +1 -1
  189. package/dist/throttler.d.ts +26 -10
  190. package/dist/throttler.d.ts.map +1 -1
  191. package/dist/throttler.js +12 -4
  192. package/dist/throttler.js.map +1 -1
  193. package/lib/batchTracker.d.ts.map +1 -1
  194. package/lib/batchTracker.js.map +1 -1
  195. package/lib/blobManager/blobManager.d.ts +5 -1
  196. package/lib/blobManager/blobManager.d.ts.map +1 -1
  197. package/lib/blobManager/blobManager.js +16 -2
  198. package/lib/blobManager/blobManager.js.map +1 -1
  199. package/lib/blobManager/blobManagerSnapSum.d.ts.map +1 -1
  200. package/lib/blobManager/blobManagerSnapSum.js.map +1 -1
  201. package/lib/channelCollection.d.ts +23 -12
  202. package/lib/channelCollection.d.ts.map +1 -1
  203. package/lib/channelCollection.js +22 -12
  204. package/lib/channelCollection.js.map +1 -1
  205. package/lib/connectionTelemetry.d.ts.map +1 -1
  206. package/lib/connectionTelemetry.js +6 -2
  207. package/lib/connectionTelemetry.js.map +1 -1
  208. package/lib/containerHandleContext.d.ts +1 -1
  209. package/lib/containerHandleContext.d.ts.map +1 -1
  210. package/lib/containerHandleContext.js.map +1 -1
  211. package/lib/containerRuntime.d.ts +74 -65
  212. package/lib/containerRuntime.d.ts.map +1 -1
  213. package/lib/containerRuntime.js +53 -37
  214. package/lib/containerRuntime.js.map +1 -1
  215. package/lib/dataStore.d.ts +7 -3
  216. package/lib/dataStore.d.ts.map +1 -1
  217. package/lib/dataStore.js +2 -1
  218. package/lib/dataStore.js.map +1 -1
  219. package/lib/dataStoreContext.d.ts +41 -25
  220. package/lib/dataStoreContext.d.ts.map +1 -1
  221. package/lib/dataStoreContext.js +31 -18
  222. package/lib/dataStoreContext.js.map +1 -1
  223. package/lib/dataStoreContexts.d.ts +6 -2
  224. package/lib/dataStoreContexts.d.ts.map +1 -1
  225. package/lib/dataStoreContexts.js +6 -2
  226. package/lib/dataStoreContexts.js.map +1 -1
  227. package/lib/dataStoreRegistry.d.ts +1 -1
  228. package/lib/dataStoreRegistry.d.ts.map +1 -1
  229. package/lib/dataStoreRegistry.js.map +1 -1
  230. package/lib/deltaManagerProxies.d.ts +1 -17
  231. package/lib/deltaManagerProxies.d.ts.map +1 -1
  232. package/lib/deltaManagerProxies.js.map +1 -1
  233. package/lib/deltaScheduler.d.ts +9 -6
  234. package/lib/deltaScheduler.d.ts.map +1 -1
  235. package/lib/deltaScheduler.js +95 -89
  236. package/lib/deltaScheduler.js.map +1 -1
  237. package/lib/gc/garbageCollection.d.ts +21 -7
  238. package/lib/gc/garbageCollection.d.ts.map +1 -1
  239. package/lib/gc/garbageCollection.js +12 -5
  240. package/lib/gc/garbageCollection.js.map +1 -1
  241. package/lib/gc/gcConfigs.d.ts +11 -0
  242. package/lib/gc/gcConfigs.d.ts.map +1 -1
  243. package/lib/gc/gcConfigs.js +2 -2
  244. package/lib/gc/gcConfigs.js.map +1 -1
  245. package/lib/gc/gcDefinitions.d.ts +210 -70
  246. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  247. package/lib/gc/gcDefinitions.js +39 -13
  248. package/lib/gc/gcDefinitions.js.map +1 -1
  249. package/lib/gc/gcHelpers.d.ts +6 -2
  250. package/lib/gc/gcHelpers.d.ts.map +1 -1
  251. package/lib/gc/gcHelpers.js +6 -2
  252. package/lib/gc/gcHelpers.js.map +1 -1
  253. package/lib/gc/gcReferenceGraphAlgorithm.js.map +1 -1
  254. package/lib/gc/gcSummaryDefinitions.d.ts +18 -6
  255. package/lib/gc/gcSummaryDefinitions.d.ts.map +1 -1
  256. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  257. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  258. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  259. package/lib/gc/gcTelemetry.d.ts +33 -11
  260. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  261. package/lib/gc/gcTelemetry.js +6 -2
  262. package/lib/gc/gcTelemetry.js.map +1 -1
  263. package/lib/gc/gcUnreferencedStateTracker.d.ts +42 -13
  264. package/lib/gc/gcUnreferencedStateTracker.d.ts.map +1 -1
  265. package/lib/gc/gcUnreferencedStateTracker.js +27 -9
  266. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  267. package/lib/gc/index.d.ts +1 -0
  268. package/lib/gc/index.d.ts.map +1 -1
  269. package/lib/gc/index.js +1 -0
  270. package/lib/gc/index.js.map +1 -1
  271. package/lib/inboundBatchAggregator.d.ts +34 -0
  272. package/lib/inboundBatchAggregator.d.ts.map +1 -0
  273. package/lib/inboundBatchAggregator.js +181 -0
  274. package/lib/inboundBatchAggregator.js.map +1 -0
  275. package/lib/index.d.ts +1 -1
  276. package/lib/index.d.ts.map +1 -1
  277. package/lib/index.js.map +1 -1
  278. package/lib/legacy.d.ts +0 -4
  279. package/lib/messageTypes.d.ts +14 -5
  280. package/lib/messageTypes.d.ts.map +1 -1
  281. package/lib/messageTypes.js.map +1 -1
  282. package/lib/metadata.d.ts +12 -4
  283. package/lib/metadata.d.ts.map +1 -1
  284. package/lib/metadata.js +6 -2
  285. package/lib/metadata.js.map +1 -1
  286. package/lib/opLifecycle/batchManager.d.ts +9 -3
  287. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  288. package/lib/opLifecycle/batchManager.js +3 -1
  289. package/lib/opLifecycle/batchManager.js.map +1 -1
  290. package/lib/opLifecycle/duplicateBatchDetector.d.ts +9 -3
  291. package/lib/opLifecycle/duplicateBatchDetector.d.ts.map +1 -1
  292. package/lib/opLifecycle/duplicateBatchDetector.js +9 -3
  293. package/lib/opLifecycle/duplicateBatchDetector.js.map +1 -1
  294. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  295. package/lib/opLifecycle/opCompressor.js +1 -1
  296. package/lib/opLifecycle/opCompressor.js.map +1 -1
  297. package/lib/opLifecycle/opDecompressor.d.ts +3 -1
  298. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  299. package/lib/opLifecycle/opDecompressor.js +13 -8
  300. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  301. package/lib/opLifecycle/opGroupingManager.d.ts +0 -1
  302. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  303. package/lib/opLifecycle/opGroupingManager.js +6 -5
  304. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  305. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  306. package/lib/opLifecycle/opSplitter.js +2 -0
  307. package/lib/opLifecycle/opSplitter.js.map +1 -1
  308. package/lib/opLifecycle/outbox.d.ts +1 -1
  309. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  310. package/lib/opLifecycle/outbox.js +6 -1
  311. package/lib/opLifecycle/outbox.js.map +1 -1
  312. package/lib/opLifecycle/remoteMessageProcessor.d.ts +9 -3
  313. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  314. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  315. package/lib/packageVersion.d.ts +1 -1
  316. package/lib/packageVersion.js +1 -1
  317. package/lib/packageVersion.js.map +1 -1
  318. package/lib/pendingStateManager.d.ts +19 -7
  319. package/lib/pendingStateManager.d.ts.map +1 -1
  320. package/lib/pendingStateManager.js +13 -5
  321. package/lib/pendingStateManager.js.map +1 -1
  322. package/lib/summary/documentSchema.d.ts.map +1 -1
  323. package/lib/summary/documentSchema.js +2 -0
  324. package/lib/summary/documentSchema.js.map +1 -1
  325. package/lib/summary/index.d.ts +1 -1
  326. package/lib/summary/index.d.ts.map +1 -1
  327. package/lib/summary/index.js.map +1 -1
  328. package/lib/summary/orderedClientElection.d.ts +93 -31
  329. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  330. package/lib/summary/orderedClientElection.js +15 -5
  331. package/lib/summary/orderedClientElection.js.map +1 -1
  332. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  333. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  334. package/lib/summary/runningSummarizer.d.ts +17 -6
  335. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  336. package/lib/summary/runningSummarizer.js +12 -4
  337. package/lib/summary/runningSummarizer.js.map +1 -1
  338. package/lib/summary/summarizer.d.ts +9 -5
  339. package/lib/summary/summarizer.d.ts.map +1 -1
  340. package/lib/summary/summarizer.js +9 -3
  341. package/lib/summary/summarizer.js.map +1 -1
  342. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  343. package/lib/summary/summarizerClientElection.js.map +1 -1
  344. package/lib/summary/summarizerHeuristics.d.ts +6 -2
  345. package/lib/summary/summarizerHeuristics.d.ts.map +1 -1
  346. package/lib/summary/summarizerHeuristics.js +12 -4
  347. package/lib/summary/summarizerHeuristics.js.map +1 -1
  348. package/lib/summary/summarizerNode/summarizerNode.d.ts +24 -8
  349. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  350. package/lib/summary/summarizerNode/summarizerNode.js +15 -5
  351. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  352. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +48 -16
  353. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  354. package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -1
  355. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  356. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +12 -4
  357. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  358. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +12 -4
  359. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  360. package/lib/summary/summarizerTypes.d.ts +246 -135
  361. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  362. package/lib/summary/summarizerTypes.js.map +1 -1
  363. package/lib/summary/summaryCollection.d.ts.map +1 -1
  364. package/lib/summary/summaryCollection.js +1 -2
  365. package/lib/summary/summaryCollection.js.map +1 -1
  366. package/lib/summary/summaryFormat.d.ts +24 -8
  367. package/lib/summary/summaryFormat.d.ts.map +1 -1
  368. package/lib/summary/summaryFormat.js.map +1 -1
  369. package/lib/summary/summaryGenerator.d.ts +9 -3
  370. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  371. package/lib/summary/summaryGenerator.js +3 -1
  372. package/lib/summary/summaryGenerator.js.map +1 -1
  373. package/lib/summary/summaryManager.d.ts +8 -4
  374. package/lib/summary/summaryManager.d.ts.map +1 -1
  375. package/lib/summary/summaryManager.js +12 -4
  376. package/lib/summary/summaryManager.js.map +1 -1
  377. package/lib/throttler.d.ts +26 -10
  378. package/lib/throttler.d.ts.map +1 -1
  379. package/lib/throttler.js +12 -4
  380. package/lib/throttler.js.map +1 -1
  381. package/package.json +43 -30
  382. package/src/batchTracker.ts +31 -33
  383. package/src/blobManager/blobManager.ts +38 -19
  384. package/src/blobManager/blobManagerSnapSum.ts +2 -2
  385. package/src/channelCollection.ts +45 -38
  386. package/src/connectionTelemetry.ts +31 -13
  387. package/src/containerHandleContext.ts +2 -2
  388. package/src/containerRuntime.ts +199 -142
  389. package/src/dataStore.ts +11 -6
  390. package/src/dataStoreContext.ts +80 -59
  391. package/src/dataStoreContexts.ts +16 -12
  392. package/src/dataStoreRegistry.ts +1 -1
  393. package/src/deltaManagerProxies.ts +5 -5
  394. package/src/deltaScheduler.ts +19 -13
  395. package/src/gc/garbageCollection.ts +42 -20
  396. package/src/gc/gcConfigs.ts +4 -4
  397. package/src/gc/gcDefinitions.ts +212 -70
  398. package/src/gc/gcHelpers.ts +13 -7
  399. package/src/gc/gcReferenceGraphAlgorithm.ts +1 -1
  400. package/src/gc/gcSummaryDefinitions.ts +18 -6
  401. package/src/gc/gcSummaryStateTracker.ts +4 -2
  402. package/src/gc/gcTelemetry.ts +47 -19
  403. package/src/gc/gcUnreferencedStateTracker.ts +40 -16
  404. package/src/gc/index.ts +1 -0
  405. package/src/{scheduleManager.ts → inboundBatchAggregator.ts} +53 -120
  406. package/src/index.ts +0 -3
  407. package/src/messageTypes.ts +14 -5
  408. package/src/metadata.ts +12 -4
  409. package/src/opLifecycle/batchManager.ts +12 -6
  410. package/src/opLifecycle/duplicateBatchDetector.ts +10 -4
  411. package/src/opLifecycle/opCompressor.ts +8 -4
  412. package/src/opLifecycle/opDecompressor.ts +19 -10
  413. package/src/opLifecycle/opGroupingManager.ts +12 -8
  414. package/src/opLifecycle/opSplitter.ts +10 -7
  415. package/src/opLifecycle/outbox.ts +22 -13
  416. package/src/opLifecycle/remoteMessageProcessor.ts +10 -4
  417. package/src/packageVersion.ts +1 -1
  418. package/src/pendingStateManager.ts +34 -16
  419. package/src/summary/documentSchema.ts +30 -18
  420. package/src/summary/index.ts +0 -3
  421. package/src/summary/orderedClientElection.ts +100 -38
  422. package/src/summary/runWhileConnectedCoordinator.ts +6 -3
  423. package/src/summary/runningSummarizer.ts +38 -19
  424. package/src/summary/summarizer.ts +29 -16
  425. package/src/summary/summarizerClientElection.ts +2 -2
  426. package/src/summary/summarizerHeuristics.ts +22 -11
  427. package/src/summary/summarizerNode/summarizerNode.ts +22 -12
  428. package/src/summary/summarizerNode/summarizerNodeUtils.ts +48 -16
  429. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +21 -11
  430. package/src/summary/summarizerTypes.ts +246 -139
  431. package/src/summary/summaryCollection.ts +22 -23
  432. package/src/summary/summaryFormat.ts +24 -8
  433. package/src/summary/summaryGenerator.ts +14 -8
  434. package/src/summary/summaryManager.ts +28 -18
  435. package/src/throttler.ts +23 -11
  436. package/dist/scheduleManager.d.ts +0 -28
  437. package/dist/scheduleManager.d.ts.map +0 -1
  438. package/dist/scheduleManager.js +0 -233
  439. package/dist/scheduleManager.js.map +0 -1
  440. package/lib/scheduleManager.d.ts +0 -28
  441. package/lib/scheduleManager.d.ts.map +0 -1
  442. package/lib/scheduleManager.js +0 -229
  443. package/lib/scheduleManager.js.map +0 -1
@@ -6,7 +6,9 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SummarizeHeuristicRunner = exports.SummarizeHeuristicData = void 0;
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
- /** Simple implementation of class for tracking summarize heuristic data. */
9
+ /**
10
+ * Simple implementation of class for tracking summarize heuristic data.
11
+ */
10
12
  class SummarizeHeuristicData {
11
13
  get lastAttempt() {
12
14
  return this._lastAttempt;
@@ -18,7 +20,9 @@ class SummarizeHeuristicData {
18
20
  return this.numNonRuntimeOpsBefore + this.numRuntimeOpsBefore;
19
21
  }
20
22
  constructor(lastOpSequenceNumber,
21
- /** Baseline attempt data used for comparisons with subsequent attempts/calculations. */
23
+ /**
24
+ * Baseline attempt data used for comparisons with subsequent attempts/calculations.
25
+ */
22
26
  attemptBaseline) {
23
27
  this.lastOpSequenceNumber = lastOpSequenceNumber;
24
28
  this.hasMissingOpData = false;
@@ -127,7 +131,9 @@ class SummarizeHeuristicRunner {
127
131
  }
128
132
  }
129
133
  exports.SummarizeHeuristicRunner = SummarizeHeuristicRunner;
130
- /** Strategy used to run a summary when it's been a while since our last successful summary */
134
+ /**
135
+ * Strategy used to run a summary when it's been a while since our last successful summary
136
+ */
131
137
  class MaxTimeSummaryHeuristicStrategy {
132
138
  constructor() {
133
139
  this.summarizeReason = "maxTime";
@@ -140,7 +146,9 @@ class MaxTimeSummaryHeuristicStrategy {
140
146
  function getWeightedNumberOfOps(runtimeOpCount, nonRuntimeOpCount, runtimeOpWeight, nonRuntimeOpWeight) {
141
147
  return runtimeOpWeight * runtimeOpCount + nonRuntimeOpWeight * nonRuntimeOpCount;
142
148
  }
143
- /** Strategy used to do a weighted analysis on the ops we've processed since the last successful summary */
149
+ /**
150
+ * Strategy used to do a weighted analysis on the ops we've processed since the last successful summary
151
+ */
144
152
  class WeightedOpsSummaryHeuristicStrategy {
145
153
  constructor() {
146
154
  this.summarizeReason = "maxOps";
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerHeuristics.js","sourceRoot":"","sources":["../../src/summary/summarizerHeuristics.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4D;AAa5D,4EAA4E;AAC5E,MAAa,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,iBAAY,GAAW,CAAC,CAAC;QAChC;;;WAGG;QACK,uBAAkB,GAAW,CAAC,CAAC;QAEhC,qBAAgB,GAAW,CAAC,CAAC;QACpC;;;WAGG;QACK,2BAAsB,GAAW,CAAC,CAAC;QAEpC,kBAAa,GAAW,CAAC,CAAC;QACjC;;;WAGG;QACK,wBAAmB,GAAW,CAAC,CAAC;QAOvC,IAAI,CAAC,YAAY,GAAG,eAAe,CAAC;QACpC,IAAI,CAAC,sBAAsB,GAAG,EAAE,GAAG,eAAe,EAAE,CAAC;IACtD,CAAC;IAEM,4BAA4B,CAAC,WAAwC;QAC3E,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,sBAAsB,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC;IAClD,CAAC;IAEM,aAAa,CAAC,iBAA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BAAe,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 { Timer } from \"@fluidframework/core-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ISummaryConfigurationHeuristics } from \"../containerRuntime.js\";\n\nimport {\n\tISummarizeAttempt,\n\tISummarizeHeuristicData,\n\tISummarizeHeuristicRunner,\n\tISummaryHeuristicStrategy,\n} from \"./summarizerTypes.js\";\nimport { SummarizeReason } from \"./summaryGenerator.js\";\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"]}
1
+ {"version":3,"file":"summarizerHeuristics.js","sourceRoot":"","sources":["../../src/summary/summarizerHeuristics.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA4D;AAa5D;;GAEG;AACH,MAAa,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;;OAEG;IACH,eAAkC;QAJ3B,yBAAoB,GAApB,oBAAoB,CAAQ;QAxB7B,qBAAgB,GAAY,KAAK,CAAC;QAElC,iBAAY,GAAW,CAAC,CAAC;QAChC;;;WAGG;QACK,uBAAkB,GAAW,CAAC,CAAC;QAEhC,qBAAgB,GAAW,CAAC,CAAC;QACpC;;;WAGG;QACK,2BAAsB,GAA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AAsC;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;;GAEG;AACH,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;IAI5C,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 { Timer } from \"@fluidframework/core-utils/internal\";\nimport { ITelemetryLoggerExt } from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ISummaryConfigurationHeuristics } from \"../containerRuntime.js\";\n\nimport {\n\tISummarizeAttempt,\n\tISummarizeHeuristicData,\n\tISummarizeHeuristicRunner,\n\tISummaryHeuristicStrategy,\n} from \"./summarizerTypes.js\";\nimport { SummarizeReason } from \"./summaryGenerator.js\";\n\n/**\n * Simple implementation of class for tracking summarize heuristic data.\n */\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/**\n\t\t * Baseline attempt data used for comparisons with subsequent attempts/calculations.\n\t\t */\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>): void {\n\t\tthis._lastAttempt = lastSummary;\n\t\tthis._lastSuccessfulSummary = { ...lastSummary };\n\t}\n\n\tpublic recordAttempt(refSequenceNumber?: number): void {\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(): void {\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(): void {\n\t\tthis.idleTimer?.start(this.idleTime);\n\t}\n\n\tpublic run(): void {\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(): void {\n\t\tthis.idleTimer?.clear();\n\t}\n}\n\n/**\n * Strategy used to run a summary when it's been a while since our last successful summary\n */\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/**\n * Strategy used to do a weighted analysis on the ops we've processed since the last successful summary\n */\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\t| MaxTimeSummaryHeuristicStrategy\n\t| WeightedOpsSummaryHeuristicStrategy\n)[] {\n\treturn [new MaxTimeSummaryHeuristicStrategy(), new WeightedOpsSummaryHeuristicStrategy()];\n}\n"]}
@@ -25,13 +25,19 @@ export interface IRootSummarizerNode extends ISummarizerNode, ISummarizerNodeRoo
25
25
  */
26
26
  export declare class SummarizerNode implements IRootSummarizerNode {
27
27
  private readonly summarizeInternalFn;
28
- /** Encoded handle or path to the node */
28
+ /**
29
+ * Encoded handle or path to the node
30
+ */
29
31
  private readonly _summaryHandleId;
30
32
  private _changeSequenceNumber;
31
- /** Summary reference sequence number, i.e. last sequence number seen when last successful summary was created */
33
+ /**
34
+ * Summary reference sequence number, i.e. last sequence number seen when last successful summary was created
35
+ */
32
36
  private _lastSummaryReferenceSequenceNumber?;
33
37
  protected wipSummaryLogger?: ITelemetryBaseLogger | undefined;
34
- /** A unique id of this node to be logged when sending telemetry. */
38
+ /**
39
+ * A unique id of this node to be logged when sending telemetry.
40
+ */
35
41
  protected telemetryNodeId?: string | undefined;
36
42
  /**
37
43
  * The reference sequence number of the most recent acked summary.
@@ -63,11 +69,17 @@ export declare class SummarizerNode implements IRootSummarizerNode {
63
69
  * Use createRootSummarizerNode to create root node, or createChild to create child nodes.
64
70
  */
65
71
  constructor(baseLogger: ITelemetryBaseLogger, summarizeInternalFn: SummarizeInternalFn, config: ISummarizerNodeConfig,
66
- /** Encoded handle or path to the node */
72
+ /**
73
+ * Encoded handle or path to the node
74
+ */
67
75
  _summaryHandleId: EscapedPath, _changeSequenceNumber: number,
68
- /** Summary reference sequence number, i.e. last sequence number seen when last successful summary was created */
76
+ /**
77
+ * Summary reference sequence number, i.e. last sequence number seen when last successful summary was created
78
+ */
69
79
  _lastSummaryReferenceSequenceNumber?: number | undefined, wipSummaryLogger?: ITelemetryBaseLogger | undefined,
70
- /** A unique id of this node to be logged when sending telemetry. */
80
+ /**
81
+ * A unique id of this node to be logged when sending telemetry.
82
+ */
71
83
  telemetryNodeId?: string | undefined);
72
84
  /**
73
85
  * In order to produce a summary with a summarizer node, the summarizer node system must be notified a summary has
@@ -144,9 +156,13 @@ export declare class SummarizerNode implements IRootSummarizerNode {
144
156
  protected hasChanged(): boolean;
145
157
  protected readonly canReuseHandle: boolean;
146
158
  createChild(
147
- /** Summarize function */
159
+ /**
160
+ * Summarize function
161
+ */
148
162
  summarizeInternalFn: SummarizeInternalFn,
149
- /** Initial id or path part of this node */
163
+ /**
164
+ * Initial id or path part of this node
165
+ */
150
166
  id: string,
151
167
  /**
152
168
  * Information needed to create the node.
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNode.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAGvE,OAAO,EACN,aAAa,EACb,yBAAyB,EACzB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAEN,iBAAiB,EACjB,8BAA8B,EAE9B,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,8CAA8C,CAAC;AAEtD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EACN,mBAAmB,EAMnB,MAAM,0CAA0C,CAAC;AAElD,OAAO,EACN,WAAW,EACX,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,qBAAqB,EACrB,kBAAkB,EAClB,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,mBAAoB,SAAQ,eAAe,EAAE,2BAA2B;CAAG;AAE5F;;;;;;;;;;;;GAYG;AACH,qBAAa,cAAe,YAAW,mBAAmB;IAwCxD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAEpC,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,qBAAqB;IAC7B,iHAAiH;IACjH,OAAO,CAAC,mCAAmC,CAAC;IAC5C,SAAS,CAAC,gBAAgB,CAAC;IAC3B,oEAAoE;IACpE,SAAS,CAAC,eAAe,CAAC;IAhD3B;;;OAGG;IACH,IAAW,uBAAuB,WAEjC;IAED;;;OAGG;IACH,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,SAAS,CAAC,QAAQ,CAAC,QAAQ,8BAAqC;IAChE;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,gBAAgB,kCAAyC;IAC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IjD,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAM/C;;;;OAIG;IACH,SAAS,CAAC,UAAU,IAAI,OAAO;IAI/B,SAAS,CAAC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAEpC,WAAW;IACjB;;OAEG;IACH,mBAAmB,EAAE,mBAAmB;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM;IACV;;;;OAIG;IACH,WAAW,EAAE,8BAA8B,EAC3C,MAAM,GAAE,qBAA0B,GAChC,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;IAwCtB;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI;IAcxE,SAAS,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,IAAI;IAItF;;OAEG;IACI,mBAAmB,IAAI,OAAO;IAIrC;;OAEG;IACH,SAAS,CAAC,oBAAoB,CAAC,UAAU,EAAE,uBAAuB,GAAG,KAAK;CAW1E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB,WAC5B,mBAAmB,uBACN,mBAAmB,wBAClB,MAAM,2BACH,MAAM,GAAG,SAAS,WACnC,qBAAqB,KAC3B,mBAUD,CAAC"}
@@ -44,11 +44,17 @@ class SummarizerNode {
44
44
  * Use createRootSummarizerNode to create root node, or createChild to create child nodes.
45
45
  */
46
46
  constructor(baseLogger, summarizeInternalFn, config,
47
- /** Encoded handle or path to the node */
47
+ /**
48
+ * Encoded handle or path to the node
49
+ */
48
50
  _summaryHandleId, _changeSequenceNumber,
49
- /** Summary reference sequence number, i.e. last sequence number seen when last successful summary was created */
51
+ /**
52
+ * Summary reference sequence number, i.e. last sequence number seen when last successful summary was created
53
+ */
50
54
  _lastSummaryReferenceSequenceNumber, wipSummaryLogger,
51
- /** A unique id of this node to be logged when sending telemetry. */
55
+ /**
56
+ * A unique id of this node to be logged when sending telemetry.
57
+ */
52
58
  telemetryNodeId) {
53
59
  this.summarizeInternalFn = summarizeInternalFn;
54
60
  this._summaryHandleId = _summaryHandleId;
@@ -370,9 +376,13 @@ class SummarizerNode {
370
376
  return this._changeSequenceNumber > this.referenceSequenceNumber;
371
377
  }
372
378
  createChild(
373
- /** Summarize function */
379
+ /**
380
+ * Summarize function
381
+ */
374
382
  summarizeInternalFn,
375
- /** Initial id or path part of this node */
383
+ /**
384
+ * Initial id or path part of this node
385
+ */
376
386
  id,
377
387
  /**
378
388
  * Information needed to create the node.
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNode.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA8E;AAC9E,2EAAiE;AAKjE,2EASsD;AACtD,qEAAoE;AAEpE,uEAOkD;AAElD,qEAQkC;AAIlC;;;;;;;;;;;;GAYG;AACH,MAAa,cAAc;IAC1B;;;OAGG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,mCAAmC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;;OAGG;IACH,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;IACzC,CAAC;IAmBD;;;OAGG;IACH,YACC,UAAgC,EACf,mBAAwC,EACzD,MAA6B;IAC7B,yCAAyC;IACxB,gBAA6B,EACtC,qBAA6B;IACrC,iHAAiH;IACzG,mCAA4C,EAC1C,gBAAuC;IACjD,oEAAoE;IAC1D,eAAwB;QATjB,wBAAmB,GAAnB,mBAAmB,CAAqB;QAGxC,qBAAgB,GAAhB,gBAAgB,CAAa;QACtC,0BAAqB,GAArB,qBAAqB,CAAQ;QAE7B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CAAC;IAES,iBAAiB,CAAC,GAAW,EAAE,kBAAsC;QAC9E,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,mBAAmB;QACzB,OAAO,IAAI,CAAC,0BAA0B,KAAK,SAAS,CAAC;IACtD,CAAC;IAED;;OAEG;IACO,oBAAoB,CAAC,UAAmC;QACjE,MAAM,KAAK,GAAG,IAAI,uBAAY,CAAC,UAAU,CAAC,SAAS,EAAE;YACpD,GAAG,UAAU;YACb,uBAAuB,EAAE,IAAI,CAAC,0BAA0B;YACxD,GAAG,IAAA,2BAAgB,EAAC;gBACnB,EAAE,EAAE,IAAI,CAAC,eAAe;aACxB,CAAC;SACF,CAAC,CAAC;QACH,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC9C,MAAM,KAAK,CAAC;IACb,CAAC;CACD;AAtkBD,wCAskBC;AAED;;;;;;;;GAQG;AACI,MAAM,wBAAwB,GAAG,CACvC,MAA2B,EAC3B,mBAAwC,EACxC,oBAA4B,EAC5B,uBAA2C,EAC3C,SAAgC,EAAE,EACZ,EAAE,CACxB,IAAI,cAAc,CACjB,MAAM,EACN,mBAAmB,EACnB,MAAM,EACN,oCAAW,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,qBAAqB,EAC5C,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,CAAC,sBAAsB,EAChC,EAAE,CAAC,qBAAqB,CACxB,CAAC;AAhBU,QAAA,wBAAwB,4BAgBlC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\nimport {\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { mergeStats } from \"@fluidframework/runtime-utils/internal\";\nimport { type ITelemetryErrorEventExt } from \"@fluidframework/telemetry-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tLoggingError,\n\tPerformanceEvent,\n\tTelemetryDataTag,\n\tcreateChildLogger,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIRefreshSummaryResult,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tValidateSummaryResult,\n\tPendingSummaryInfo,\n} from \"./summarizerNodeUtils.js\";\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._lastSummaryReferenceSequenceNumber ?? 0;\n\t}\n\n\t/**\n\t * returns the handle of the last successful summary of this summarizerNode in string format\n\t * (this getter is primarily only used in the test code)\n\t */\n\tpublic get summaryHandleId(): string {\n\t\treturn this._summaryHandleId.toString();\n\t}\n\n\tprotected readonly children = new Map<string, SummarizerNode>();\n\t/**\n\t * Key value pair of summaries submitted by this client which are not yet acked.\n\t * Key is the proposalHandle and value is the summary op's referece sequence number.\n\t */\n\tprotected readonly pendingSummaries = new Map<string, PendingSummaryInfo>();\n\tprotected wipReferenceSequenceNumber: number | undefined;\n\t/**\n\t * True if the current node was summarized during the current summary process\n\t * This flag is used to identify scenarios where summarize was not called on a node.\n\t * For example, this node was created after its parent was already summarized due to out-of-order realization via application code.\n\t */\n\tprivate wipSummarizeCalled: boolean = false;\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\t/** Encoded handle or path to the node */\n\t\tprivate readonly _summaryHandleId: EscapedPath,\n\t\tprivate _changeSequenceNumber: number,\n\t\t/** Summary reference sequence number, i.e. last sequence number seen when last successful summary was created */\n\t\tprivate _lastSummaryReferenceSequenceNumber?: number,\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\t/**\n\t * In order to produce a summary with a summarizer node, the summarizer node system must be notified a summary has\n\t * started. This is done by calling startSummary. This will track the reference sequence number of the summary and\n\t * run some validation checks to ensure the summary is correct.\n\t * @param referenceSequenceNumber - the number of ops processed up to this point\n\t * @param summaryLogger - the logger to use for the summary\n\t * @param latestSummaryRefSeqNum - the reference sequence number of the latest summary. Another way to think about\n\t * it is the reference sequence number of the previous summary.\n\t * @returns the number of nodes in the tree, the number of nodes that are invalid, and the different types of\n\t * sequence number mismatches\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\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\tlet nodes = 1; // number of summarizerNodes at the start of the summary\n\t\tlet invalidNodes = 0;\n\t\tconst sequenceNumberMismatchKeySet = new Set<string>();\n\t\tconst nodeLatestSummaryRefSeqNum = this._lastSummaryReferenceSequenceNumber;\n\t\tif (\n\t\t\tnodeLatestSummaryRefSeqNum !== undefined &&\n\t\t\tlatestSummaryRefSeqNum !== nodeLatestSummaryRefSeqNum\n\t\t) {\n\t\t\tinvalidNodes++;\n\t\t\tsequenceNumberMismatchKeySet.add(\n\t\t\t\t`${latestSummaryRefSeqNum}-${nodeLatestSummaryRefSeqNum}`,\n\t\t\t);\n\t\t}\n\n\t\tthis.wipSummaryLogger = summaryLogger;\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst childStartSummaryResult = child.startSummary(\n\t\t\t\treferenceSequenceNumber,\n\t\t\t\tthis.wipSummaryLogger,\n\t\t\t\tlatestSummaryRefSeqNum,\n\t\t\t);\n\t\t\tnodes += childStartSummaryResult.nodes;\n\t\t\tinvalidNodes += childStartSummaryResult.invalidNodes;\n\t\t\tfor (const invalidSequenceNumber of childStartSummaryResult.mismatchNumbers) {\n\t\t\t\tsequenceNumberMismatchKeySet.add(invalidSequenceNumber);\n\t\t\t}\n\t\t}\n\t\tthis.wipReferenceSequenceNumber = referenceSequenceNumber;\n\t\treturn {\n\t\t\tnodes,\n\t\t\tinvalidNodes,\n\t\t\tmismatchNumbers: sequenceNumberMismatchKeySet,\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 trackState is false, call summarize internal directly and don't track any state.\n\t\tif (!trackState) {\n\t\t\treturn this.summarizeInternalFn(fullTree, trackState, telemetryContext);\n\t\t}\n\n\t\t// Set to wipSummarizeCalled true to represent that current node was included in the summary process.\n\t\tthis.wipSummarizeCalled = true;\n\n\t\t// Try to reuse the tree if unchanged\n\t\tif (this.canReuseHandle && !fullTree && !this.hasChanged()) {\n\t\t\tif (this._lastSummaryReferenceSequenceNumber !== undefined) {\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: this.summaryHandleId,\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\tlet incrementalSummaryContext: IExperimentalIncrementalSummaryContext | undefined;\n\t\tif (!fullTree) {\n\t\t\tassert(\n\t\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t\t0x5df /* Summarize should not be called when not tracking the summary */,\n\t\t\t);\n\t\t\tincrementalSummaryContext =\n\t\t\t\tthis._lastSummaryReferenceSequenceNumber !== undefined\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsummarySequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t\t\t\t\tlatestSummarySequenceNumber: this._lastSummaryReferenceSequenceNumber,\n\t\t\t\t\t\t\t// TODO: remove summaryPath.\n\t\t\t\t\t\t\tsummaryPath: this.summaryHandleId,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined;\n\t\t}\n\n\t\tconst result = await this.summarizeInternalFn(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\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 wipSummarizeCalled must be set.\n\t\tif (parentSkipRecursion || this.wipSummarizeCalled) {\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) {\n\t\tthis.completeSummaryCore(proposalHandle, false /* parentSkipRecursion */);\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(proposalHandle: string, parentSkipRecursion: boolean) {\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t0x1a4 /* \"Not tracking a summary\" */,\n\t\t);\n\t\tif (parentSkipRecursion) {\n\t\t\tif (this._lastSummaryReferenceSequenceNumber === undefined) {\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\tfor (const child of this.children.values()) {\n\t\t\tchild.completeSummaryCore(proposalHandle, this.wipSkipRecursion || parentSkipRecursion);\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, {\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t});\n\t\tthis.clearSummary();\n\t}\n\n\tpublic clearSummary() {\n\t\tthis.wipReferenceSequenceNumber = undefined;\n\t\tthis.wipSummarizeCalled = false;\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 * @param proposalHandle - Handle of the generated / uploaded summary.\n\t * @param summaryRefSeq - Reference sequence of the acked summary\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\n\t\t\t\t// If the acked summary is found in the pendingSummaries, it means the summary was created and tracked by the current client\n\t\t\t\t// so set the isSummaryTracked to true.\n\t\t\t\tconst pendingSummary = this.pendingSummaries.get(proposalHandle);\n\t\t\t\tif (pendingSummary?.referenceSequenceNumber !== undefined) {\n\t\t\t\t\tisSummaryTracked = true;\n\t\t\t\t\t// update the pendingSummariesMap for the root and all child summarizerNodes\n\t\t\t\t\tthis.refreshLatestSummaryFromPending(\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\tpendingSummary.referenceSequenceNumber,\n\t\t\t\t\t);\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 pendingSummary = this.pendingSummaries.get(proposalHandle);\n\t\tif (pendingSummary === 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._lastSummaryReferenceSequenceNumber === 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 === pendingSummary.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\t// Delete all summaries whose reference sequence number is smaller than the one just acked.\n\t\tfor (const [key, summary] of this.pendingSummaries) {\n\t\t\tif (summary.referenceSequenceNumber < referenceSequenceNumber) {\n\t\t\t\tthis.pendingSummaries.delete(key);\n\t\t\t}\n\t\t}\n\t\t// Update the latest successful summary reference number\n\t\tthis._lastSummaryReferenceSequenceNumber = pendingSummary.referenceSequenceNumber;\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\tpublic updateBaseSummaryState(snapshot: ISnapshotTree) {\n\t\t// Function deprecated. Empty declaration is kept around to compat failures.\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\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.summaryHandleId,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.lastSummaryReferenceSequenceNumber,\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 childLastSummaryReferenceSequenceNumber: number | undefined;\n\t\tlet changeSequenceNumber: number;\n\n\t\tconst parentLastSummaryReferenceSequenceNumber = this._lastSummaryReferenceSequenceNumber;\n\t\tswitch (createParam.type) {\n\t\t\tcase CreateSummarizerNodeSource.FromAttach: {\n\t\t\t\tif (\n\t\t\t\t\tparentLastSummaryReferenceSequenceNumber !== undefined &&\n\t\t\t\t\tcreateParam.sequenceNumber <= parentLastSummaryReferenceSequenceNumber\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\tchildLastSummaryReferenceSequenceNumber = parentLastSummaryReferenceSequenceNumber;\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\tcase CreateSummarizerNodeSource.Local: {\n\t\t\t\tchildLastSummaryReferenceSequenceNumber = parentLastSummaryReferenceSequenceNumber;\n\t\t\t\tchangeSequenceNumber = parentLastSummaryReferenceSequenceNumber ?? -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\t\tconst childSummaryHandleId = this._summaryHandleId.createChildPath(EscapedPath.create(id));\n\n\t\treturn {\n\t\t\tchangeSequenceNumber,\n\t\t\ttelemetryNodeId: childTelemetryNodeId,\n\t\t\tsummaryHandleId: childSummaryHandleId,\n\t\t\tlastSummaryReferenceSequenceNumber: childLastSummaryReferenceSequenceNumber,\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._lastSummaryReferenceSequenceNumber !== undefined) {\n\t\t\tthis.pendingSummaries.forEach((pendingSummaryInfo, proposedHandle) => {\n\t\t\t\tchild.addPendingSummary(proposedHandle, pendingSummaryInfo);\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected addPendingSummary(key: string, pendingSummaryInfo: PendingSummaryInfo) {\n\t\tthis.pendingSummaries.set(key, pendingSummaryInfo);\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: ITelemetryErrorEventExt): 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\tEscapedPath.create(\"\") /* summaryHandleId */,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber,\n\t\tundefined /* wipSummaryLogger */,\n\t\t\"\" /* telemetryNodeId */,\n\t);\n"]}
1
+ {"version":3,"file":"summarizerNode.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,kEAA8E;AAC9E,2EAAiE;AAKjE,2EASsD;AACtD,qEAAoE;AAEpE,uEAOkD;AAElD,qEAQkC;AAIlC;;;;;;;;;;;;GAYG;AACH,MAAa,cAAc;IAC1B;;;OAGG;IACH,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC,mCAAmC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED;;;OAGG;IACH,IAAW,eAAe;QACzB,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC;IACzC,CAAC;IAmBD;;;OAGG;IACH,YACC,UAAgC,EACf,mBAAwC,EACzD,MAA6B;IAC7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microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryBaseLogger } from \"@fluidframework/core-interfaces\";\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport { SummaryType } from \"@fluidframework/driver-definitions\";\nimport {\n\tISnapshotTree,\n\tISequencedDocumentMessage,\n} from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIExperimentalIncrementalSummaryContext,\n\tITelemetryContext,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tISummarizeResult,\n\tISummarizerNode,\n\tISummarizerNodeConfig,\n\tSummarizeInternalFn,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { mergeStats } from \"@fluidframework/runtime-utils/internal\";\nimport { type ITelemetryErrorEventExt } from \"@fluidframework/telemetry-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tLoggingError,\n\tPerformanceEvent,\n\tTelemetryDataTag,\n\tcreateChildLogger,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport {\n\tEscapedPath,\n\tICreateChildDetails,\n\tIRefreshSummaryResult,\n\tIStartSummaryResult,\n\tISummarizerNodeRootContract,\n\tValidateSummaryResult,\n\tPendingSummaryInfo,\n} from \"./summarizerNodeUtils.js\";\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(): number {\n\t\treturn this._lastSummaryReferenceSequenceNumber ?? 0;\n\t}\n\n\t/**\n\t * returns the handle of the last successful summary of this summarizerNode in string format\n\t * (this getter is primarily only used in the test code)\n\t */\n\tpublic get summaryHandleId(): string {\n\t\treturn this._summaryHandleId.toString();\n\t}\n\n\tprotected readonly children = new Map<string, SummarizerNode>();\n\t/**\n\t * Key value pair of summaries submitted by this client which are not yet acked.\n\t * Key is the proposalHandle and value is the summary op's referece sequence number.\n\t */\n\tprotected readonly pendingSummaries = new Map<string, PendingSummaryInfo>();\n\tprotected wipReferenceSequenceNumber: number | undefined;\n\t/**\n\t * True if the current node was summarized during the current summary process\n\t * This flag is used to identify scenarios where summarize was not called on a node.\n\t * For example, this node was created after its parent was already summarized due to out-of-order realization via application code.\n\t */\n\tprivate wipSummarizeCalled: boolean = false;\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\t/**\n\t\t * Encoded handle or path to the node\n\t\t */\n\t\tprivate readonly _summaryHandleId: EscapedPath,\n\t\tprivate _changeSequenceNumber: number,\n\t\t/**\n\t\t * Summary reference sequence number, i.e. last sequence number seen when last successful summary was created\n\t\t */\n\t\tprivate _lastSummaryReferenceSequenceNumber?: number,\n\t\tprotected wipSummaryLogger?: ITelemetryBaseLogger,\n\t\t/**\n\t\t * A unique id of this node to be logged when sending telemetry.\n\t\t */\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\t/**\n\t * In order to produce a summary with a summarizer node, the summarizer node system must be notified a summary has\n\t * started. This is done by calling startSummary. This will track the reference sequence number of the summary and\n\t * run some validation checks to ensure the summary is correct.\n\t * @param referenceSequenceNumber - the number of ops processed up to this point\n\t * @param summaryLogger - the logger to use for the summary\n\t * @param latestSummaryRefSeqNum - the reference sequence number of the latest summary. Another way to think about\n\t * it is the reference sequence number of the previous summary.\n\t * @returns the number of nodes in the tree, the number of nodes that are invalid, and the different types of\n\t * sequence number mismatches\n\t */\n\tpublic startSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryBaseLogger,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult {\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\tlet nodes = 1; // number of summarizerNodes at the start of the summary\n\t\tlet invalidNodes = 0;\n\t\tconst sequenceNumberMismatchKeySet = new Set<string>();\n\t\tconst nodeLatestSummaryRefSeqNum = this._lastSummaryReferenceSequenceNumber;\n\t\tif (\n\t\t\tnodeLatestSummaryRefSeqNum !== undefined &&\n\t\t\tlatestSummaryRefSeqNum !== nodeLatestSummaryRefSeqNum\n\t\t) {\n\t\t\tinvalidNodes++;\n\t\t\tsequenceNumberMismatchKeySet.add(\n\t\t\t\t`${latestSummaryRefSeqNum}-${nodeLatestSummaryRefSeqNum}`,\n\t\t\t);\n\t\t}\n\n\t\tthis.wipSummaryLogger = summaryLogger;\n\n\t\tfor (const child of this.children.values()) {\n\t\t\tconst childStartSummaryResult = child.startSummary(\n\t\t\t\treferenceSequenceNumber,\n\t\t\t\tthis.wipSummaryLogger,\n\t\t\t\tlatestSummaryRefSeqNum,\n\t\t\t);\n\t\t\tnodes += childStartSummaryResult.nodes;\n\t\t\tinvalidNodes += childStartSummaryResult.invalidNodes;\n\t\t\tfor (const invalidSequenceNumber of childStartSummaryResult.mismatchNumbers) {\n\t\t\t\tsequenceNumberMismatchKeySet.add(invalidSequenceNumber);\n\t\t\t}\n\t\t}\n\t\tthis.wipReferenceSequenceNumber = referenceSequenceNumber;\n\t\treturn {\n\t\t\tnodes,\n\t\t\tinvalidNodes,\n\t\t\tmismatchNumbers: sequenceNumberMismatchKeySet,\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 trackState is false, call summarize internal directly and don't track any state.\n\t\tif (!trackState) {\n\t\t\treturn this.summarizeInternalFn(fullTree, trackState, telemetryContext);\n\t\t}\n\n\t\t// Set to wipSummarizeCalled true to represent that current node was included in the summary process.\n\t\tthis.wipSummarizeCalled = true;\n\n\t\t// Try to reuse the tree if unchanged\n\t\tif (this.canReuseHandle && !fullTree && !this.hasChanged()) {\n\t\t\tif (this._lastSummaryReferenceSequenceNumber !== undefined) {\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: this.summaryHandleId,\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\tlet incrementalSummaryContext: IExperimentalIncrementalSummaryContext | undefined;\n\t\tif (!fullTree) {\n\t\t\tassert(\n\t\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t\t0x5df /* Summarize should not be called when not tracking the summary */,\n\t\t\t);\n\t\t\tincrementalSummaryContext =\n\t\t\t\tthis._lastSummaryReferenceSequenceNumber !== undefined\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tsummarySequenceNumber: this.wipReferenceSequenceNumber,\n\t\t\t\t\t\t\tlatestSummarySequenceNumber: this._lastSummaryReferenceSequenceNumber,\n\t\t\t\t\t\t\t// TODO: remove summaryPath.\n\t\t\t\t\t\t\tsummaryPath: this.summaryHandleId,\n\t\t\t\t\t\t}\n\t\t\t\t\t: undefined;\n\t\t}\n\n\t\tconst result = await this.summarizeInternalFn(\n\t\t\tfullTree,\n\t\t\ttrackState,\n\t\t\ttelemetryContext,\n\t\t\tincrementalSummaryContext,\n\t\t);\n\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 wipSummarizeCalled must be set.\n\t\tif (parentSkipRecursion || this.wipSummarizeCalled) {\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): void {\n\t\tthis.completeSummaryCore(proposalHandle, false /* parentSkipRecursion */);\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(proposalHandle: string, parentSkipRecursion: boolean): void {\n\t\tassert(\n\t\t\tthis.wipReferenceSequenceNumber !== undefined,\n\t\t\t0x1a4 /* \"Not tracking a summary\" */,\n\t\t);\n\t\tif (parentSkipRecursion) {\n\t\t\tif (this._lastSummaryReferenceSequenceNumber === undefined) {\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\tfor (const child of this.children.values()) {\n\t\t\tchild.completeSummaryCore(proposalHandle, this.wipSkipRecursion || parentSkipRecursion);\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, {\n\t\t\treferenceSequenceNumber: this.wipReferenceSequenceNumber,\n\t\t});\n\t\tthis.clearSummary();\n\t}\n\n\tpublic clearSummary(): void {\n\t\tthis.wipReferenceSequenceNumber = undefined;\n\t\tthis.wipSummarizeCalled = false;\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 * @param proposalHandle - Handle of the generated / uploaded summary.\n\t * @param summaryRefSeq - Reference sequence of the acked summary\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\n\t\t\t\t// If the acked summary is found in the pendingSummaries, it means the summary was created and tracked by the current client\n\t\t\t\t// so set the isSummaryTracked to true.\n\t\t\t\tconst pendingSummary = this.pendingSummaries.get(proposalHandle);\n\t\t\t\tif (pendingSummary?.referenceSequenceNumber !== undefined) {\n\t\t\t\t\tisSummaryTracked = true;\n\t\t\t\t\t// update the pendingSummariesMap for the root and all child summarizerNodes\n\t\t\t\t\tthis.refreshLatestSummaryFromPending(\n\t\t\t\t\t\tproposalHandle,\n\t\t\t\t\t\tpendingSummary.referenceSequenceNumber,\n\t\t\t\t\t);\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 pendingSummary = this.pendingSummaries.get(proposalHandle);\n\t\tif (pendingSummary === 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._lastSummaryReferenceSequenceNumber === 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 === pendingSummary.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\t// Delete all summaries whose reference sequence number is smaller than the one just acked.\n\t\tfor (const [key, summary] of this.pendingSummaries) {\n\t\t\tif (summary.referenceSequenceNumber < referenceSequenceNumber) {\n\t\t\t\tthis.pendingSummaries.delete(key);\n\t\t\t}\n\t\t}\n\t\t// Update the latest successful summary reference number\n\t\tthis._lastSummaryReferenceSequenceNumber = pendingSummary.referenceSequenceNumber;\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\tpublic updateBaseSummaryState(snapshot: ISnapshotTree): void {\n\t\t// Function deprecated. Empty declaration is kept around to compat failures.\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\tprotected readonly canReuseHandle: boolean;\n\n\tpublic createChild(\n\t\t/**\n\t\t * Summarize function\n\t\t */\n\t\tsummarizeInternalFn: SummarizeInternalFn,\n\t\t/**\n\t\t * Initial id or path part of this node\n\t\t */\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.summaryHandleId,\n\t\t\tcreateDetails.changeSequenceNumber,\n\t\t\tcreateDetails.lastSummaryReferenceSequenceNumber,\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 childLastSummaryReferenceSequenceNumber: number | undefined;\n\t\tlet changeSequenceNumber: number;\n\n\t\tconst parentLastSummaryReferenceSequenceNumber = this._lastSummaryReferenceSequenceNumber;\n\t\tswitch (createParam.type) {\n\t\t\tcase CreateSummarizerNodeSource.FromAttach: {\n\t\t\t\tif (\n\t\t\t\t\tparentLastSummaryReferenceSequenceNumber !== undefined &&\n\t\t\t\t\tcreateParam.sequenceNumber <= parentLastSummaryReferenceSequenceNumber\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\tchildLastSummaryReferenceSequenceNumber = parentLastSummaryReferenceSequenceNumber;\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\tcase CreateSummarizerNodeSource.Local: {\n\t\t\t\tchildLastSummaryReferenceSequenceNumber = parentLastSummaryReferenceSequenceNumber;\n\t\t\t\tchangeSequenceNumber = parentLastSummaryReferenceSequenceNumber ?? -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\t\tconst childSummaryHandleId = this._summaryHandleId.createChildPath(EscapedPath.create(id));\n\n\t\treturn {\n\t\t\tchangeSequenceNumber,\n\t\t\ttelemetryNodeId: childTelemetryNodeId,\n\t\t\tsummaryHandleId: childSummaryHandleId,\n\t\t\tlastSummaryReferenceSequenceNumber: childLastSummaryReferenceSequenceNumber,\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): void {\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._lastSummaryReferenceSequenceNumber !== undefined) {\n\t\t\tthis.pendingSummaries.forEach((pendingSummaryInfo, proposedHandle) => {\n\t\t\t\tchild.addPendingSummary(proposedHandle, pendingSummaryInfo);\n\t\t\t});\n\t\t}\n\t}\n\n\tprotected addPendingSummary(key: string, pendingSummaryInfo: PendingSummaryInfo): void {\n\t\tthis.pendingSummaries.set(key, pendingSummaryInfo);\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: ITelemetryErrorEventExt): 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\tEscapedPath.create(\"\") /* summaryHandleId */,\n\t\tchangeSequenceNumber,\n\t\treferenceSequenceNumber,\n\t\tundefined /* wipSummaryLogger */,\n\t\t\"\" /* telemetryNodeId */,\n\t);\n"]}
@@ -6,17 +6,27 @@ import { SummaryObject } from "@fluidframework/driver-definitions";
6
6
  import { ISnapshotTree } from "@fluidframework/driver-definitions/internal";
7
7
  import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils/internal";
8
8
  export interface IRefreshSummaryResult {
9
- /** Tells whether this summary is tracked by this client. */
9
+ /**
10
+ * Tells whether this summary is tracked by this client.
11
+ */
10
12
  isSummaryTracked: boolean;
11
- /** Tells whether this summary is newer than the latest one tracked by this client. */
13
+ /**
14
+ * Tells whether this summary is newer than the latest one tracked by this client.
15
+ */
12
16
  isSummaryNewer: boolean;
13
17
  }
14
18
  export interface IStartSummaryResult {
15
- /** The number of summarizerNodes at the start of the summary. */
19
+ /**
20
+ * The number of summarizerNodes at the start of the summary.
21
+ */
16
22
  nodes: number;
17
- /** The number of summarizerNodes in the wrong state. */
23
+ /**
24
+ * The number of summarizerNodes in the wrong state.
25
+ */
18
26
  invalidNodes: number;
19
- /** The invalid sequence numbers and their values. It should be in the format of validateSequenceNumber-nodeSequenceNumber */
27
+ /**
28
+ * The invalid sequence numbers and their values. It should be in the format of validateSequenceNumber-nodeSequenceNumber
29
+ */
20
30
  mismatchNumbers: Set<string>;
21
31
  }
22
32
  /**
@@ -28,14 +38,20 @@ export type ValidateSummaryResult = {
28
38
  success: true;
29
39
  } | {
30
40
  success: false;
31
- /** The failure reason */
41
+ /**
42
+ * The failure reason
43
+ */
32
44
  reason: string;
33
- /** id of the node that failed during validation */
45
+ /**
46
+ * id of the node that failed during validation
47
+ */
34
48
  id: {
35
49
  tag: TelemetryDataTag.CodeArtifact;
36
50
  value: string | undefined;
37
51
  };
38
- /** If the error can be retried, time to wait before retrying */
52
+ /**
53
+ * If the error can be retried, time to wait before retrying
54
+ */
39
55
  retryAfterSeconds?: number;
40
56
  };
41
57
  export interface ISummarizerNodeRootContract {
@@ -45,7 +61,9 @@ export interface ISummarizerNodeRootContract {
45
61
  clearSummary(): void;
46
62
  refreshLatestSummary(proposalHandle: string, summaryRefSeq: number): Promise<IRefreshSummaryResult>;
47
63
  }
48
- /** Class to build paths for nodes in a tree with escaped special characters */
64
+ /**
65
+ * Class to build paths for nodes in a tree with escaped special characters
66
+ */
49
67
  export declare class EscapedPath {
50
68
  readonly path: string;
51
69
  private constructor();
@@ -61,26 +79,40 @@ export declare class EscapedPath {
61
79
  createChildPath(childNodePath: EscapedPath): EscapedPath;
62
80
  }
63
81
  export interface PendingSummaryInfo {
64
- /** The sequence number at which the summary was created. */
82
+ /**
83
+ * The sequence number at which the summary was created.
84
+ */
65
85
  referenceSequenceNumber: number;
66
86
  }
67
87
  /**
68
88
  * Represents the details needed to create a child summarizer node.
69
89
  */
70
90
  export interface ICreateChildDetails {
71
- /** Sequence number of latest known change to the node */
91
+ /**
92
+ * Sequence number of latest known change to the node
93
+ */
72
94
  changeSequenceNumber: number;
73
- /** A unique id of this child to be logged when sending telemetry. */
95
+ /**
96
+ * A unique id of this child to be logged when sending telemetry.
97
+ */
74
98
  telemetryNodeId: string;
75
- /** Summary handle for child node */
99
+ /**
100
+ * Summary handle for child node
101
+ */
76
102
  summaryHandleId: EscapedPath;
77
- /** the reference sequence number of the last successful summary. */
103
+ /**
104
+ * the reference sequence number of the last successful summary.
105
+ */
78
106
  lastSummaryReferenceSequenceNumber: number | undefined;
79
107
  }
80
108
  export interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {
81
- /** Tree to use to find children subtrees */
109
+ /**
110
+ * Tree to use to find children subtrees
111
+ */
82
112
  childrenTree: T;
83
- /** Additional path part where children are isolated */
113
+ /**
114
+ * Additional path part where children are isolated
115
+ */
84
116
  childrenPathPart: string | undefined;
85
117
  }
86
118
  //# sourceMappingURL=summarizerNodeUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNodeUtils.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACrC,4DAA4D;IAC5D,gBAAgB,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AA4D;IAC5D,uBAAuB,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,yDAAyD;IACzD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,oCAAoC;IACpC,eAAe,EAAE,WAAW,CAAC;IAC7B,oEAAoE;IACpE,kCAAkC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvD;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"}
1
+ {"version":3,"file":"summarizerNodeUtils.d.ts","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,MAAM,0CAA0C,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACrC;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,cAAc,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IACA,OAAO,EAAE,IAAI,CAAC;CACb,GACD;IACA,OAAO,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,EAAE,EAAE;QACH,GAAG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6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.EscapedPath = void 0;
8
8
  const internal_1 = require("@fluidframework/runtime-definitions/internal");
9
- /** Class to build paths for nodes in a tree with escaped special characters */
9
+ /**
10
+ * Class to build paths for nodes in a tree with escaped special characters
11
+ */
10
12
  class EscapedPath {
11
13
  constructor(path) {
12
14
  this.path = path;
@@ -1 +1 @@
1
- {"version":3,"file":"summarizerNodeUtils.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,2EAAgF;AA2DhF,+EAA+E;AAC/E,MAAa,WAAW;IACvB,YAAoC,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAEpD;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,IAAY;QAChC,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACM,QAAQ;QACd,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD;;OAEG;IACI,eAAe,CAAC,aAA0B;QAChD,OAAO,IAAI,WAAW,CACrB,GAAG,IAAI,CAAC,IAAI,IAAI,kBAAkB,CAAC,2BAAgB,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,CAC5E,CAAC;IACH,CAAC;CACD;AArBD,kCAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SummaryObject } from \"@fluidframework/driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport { channelsTreeName } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tTelemetryDataTag,\n} from \"@fluidframework/telemetry-utils/internal\";\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\nexport interface IStartSummaryResult {\n\t/** The number of summarizerNodes at the start of the summary. */\n\tnodes: number;\n\t/** The number of summarizerNodes in the wrong state. */\n\tinvalidNodes: number;\n\t/** The invalid sequence numbers and their values. It should be in the format of validateSequenceNumber-nodeSequenceNumber */\n\tmismatchNumbers: Set<string>;\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(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryLoggerExt,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult;\n\tvalidateSummary(): ValidateSummaryResult;\n\tcompleteSummary(proposalHandle: string): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult>;\n}\n\n/** Class to build paths for nodes in a tree with escaped special characters */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\n\t/**\n\t * Creates and returns a new instance of this class.\n\t * @param path - Id or path part of a node\n\t */\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\t/**\n\t * Creates and returns a new instance of this class for child of the current node.\n\t */\n\tpublic createChildPath(childNodePath: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(\n\t\t\t`${this.path}/${encodeURIComponent(channelsTreeName)}/${childNodePath.path}`,\n\t\t);\n\t}\n}\nexport interface PendingSummaryInfo {\n\t/** The sequence number at which the summary was created. */\n\treferenceSequenceNumber: number;\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\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\t/** Summary handle for child node */\n\tsummaryHandleId: EscapedPath;\n\t/** the reference sequence number of the last successful summary. */\n\tlastSummaryReferenceSequenceNumber: number | undefined;\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"]}
1
+ {"version":3,"file":"summarizerNodeUtils.js","sourceRoot":"","sources":["../../../src/summary/summarizerNode/summarizerNodeUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,2EAAgF;AA2EhF;;GAEG;AACH,MAAa,WAAW;IACvB,YAAoC,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAG,CAAC;IAEpD;;;OAGG;IACI,MAAM,CAAC,MAAM,CAAC,IAAY;QAChC,OAAO,IAAI,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACM,QAAQ;QACd,OAAO,IAAI,CAAC,IAAI,CAAC;IAClB,CAAC;IACD;;OAEG;IACI,eAAe,CAAC,aAA0B;QAChD,OAAO,IAAI,WAAW,CACrB,GAAG,IAAI,CAAC,IAAI,IAAI,kBAAkB,CAAC,2BAAgB,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,CAC5E,CAAC;IACH,CAAC;CACD;AArBD,kCAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SummaryObject } from \"@fluidframework/driver-definitions\";\nimport { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport { channelsTreeName } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tITelemetryLoggerExt,\n\tTelemetryDataTag,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nexport interface IRefreshSummaryResult {\n\t/**\n\t * Tells whether this summary is tracked by this client.\n\t */\n\tisSummaryTracked: boolean;\n\t/**\n\t * Tells whether this summary is newer than the latest one tracked by this client.\n\t */\n\tisSummaryNewer: boolean;\n}\n\nexport interface IStartSummaryResult {\n\t/**\n\t * The number of summarizerNodes at the start of the summary.\n\t */\n\tnodes: number;\n\t/**\n\t * The number of summarizerNodes in the wrong state.\n\t */\n\tinvalidNodes: number;\n\t/**\n\t * The invalid sequence numbers and their values. It should be in the format of validateSequenceNumber-nodeSequenceNumber\n\t */\n\tmismatchNumbers: Set<string>;\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/**\n\t\t\t * The failure reason\n\t\t\t */\n\t\t\treason: string;\n\t\t\t/**\n\t\t\t * id of the node that failed during validation\n\t\t\t */\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/**\n\t\t\t * If the error can be retried, time to wait before retrying\n\t\t\t */\n\t\t\tretryAfterSeconds?: number;\n\t };\n\nexport interface ISummarizerNodeRootContract {\n\tstartSummary(\n\t\treferenceSequenceNumber: number,\n\t\tsummaryLogger: ITelemetryLoggerExt,\n\t\tlatestSummaryRefSeqNum: number,\n\t): IStartSummaryResult;\n\tvalidateSummary(): ValidateSummaryResult;\n\tcompleteSummary(proposalHandle: string): void;\n\tclearSummary(): void;\n\trefreshLatestSummary(\n\t\tproposalHandle: string,\n\t\tsummaryRefSeq: number,\n\t): Promise<IRefreshSummaryResult>;\n}\n\n/**\n * Class to build paths for nodes in a tree with escaped special characters\n */\nexport class EscapedPath {\n\tprivate constructor(public readonly path: string) {}\n\n\t/**\n\t * Creates and returns a new instance of this class.\n\t * @param path - Id or path part of a node\n\t */\n\tpublic static create(path: string): EscapedPath {\n\t\treturn new EscapedPath(encodeURIComponent(path));\n\t}\n\tpublic toString(): string {\n\t\treturn this.path;\n\t}\n\t/**\n\t * Creates and returns a new instance of this class for child of the current node.\n\t */\n\tpublic createChildPath(childNodePath: EscapedPath): EscapedPath {\n\t\treturn new EscapedPath(\n\t\t\t`${this.path}/${encodeURIComponent(channelsTreeName)}/${childNodePath.path}`,\n\t\t);\n\t}\n}\nexport interface PendingSummaryInfo {\n\t/**\n\t * The sequence number at which the summary was created.\n\t */\n\treferenceSequenceNumber: number;\n}\n\n/**\n * Represents the details needed to create a child summarizer node.\n */\nexport interface ICreateChildDetails {\n\t/**\n\t * Sequence number of latest known change to the node\n\t */\n\tchangeSequenceNumber: number;\n\t/**\n\t * A unique id of this child to be logged when sending telemetry.\n\t */\n\ttelemetryNodeId: string;\n\t/**\n\t * Summary handle for child node\n\t */\n\tsummaryHandleId: EscapedPath;\n\t/**\n\t * the reference sequence number of the last successful summary.\n\t */\n\tlastSummaryReferenceSequenceNumber: number | undefined;\n}\n\nexport interface ISubtreeInfo<T extends ISnapshotTree | SummaryObject> {\n\t/**\n\t * Tree to use to find children subtrees\n\t */\n\tchildrenTree: T;\n\t/**\n\t * Additional path part where children are isolated\n\t */\n\tchildrenPathPart: string | undefined;\n}\n"]}
@@ -37,9 +37,13 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
37
37
  * Use createRootSummarizerNodeWithGC to create root node, or createChild to create child nodes.
38
38
  */
39
39
  constructor(logger: ITelemetryBaseLogger, summarizeInternalFn: SummarizeInternalFn, config: ISummarizerNodeConfigWithGC, _summaryHandleId: EscapedPath, changeSequenceNumber: number,
40
- /** Summary reference sequence number, i.e. last sequence number seen when it was created */
40
+ /**
41
+ * Summary reference sequence number, i.e. last sequence number seen when it was created
42
+ */
41
43
  lastSummaryReferenceSequenceNumber?: number, wipSummaryLogger?: ITelemetryBaseLogger, getGCDataFn?: ((fullGC?: boolean) => Promise<IGarbageCollectionData>) | undefined, getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>,
42
- /** A unique id of this node to be logged when sending telemetry. */
44
+ /**
45
+ * A unique id of this node to be logged when sending telemetry.
46
+ */
43
47
  telemetryId?: string);
44
48
  /**
45
49
  * Loads state from this node's initial GC summary details. This contains the following data from the last summary
@@ -89,9 +93,13 @@ export declare class SummarizerNodeWithGC extends SummarizerNode implements IRoo
89
93
  * Override the createChild method to return an instance of SummarizerNodeWithGC.
90
94
  */
91
95
  createChild(
92
- /** Summarize function */
96
+ /**
97
+ * Summarize function
98
+ */
93
99
  summarizeInternalFn: SummarizeInternalFn,
94
- /** Initial id or path part of this node */
100
+ /**
101
+ * Initial id or path part of this node
102
+ */
95
103
  id: string,
96
104
  /**
97
105
  * Information needed to create the node.