@fluidframework/container-runtime 2.0.0-dev.5.3.2.178189 → 2.0.0-dev.6.4.0.191258

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 (526) hide show
  1. package/CHANGELOG.md +123 -0
  2. package/README.md +4 -3
  3. package/dist/batchTracker.d.ts +3 -2
  4. package/dist/batchTracker.d.ts.map +1 -1
  5. package/dist/batchTracker.js +6 -5
  6. package/dist/batchTracker.js.map +1 -1
  7. package/dist/blobManager.d.ts +10 -16
  8. package/dist/blobManager.d.ts.map +1 -1
  9. package/dist/blobManager.js +184 -172
  10. package/dist/blobManager.js.map +1 -1
  11. package/dist/connectionTelemetry.d.ts.map +1 -1
  12. package/dist/connectionTelemetry.js +25 -16
  13. package/dist/connectionTelemetry.js.map +1 -1
  14. package/dist/containerRuntime.d.ts +161 -35
  15. package/dist/containerRuntime.d.ts.map +1 -1
  16. package/dist/containerRuntime.js +697 -449
  17. package/dist/containerRuntime.js.map +1 -1
  18. package/dist/dataStore.d.ts.map +1 -1
  19. package/dist/dataStore.js +15 -7
  20. package/dist/dataStore.js.map +1 -1
  21. package/dist/dataStoreContext.d.ts +3 -2
  22. package/dist/dataStoreContext.d.ts.map +1 -1
  23. package/dist/dataStoreContext.js +83 -87
  24. package/dist/dataStoreContext.js.map +1 -1
  25. package/dist/dataStoreContexts.d.ts +1 -2
  26. package/dist/dataStoreContexts.d.ts.map +1 -1
  27. package/dist/dataStoreContexts.js +8 -9
  28. package/dist/dataStoreContexts.js.map +1 -1
  29. package/dist/dataStoreRegistry.js +2 -2
  30. package/dist/dataStoreRegistry.js.map +1 -1
  31. package/dist/dataStores.d.ts +22 -6
  32. package/dist/dataStores.d.ts.map +1 -1
  33. package/dist/dataStores.js +123 -81
  34. package/dist/dataStores.js.map +1 -1
  35. package/dist/deltaManagerProxyBase.d.ts +35 -0
  36. package/dist/deltaManagerProxyBase.d.ts.map +1 -0
  37. package/dist/deltaManagerProxyBase.js +77 -0
  38. package/dist/deltaManagerProxyBase.js.map +1 -0
  39. package/dist/deltaManagerSummarizerProxy.d.ts +1 -1
  40. package/dist/deltaManagerSummarizerProxy.d.ts.map +1 -1
  41. package/dist/deltaManagerSummarizerProxy.js +4 -2
  42. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  43. package/dist/deltaScheduler.d.ts.map +1 -1
  44. package/dist/deltaScheduler.js +10 -10
  45. package/dist/deltaScheduler.js.map +1 -1
  46. package/dist/error.d.ts +14 -0
  47. package/dist/error.d.ts.map +1 -0
  48. package/dist/error.js +21 -0
  49. package/dist/error.js.map +1 -0
  50. package/dist/gc/garbageCollection.d.ts +10 -9
  51. package/dist/gc/garbageCollection.d.ts.map +1 -1
  52. package/dist/gc/garbageCollection.js +61 -53
  53. package/dist/gc/garbageCollection.js.map +1 -1
  54. package/dist/gc/gcConfigs.d.ts.map +1 -1
  55. package/dist/gc/gcConfigs.js +18 -14
  56. package/dist/gc/gcConfigs.js.map +1 -1
  57. package/dist/gc/gcDefinitions.d.ts +17 -4
  58. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  59. package/dist/gc/gcDefinitions.js +14 -15
  60. package/dist/gc/gcDefinitions.js.map +1 -1
  61. package/dist/gc/gcHelpers.d.ts +0 -8
  62. package/dist/gc/gcHelpers.d.ts.map +1 -1
  63. package/dist/gc/gcHelpers.js +11 -24
  64. package/dist/gc/gcHelpers.js.map +1 -1
  65. package/dist/gc/gcSummaryStateTracker.d.ts +4 -7
  66. package/dist/gc/gcSummaryStateTracker.d.ts.map +1 -1
  67. package/dist/gc/gcSummaryStateTracker.js +19 -58
  68. package/dist/gc/gcSummaryStateTracker.js.map +1 -1
  69. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  70. package/dist/gc/gcTelemetry.js +45 -35
  71. package/dist/gc/gcTelemetry.js.map +1 -1
  72. package/dist/gc/gcUnreferencedStateTracker.js +4 -4
  73. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  74. package/dist/gc/index.d.ts +2 -2
  75. package/dist/gc/index.d.ts.map +1 -1
  76. package/dist/gc/index.js +3 -5
  77. package/dist/gc/index.js.map +1 -1
  78. package/dist/id-compressor/appendOnlySortedMap.d.ts +8 -30
  79. package/dist/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  80. package/dist/id-compressor/appendOnlySortedMap.js +26 -68
  81. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  82. package/dist/id-compressor/finalSpace.d.ts +29 -0
  83. package/dist/id-compressor/finalSpace.d.ts.map +1 -0
  84. package/dist/id-compressor/finalSpace.js +62 -0
  85. package/dist/id-compressor/finalSpace.js.map +1 -0
  86. package/dist/id-compressor/idCompressor.d.ts +25 -250
  87. package/dist/id-compressor/idCompressor.d.ts.map +1 -1
  88. package/dist/id-compressor/idCompressor.js +390 -1153
  89. package/dist/id-compressor/idCompressor.js.map +1 -1
  90. package/dist/id-compressor/identifiers.d.ts +32 -0
  91. package/dist/id-compressor/identifiers.d.ts.map +1 -0
  92. package/dist/id-compressor/identifiers.js +15 -0
  93. package/dist/id-compressor/identifiers.js.map +1 -0
  94. package/dist/id-compressor/index.d.ts +5 -6
  95. package/dist/id-compressor/index.d.ts.map +1 -1
  96. package/dist/id-compressor/index.js +20 -26
  97. package/dist/id-compressor/index.js.map +1 -1
  98. package/dist/id-compressor/persistanceUtilities.d.ts +22 -0
  99. package/dist/id-compressor/persistanceUtilities.d.ts.map +1 -0
  100. package/dist/id-compressor/persistanceUtilities.js +43 -0
  101. package/dist/id-compressor/persistanceUtilities.js.map +1 -0
  102. package/dist/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  103. package/dist/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  104. package/dist/id-compressor/sessionSpaceNormalizer.js +80 -0
  105. package/dist/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  106. package/dist/id-compressor/sessions.d.ts +115 -0
  107. package/dist/id-compressor/sessions.d.ts.map +1 -0
  108. package/dist/id-compressor/sessions.js +305 -0
  109. package/dist/id-compressor/sessions.js.map +1 -0
  110. package/dist/id-compressor/utilities.d.ts +49 -0
  111. package/dist/id-compressor/utilities.d.ts.map +1 -0
  112. package/dist/id-compressor/utilities.js +166 -0
  113. package/dist/id-compressor/utilities.js.map +1 -0
  114. package/dist/index.d.ts +3 -3
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +6 -4
  117. package/dist/index.js.map +1 -1
  118. package/dist/opLifecycle/batchManager.js +10 -6
  119. package/dist/opLifecycle/batchManager.js.map +1 -1
  120. package/dist/opLifecycle/opCompressor.d.ts +2 -2
  121. package/dist/opLifecycle/opCompressor.d.ts.map +1 -1
  122. package/dist/opLifecycle/opCompressor.js +12 -7
  123. package/dist/opLifecycle/opCompressor.js.map +1 -1
  124. package/dist/opLifecycle/opDecompressor.d.ts +2 -2
  125. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  126. package/dist/opLifecycle/opDecompressor.js +23 -20
  127. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  128. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  129. package/dist/opLifecycle/opGroupingManager.js +19 -9
  130. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  131. package/dist/opLifecycle/opSplitter.d.ts +2 -2
  132. package/dist/opLifecycle/opSplitter.d.ts.map +1 -1
  133. package/dist/opLifecycle/opSplitter.js +22 -19
  134. package/dist/opLifecycle/opSplitter.js.map +1 -1
  135. package/dist/opLifecycle/outbox.d.ts +7 -5
  136. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  137. package/dist/opLifecycle/outbox.js +22 -31
  138. package/dist/opLifecycle/outbox.js.map +1 -1
  139. package/dist/opLifecycle/remoteMessageProcessor.d.ts +6 -1
  140. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  141. package/dist/opLifecycle/remoteMessageProcessor.js +19 -7
  142. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  143. package/dist/opProperties.js +1 -2
  144. package/dist/opProperties.js.map +1 -1
  145. package/dist/packageVersion.d.ts +1 -1
  146. package/dist/packageVersion.js +1 -1
  147. package/dist/packageVersion.js.map +1 -1
  148. package/dist/pendingStateManager.d.ts +18 -8
  149. package/dist/pendingStateManager.d.ts.map +1 -1
  150. package/dist/pendingStateManager.js +73 -51
  151. package/dist/pendingStateManager.js.map +1 -1
  152. package/dist/scheduleManager.d.ts.map +1 -1
  153. package/dist/scheduleManager.js +36 -32
  154. package/dist/scheduleManager.js.map +1 -1
  155. package/dist/summary/index.d.ts +3 -3
  156. package/dist/summary/index.d.ts.map +1 -1
  157. package/dist/summary/index.js +2 -1
  158. package/dist/summary/index.js.map +1 -1
  159. package/dist/summary/orderedClientElection.d.ts +3 -3
  160. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  161. package/dist/summary/orderedClientElection.js +26 -27
  162. package/dist/summary/orderedClientElection.js.map +1 -1
  163. package/dist/summary/runWhileConnectedCoordinator.js +3 -3
  164. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  165. package/dist/summary/runningSummarizer.d.ts +31 -10
  166. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  167. package/dist/summary/runningSummarizer.js +271 -139
  168. package/dist/summary/runningSummarizer.js.map +1 -1
  169. package/dist/summary/summarizer.d.ts +8 -7
  170. package/dist/summary/summarizer.d.ts.map +1 -1
  171. package/dist/summary/summarizer.js +79 -78
  172. package/dist/summary/summarizer.js.map +1 -1
  173. package/dist/summary/summarizerClientElection.d.ts +2 -2
  174. package/dist/summary/summarizerClientElection.d.ts.map +1 -1
  175. package/dist/summary/summarizerClientElection.js +7 -11
  176. package/dist/summary/summarizerClientElection.js.map +1 -1
  177. package/dist/summary/summarizerHeuristics.js +10 -14
  178. package/dist/summary/summarizerHeuristics.js.map +1 -1
  179. package/dist/summary/summarizerNode/index.d.ts +1 -1
  180. package/dist/summary/summarizerNode/index.d.ts.map +1 -1
  181. package/dist/summary/summarizerNode/index.js.map +1 -1
  182. package/dist/summary/summarizerNode/summarizerNode.d.ts +10 -19
  183. package/dist/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  184. package/dist/summary/summarizerNode/summarizerNode.js +57 -130
  185. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  186. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
  187. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  188. package/dist/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  189. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  190. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +4 -14
  191. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  192. package/dist/summary/summarizerNode/summarizerNodeWithGc.js +15 -101
  193. package/dist/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  194. package/dist/summary/summarizerTypes.d.ts +38 -25
  195. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  196. package/dist/summary/summarizerTypes.js.map +1 -1
  197. package/dist/summary/summaryCollection.d.ts +2 -3
  198. package/dist/summary/summaryCollection.d.ts.map +1 -1
  199. package/dist/summary/summaryCollection.js +12 -13
  200. package/dist/summary/summaryCollection.js.map +1 -1
  201. package/dist/summary/summaryFormat.d.ts +3 -0
  202. package/dist/summary/summaryFormat.d.ts.map +1 -1
  203. package/dist/summary/summaryFormat.js +6 -4
  204. package/dist/summary/summaryFormat.js.map +1 -1
  205. package/dist/summary/summaryGenerator.d.ts +10 -4
  206. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  207. package/dist/summary/summaryGenerator.js +106 -57
  208. package/dist/summary/summaryGenerator.js.map +1 -1
  209. package/dist/summary/summaryManager.d.ts +8 -8
  210. package/dist/summary/summaryManager.d.ts.map +1 -1
  211. package/dist/summary/summaryManager.js +38 -28
  212. package/dist/summary/summaryManager.js.map +1 -1
  213. package/lib/batchTracker.d.ts +3 -2
  214. package/lib/batchTracker.d.ts.map +1 -1
  215. package/lib/batchTracker.js +5 -4
  216. package/lib/batchTracker.js.map +1 -1
  217. package/lib/blobManager.d.ts +10 -16
  218. package/lib/blobManager.d.ts.map +1 -1
  219. package/lib/blobManager.js +159 -147
  220. package/lib/blobManager.js.map +1 -1
  221. package/lib/connectionTelemetry.d.ts.map +1 -1
  222. package/lib/connectionTelemetry.js +15 -6
  223. package/lib/connectionTelemetry.js.map +1 -1
  224. package/lib/containerRuntime.d.ts +161 -35
  225. package/lib/containerRuntime.d.ts.map +1 -1
  226. package/lib/containerRuntime.js +651 -402
  227. package/lib/containerRuntime.js.map +1 -1
  228. package/lib/dataStore.d.ts.map +1 -1
  229. package/lib/dataStore.js +13 -5
  230. package/lib/dataStore.js.map +1 -1
  231. package/lib/dataStoreContext.d.ts +3 -2
  232. package/lib/dataStoreContext.d.ts.map +1 -1
  233. package/lib/dataStoreContext.js +47 -51
  234. package/lib/dataStoreContext.js.map +1 -1
  235. package/lib/dataStoreContexts.d.ts +1 -2
  236. package/lib/dataStoreContexts.d.ts.map +1 -1
  237. package/lib/dataStoreContexts.js +3 -4
  238. package/lib/dataStoreContexts.js.map +1 -1
  239. package/lib/dataStoreRegistry.js +1 -1
  240. package/lib/dataStoreRegistry.js.map +1 -1
  241. package/lib/dataStores.d.ts +22 -6
  242. package/lib/dataStores.d.ts.map +1 -1
  243. package/lib/dataStores.js +107 -65
  244. package/lib/dataStores.js.map +1 -1
  245. package/lib/deltaManagerProxyBase.d.ts +35 -0
  246. package/lib/deltaManagerProxyBase.d.ts.map +1 -0
  247. package/lib/deltaManagerProxyBase.js +73 -0
  248. package/lib/deltaManagerProxyBase.js.map +1 -0
  249. package/lib/deltaManagerSummarizerProxy.d.ts +1 -1
  250. package/lib/deltaManagerSummarizerProxy.d.ts.map +1 -1
  251. package/lib/deltaManagerSummarizerProxy.js +3 -1
  252. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  253. package/lib/deltaScheduler.d.ts.map +1 -1
  254. package/lib/deltaScheduler.js +7 -7
  255. package/lib/deltaScheduler.js.map +1 -1
  256. package/lib/error.d.ts +14 -0
  257. package/lib/error.d.ts.map +1 -0
  258. package/lib/error.js +17 -0
  259. package/lib/error.js.map +1 -0
  260. package/lib/gc/garbageCollection.d.ts +10 -9
  261. package/lib/gc/garbageCollection.d.ts.map +1 -1
  262. package/lib/gc/garbageCollection.js +61 -53
  263. package/lib/gc/garbageCollection.js.map +1 -1
  264. package/lib/gc/gcConfigs.d.ts.map +1 -1
  265. package/lib/gc/gcConfigs.js +16 -12
  266. package/lib/gc/gcConfigs.js.map +1 -1
  267. package/lib/gc/gcDefinitions.d.ts +17 -4
  268. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  269. package/lib/gc/gcDefinitions.js +13 -14
  270. package/lib/gc/gcDefinitions.js.map +1 -1
  271. package/lib/gc/gcHelpers.d.ts +0 -8
  272. package/lib/gc/gcHelpers.d.ts.map +1 -1
  273. package/lib/gc/gcHelpers.js +5 -17
  274. package/lib/gc/gcHelpers.js.map +1 -1
  275. package/lib/gc/gcSummaryStateTracker.d.ts +4 -7
  276. package/lib/gc/gcSummaryStateTracker.d.ts.map +1 -1
  277. package/lib/gc/gcSummaryStateTracker.js +20 -59
  278. package/lib/gc/gcSummaryStateTracker.js.map +1 -1
  279. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  280. package/lib/gc/gcTelemetry.js +46 -36
  281. package/lib/gc/gcTelemetry.js.map +1 -1
  282. package/lib/gc/gcUnreferencedStateTracker.js +1 -1
  283. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  284. package/lib/gc/index.d.ts +2 -2
  285. package/lib/gc/index.d.ts.map +1 -1
  286. package/lib/gc/index.js +2 -2
  287. package/lib/gc/index.js.map +1 -1
  288. package/lib/id-compressor/appendOnlySortedMap.d.ts +8 -30
  289. package/lib/id-compressor/appendOnlySortedMap.d.ts.map +1 -1
  290. package/lib/id-compressor/appendOnlySortedMap.js +25 -66
  291. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  292. package/lib/id-compressor/finalSpace.d.ts +29 -0
  293. package/lib/id-compressor/finalSpace.d.ts.map +1 -0
  294. package/lib/id-compressor/finalSpace.js +58 -0
  295. package/lib/id-compressor/finalSpace.js.map +1 -0
  296. package/lib/id-compressor/idCompressor.d.ts +25 -250
  297. package/lib/id-compressor/idCompressor.d.ts.map +1 -1
  298. package/lib/id-compressor/idCompressor.js +385 -1142
  299. package/lib/id-compressor/idCompressor.js.map +1 -1
  300. package/lib/id-compressor/identifiers.d.ts +32 -0
  301. package/lib/id-compressor/identifiers.d.ts.map +1 -0
  302. package/lib/id-compressor/identifiers.js +11 -0
  303. package/lib/id-compressor/identifiers.js.map +1 -0
  304. package/lib/id-compressor/index.d.ts +5 -6
  305. package/lib/id-compressor/index.d.ts.map +1 -1
  306. package/lib/id-compressor/index.js +5 -6
  307. package/lib/id-compressor/index.js.map +1 -1
  308. package/lib/id-compressor/persistanceUtilities.d.ts +22 -0
  309. package/lib/id-compressor/persistanceUtilities.d.ts.map +1 -0
  310. package/lib/id-compressor/persistanceUtilities.js +34 -0
  311. package/lib/id-compressor/persistanceUtilities.js.map +1 -0
  312. package/lib/id-compressor/sessionSpaceNormalizer.d.ts +46 -0
  313. package/lib/id-compressor/sessionSpaceNormalizer.d.ts.map +1 -0
  314. package/lib/id-compressor/sessionSpaceNormalizer.js +76 -0
  315. package/lib/id-compressor/sessionSpaceNormalizer.js.map +1 -0
  316. package/lib/id-compressor/sessions.d.ts +115 -0
  317. package/lib/id-compressor/sessions.d.ts.map +1 -0
  318. package/lib/id-compressor/sessions.js +290 -0
  319. package/lib/id-compressor/sessions.js.map +1 -0
  320. package/lib/id-compressor/utilities.d.ts +49 -0
  321. package/lib/id-compressor/utilities.d.ts.map +1 -0
  322. package/lib/id-compressor/utilities.js +148 -0
  323. package/lib/id-compressor/utilities.js.map +1 -0
  324. package/lib/index.d.ts +3 -3
  325. package/lib/index.d.ts.map +1 -1
  326. package/lib/index.js +2 -2
  327. package/lib/index.js.map +1 -1
  328. package/lib/opLifecycle/batchManager.js +10 -6
  329. package/lib/opLifecycle/batchManager.js.map +1 -1
  330. package/lib/opLifecycle/opCompressor.d.ts +2 -2
  331. package/lib/opLifecycle/opCompressor.d.ts.map +1 -1
  332. package/lib/opLifecycle/opCompressor.js +10 -5
  333. package/lib/opLifecycle/opCompressor.js.map +1 -1
  334. package/lib/opLifecycle/opDecompressor.d.ts +2 -2
  335. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  336. package/lib/opLifecycle/opDecompressor.js +15 -12
  337. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  338. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  339. package/lib/opLifecycle/opGroupingManager.js +17 -7
  340. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  341. package/lib/opLifecycle/opSplitter.d.ts +2 -2
  342. package/lib/opLifecycle/opSplitter.d.ts.map +1 -1
  343. package/lib/opLifecycle/opSplitter.js +13 -10
  344. package/lib/opLifecycle/opSplitter.js.map +1 -1
  345. package/lib/opLifecycle/outbox.d.ts +7 -5
  346. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  347. package/lib/opLifecycle/outbox.js +13 -22
  348. package/lib/opLifecycle/outbox.js.map +1 -1
  349. package/lib/opLifecycle/remoteMessageProcessor.d.ts +6 -1
  350. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  351. package/lib/opLifecycle/remoteMessageProcessor.js +20 -8
  352. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  353. package/lib/opProperties.js +1 -2
  354. package/lib/opProperties.js.map +1 -1
  355. package/lib/packageVersion.d.ts +1 -1
  356. package/lib/packageVersion.js +1 -1
  357. package/lib/packageVersion.js.map +1 -1
  358. package/lib/pendingStateManager.d.ts +18 -8
  359. package/lib/pendingStateManager.d.ts.map +1 -1
  360. package/lib/pendingStateManager.js +62 -40
  361. package/lib/pendingStateManager.js.map +1 -1
  362. package/lib/scheduleManager.d.ts.map +1 -1
  363. package/lib/scheduleManager.js +18 -14
  364. package/lib/scheduleManager.js.map +1 -1
  365. package/lib/summary/index.d.ts +3 -3
  366. package/lib/summary/index.d.ts.map +1 -1
  367. package/lib/summary/index.js +1 -1
  368. package/lib/summary/index.js.map +1 -1
  369. package/lib/summary/orderedClientElection.d.ts +3 -3
  370. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  371. package/lib/summary/orderedClientElection.js +21 -22
  372. package/lib/summary/orderedClientElection.js.map +1 -1
  373. package/lib/summary/runWhileConnectedCoordinator.js +1 -1
  374. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  375. package/lib/summary/runningSummarizer.d.ts +31 -10
  376. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  377. package/lib/summary/runningSummarizer.js +265 -133
  378. package/lib/summary/runningSummarizer.js.map +1 -1
  379. package/lib/summary/summarizer.d.ts +8 -7
  380. package/lib/summary/summarizer.d.ts.map +1 -1
  381. package/lib/summary/summarizer.js +75 -74
  382. package/lib/summary/summarizer.js.map +1 -1
  383. package/lib/summary/summarizerClientElection.d.ts +2 -2
  384. package/lib/summary/summarizerClientElection.d.ts.map +1 -1
  385. package/lib/summary/summarizerClientElection.js +6 -10
  386. package/lib/summary/summarizerClientElection.js.map +1 -1
  387. package/lib/summary/summarizerHeuristics.js +9 -13
  388. package/lib/summary/summarizerHeuristics.js.map +1 -1
  389. package/lib/summary/summarizerNode/index.d.ts +1 -1
  390. package/lib/summary/summarizerNode/index.d.ts.map +1 -1
  391. package/lib/summary/summarizerNode/index.js.map +1 -1
  392. package/lib/summary/summarizerNode/summarizerNode.d.ts +10 -19
  393. package/lib/summary/summarizerNode/summarizerNode.d.ts.map +1 -1
  394. package/lib/summary/summarizerNode/summarizerNode.js +42 -115
  395. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  396. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +6 -30
  397. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  398. package/lib/summary/summarizerNode/summarizerNodeUtils.js +2 -4
  399. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  400. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +4 -14
  401. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  402. package/lib/summary/summarizerNode/summarizerNodeWithGc.js +14 -100
  403. package/lib/summary/summarizerNode/summarizerNodeWithGc.js.map +1 -1
  404. package/lib/summary/summarizerTypes.d.ts +38 -25
  405. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  406. package/lib/summary/summarizerTypes.js.map +1 -1
  407. package/lib/summary/summaryCollection.d.ts +2 -3
  408. package/lib/summary/summaryCollection.d.ts.map +1 -1
  409. package/lib/summary/summaryCollection.js +5 -6
  410. package/lib/summary/summaryCollection.js.map +1 -1
  411. package/lib/summary/summaryFormat.d.ts +3 -0
  412. package/lib/summary/summaryFormat.d.ts.map +1 -1
  413. package/lib/summary/summaryFormat.js +5 -3
  414. package/lib/summary/summaryFormat.js.map +1 -1
  415. package/lib/summary/summaryGenerator.d.ts +10 -4
  416. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  417. package/lib/summary/summaryGenerator.js +100 -51
  418. package/lib/summary/summaryGenerator.js.map +1 -1
  419. package/lib/summary/summaryManager.d.ts +8 -8
  420. package/lib/summary/summaryManager.d.ts.map +1 -1
  421. package/lib/summary/summaryManager.js +35 -25
  422. package/lib/summary/summaryManager.js.map +1 -1
  423. package/package.json +28 -31
  424. package/src/batchTracker.ts +7 -5
  425. package/src/blobManager.ts +188 -166
  426. package/src/connectionTelemetry.ts +9 -4
  427. package/src/containerRuntime.ts +806 -441
  428. package/src/dataStore.ts +12 -4
  429. package/src/dataStoreContext.ts +39 -43
  430. package/src/dataStoreContexts.ts +4 -6
  431. package/src/dataStoreRegistry.ts +1 -1
  432. package/src/dataStores.ts +114 -80
  433. package/src/deltaManagerProxyBase.ts +111 -0
  434. package/src/deltaManagerSummarizerProxy.ts +4 -1
  435. package/src/deltaScheduler.ts +7 -11
  436. package/src/error.ts +18 -0
  437. package/src/gc/garbageCollection.md +53 -5
  438. package/src/gc/garbageCollection.ts +58 -52
  439. package/src/gc/gcConfigs.ts +4 -2
  440. package/src/gc/gcDefinitions.ts +17 -20
  441. package/src/gc/gcEarlyAdoption.md +145 -0
  442. package/src/gc/gcHelpers.ts +1 -12
  443. package/src/gc/gcSummaryStateTracker.ts +19 -65
  444. package/src/gc/gcTelemetry.ts +14 -12
  445. package/src/gc/gcUnreferencedStateTracker.ts +1 -1
  446. package/src/gc/index.ts +2 -4
  447. package/src/id-compressor/appendOnlySortedMap.ts +26 -87
  448. package/src/id-compressor/finalSpace.ts +67 -0
  449. package/src/id-compressor/idCompressor.ts +458 -1682
  450. package/src/id-compressor/identifiers.ts +42 -0
  451. package/src/id-compressor/index.ts +11 -20
  452. package/src/id-compressor/persistanceUtilities.ts +58 -0
  453. package/src/id-compressor/sessionSpaceNormalizer.ts +83 -0
  454. package/src/id-compressor/sessions.ts +405 -0
  455. package/src/id-compressor/utilities.ts +187 -0
  456. package/src/index.ts +7 -2
  457. package/src/opLifecycle/opCompressor.ts +6 -5
  458. package/src/opLifecycle/opDecompressor.ts +6 -4
  459. package/src/opLifecycle/opGroupingManager.ts +9 -6
  460. package/src/opLifecycle/opSplitter.ts +7 -6
  461. package/src/opLifecycle/outbox.ts +23 -32
  462. package/src/opLifecycle/remoteMessageProcessor.ts +27 -8
  463. package/src/packageVersion.ts +1 -1
  464. package/src/pendingStateManager.ts +72 -42
  465. package/src/scheduleManager.ts +7 -5
  466. package/src/summary/index.ts +4 -3
  467. package/src/summary/orderedClientElection.ts +10 -6
  468. package/src/summary/runWhileConnectedCoordinator.ts +1 -1
  469. package/src/summary/runningSummarizer.ts +291 -163
  470. package/src/summary/summarizer.ts +27 -16
  471. package/src/summary/summarizerClientElection.ts +2 -2
  472. package/src/summary/summarizerHeuristics.ts +1 -1
  473. package/src/summary/summarizerNode/index.ts +1 -2
  474. package/src/summary/summarizerNode/summarizerNode.ts +36 -160
  475. package/src/summary/summarizerNode/summarizerNodeUtils.ts +7 -38
  476. package/src/summary/summarizerNode/summarizerNodeWithGc.ts +11 -130
  477. package/src/summary/summarizerTypes.ts +40 -25
  478. package/src/summary/summaryCollection.ts +3 -3
  479. package/src/summary/summaryFormat.ts +4 -1
  480. package/src/summary/summaryGenerator.ts +52 -52
  481. package/src/summary/summaryManager.ts +44 -17
  482. package/dist/id-compressor/idRange.d.ts +0 -11
  483. package/dist/id-compressor/idRange.d.ts.map +0 -1
  484. package/dist/id-compressor/idRange.js +0 -29
  485. package/dist/id-compressor/idRange.js.map +0 -1
  486. package/dist/id-compressor/numericUuid.d.ts +0 -59
  487. package/dist/id-compressor/numericUuid.d.ts.map +0 -1
  488. package/dist/id-compressor/numericUuid.js +0 -325
  489. package/dist/id-compressor/numericUuid.js.map +0 -1
  490. package/dist/id-compressor/sessionIdNormalizer.d.ts +0 -138
  491. package/dist/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  492. package/dist/id-compressor/sessionIdNormalizer.js +0 -488
  493. package/dist/id-compressor/sessionIdNormalizer.js.map +0 -1
  494. package/dist/id-compressor/utils.d.ts +0 -57
  495. package/dist/id-compressor/utils.d.ts.map +0 -1
  496. package/dist/id-compressor/utils.js +0 -90
  497. package/dist/id-compressor/utils.js.map +0 -1
  498. package/dist/id-compressor/uuidUtilities.d.ts +0 -28
  499. package/dist/id-compressor/uuidUtilities.d.ts.map +0 -1
  500. package/dist/id-compressor/uuidUtilities.js +0 -104
  501. package/dist/id-compressor/uuidUtilities.js.map +0 -1
  502. package/lib/id-compressor/idRange.d.ts +0 -11
  503. package/lib/id-compressor/idRange.d.ts.map +0 -1
  504. package/lib/id-compressor/idRange.js +0 -25
  505. package/lib/id-compressor/idRange.js.map +0 -1
  506. package/lib/id-compressor/numericUuid.d.ts +0 -59
  507. package/lib/id-compressor/numericUuid.d.ts.map +0 -1
  508. package/lib/id-compressor/numericUuid.js +0 -315
  509. package/lib/id-compressor/numericUuid.js.map +0 -1
  510. package/lib/id-compressor/sessionIdNormalizer.d.ts +0 -138
  511. package/lib/id-compressor/sessionIdNormalizer.d.ts.map +0 -1
  512. package/lib/id-compressor/sessionIdNormalizer.js +0 -484
  513. package/lib/id-compressor/sessionIdNormalizer.js.map +0 -1
  514. package/lib/id-compressor/utils.d.ts +0 -57
  515. package/lib/id-compressor/utils.d.ts.map +0 -1
  516. package/lib/id-compressor/utils.js +0 -79
  517. package/lib/id-compressor/utils.js.map +0 -1
  518. package/lib/id-compressor/uuidUtilities.d.ts +0 -28
  519. package/lib/id-compressor/uuidUtilities.d.ts.map +0 -1
  520. package/lib/id-compressor/uuidUtilities.js +0 -96
  521. package/lib/id-compressor/uuidUtilities.js.map +0 -1
  522. package/src/id-compressor/idRange.ts +0 -35
  523. package/src/id-compressor/numericUuid.ts +0 -383
  524. package/src/id-compressor/sessionIdNormalizer.ts +0 -609
  525. package/src/id-compressor/utils.ts +0 -114
  526. package/src/id-compressor/uuidUtilities.ts +0 -120
package/src/dataStore.ts CHANGED
@@ -3,10 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryLoggerExt, TelemetryDataTag } from "@fluidframework/telemetry-utils";
7
- import { assert, unreachableCase } from "@fluidframework/common-utils";
6
+ import { ITelemetryLoggerExt, TelemetryDataTag, UsageError } from "@fluidframework/telemetry-utils";
7
+ import { assert, unreachableCase } from "@fluidframework/core-utils";
8
8
  import { AttachState } from "@fluidframework/container-definitions";
9
- import { UsageError } from "@fluidframework/container-utils";
10
9
  import { FluidObject, IFluidHandle, IRequest, IResponse } from "@fluidframework/core-interfaces";
11
10
  import {
12
11
  AliasResult,
@@ -62,6 +61,9 @@ class DataStore implements IDataStore {
62
61
  private readonly pendingAliases: Map<string, Promise<AliasResult>>;
63
62
  private aliasResult: Promise<AliasResult> | undefined;
64
63
 
64
+ /**
65
+ * {@inheritDoc @fluidframework/runtime-definitions#IDataStore.trySetAlias}
66
+ */
65
67
  async trySetAlias(alias: string): Promise<AliasResult> {
66
68
  if (alias.includes("/")) {
67
69
  throw new UsageError(`The alias cannot contain slashes: '${alias}'`);
@@ -158,7 +160,10 @@ class DataStore implements IDataStore {
158
160
  return "Success";
159
161
  }
160
162
 
161
- async request(request: IRequest): Promise<IResponse> {
163
+ /**
164
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
165
+ */
166
+ public async request(request: IRequest): Promise<IResponse> {
162
167
  return this.fluidDataStoreChannel.request(request);
163
168
  }
164
169
 
@@ -179,6 +184,9 @@ class DataStore implements IDataStore {
179
184
  this.pendingAliases = datastores.pendingAliases;
180
185
  }
181
186
 
187
+ /**
188
+ * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
189
+ */
182
190
  public get IFluidRouter() {
183
191
  return this.fluidDataStoreChannel;
184
192
  }
@@ -17,8 +17,8 @@ import {
17
17
  AttachState,
18
18
  ILoaderOptions,
19
19
  } from "@fluidframework/container-definitions";
20
- import { assert, Deferred, TypedEventEmitter } from "@fluidframework/common-utils";
21
- import { LazyPromise } from "@fluidframework/core-utils";
20
+ import { TypedEventEmitter } from "@fluid-internal/client-utils";
21
+ import { assert, Deferred, LazyPromise } from "@fluidframework/core-utils";
22
22
  import { IDocumentStorageService } from "@fluidframework/driver-definitions";
23
23
  import { BlobTreeEntry, readAndParse } from "@fluidframework/driver-utils";
24
24
  import {
@@ -54,27 +54,19 @@ import {
54
54
  IIdCompressorCore,
55
55
  VisibilityState,
56
56
  } from "@fluidframework/runtime-definitions";
57
+ import { addBlobToSummary, convertSummaryTreeToITree } from "@fluidframework/runtime-utils";
57
58
  import {
58
- addBlobToSummary,
59
- convertSummaryTreeToITree,
60
- packagePathToTelemetryProperty,
61
- } from "@fluidframework/runtime-utils";
62
- import {
63
- ChildLogger,
59
+ createChildMonitoringContext,
60
+ DataCorruptionError,
61
+ DataProcessingError,
62
+ extractSafePropertiesFromMessage,
64
63
  generateStack,
65
64
  ITelemetryLoggerExt,
66
- loggerToMonitoringContext,
67
65
  LoggingError,
68
66
  MonitoringContext,
69
- TelemetryDataTag,
67
+ tagCodeArtifacts,
70
68
  ThresholdCounter,
71
69
  } from "@fluidframework/telemetry-utils";
72
- import {
73
- DataCorruptionError,
74
- DataProcessingError,
75
- extractSafePropertiesFromMessage,
76
- } from "@fluidframework/container-utils";
77
-
78
70
  import {
79
71
  dataStoreAttributesBlobName,
80
72
  hasIsolatedChannels,
@@ -316,9 +308,18 @@ export abstract class FluidDataStoreContext
316
308
  async (fullGC?: boolean) => this.getGCDataInternal(fullGC),
317
309
  );
318
310
 
319
- this.mc = loggerToMonitoringContext(
320
- ChildLogger.create(this.logger, "FluidDataStoreContext"),
321
- );
311
+ this.mc = createChildMonitoringContext({
312
+ logger: this.logger,
313
+ namespace: "FluidDataStoreContext",
314
+ properties: {
315
+ all: tagCodeArtifacts({
316
+ fluidDataStoreId: this.id,
317
+ // The package name is a getter because `this.pkg` may not be initialized during construction.
318
+ // For data stores loaded from summary, it is initialized during data store realization.
319
+ fullPackageName: () => this.pkg?.join("/"),
320
+ }),
321
+ },
322
+ });
322
323
  this.thresholdOpsCounter = new ThresholdCounter(
323
324
  FluidDataStoreContext.pendingOpsCountThreshold,
324
325
  this.mc.logger,
@@ -374,10 +375,13 @@ export abstract class FluidDataStoreContext
374
375
  failedPkgPath?: string,
375
376
  fullPackageName?: readonly string[],
376
377
  ): never {
377
- throw new LoggingError(reason, {
378
- failedPkgPath: { value: failedPkgPath, tag: TelemetryDataTag.CodeArtifact },
379
- fullPackageName: packagePathToTelemetryProperty(fullPackageName),
380
- });
378
+ throw new LoggingError(
379
+ reason,
380
+ tagCodeArtifacts({
381
+ failedPkgPath,
382
+ packagePath: fullPackageName?.join("/"),
383
+ }),
384
+ );
381
385
  }
382
386
 
383
387
  public async realize(): Promise<IFluidDataStoreChannel> {
@@ -389,13 +393,12 @@ export abstract class FluidDataStoreContext
389
393
  error,
390
394
  "realizeFluidDataStoreContext",
391
395
  );
392
- errorWrapped.addTelemetryProperties({
393
- fluidDataStoreId: {
394
- value: this.id,
395
- tag: TelemetryDataTag.CodeArtifact,
396
- },
397
- packageName: packagePathToTelemetryProperty(this.pkg),
398
- });
396
+ errorWrapped.addTelemetryProperties(
397
+ tagCodeArtifacts({
398
+ fullPackageName: this.pkg?.join("/"),
399
+ fluidDataStoreId: this.id,
400
+ }),
401
+ );
399
402
  this.channelDeferred?.reject(errorWrapped);
400
403
  this.mc.logger.sendErrorEvent({ eventName: "RealizeError" }, errorWrapped);
401
404
  });
@@ -790,10 +793,6 @@ export abstract class FluidDataStoreContext
790
793
  this.mc.logger.sendErrorEvent(
791
794
  {
792
795
  eventName: "BindRuntimeError",
793
- fluidDataStoreId: {
794
- value: this.id,
795
- tag: TelemetryDataTag.CodeArtifact,
796
- },
797
796
  },
798
797
  error,
799
798
  );
@@ -849,8 +848,7 @@ export abstract class FluidDataStoreContext
849
848
  await this.realize();
850
849
  }
851
850
  assert(!!this.channel, 0x14c /* "Channel must exist when rebasing ops" */);
852
- const innerContents = contents as FluidDataStoreMessage;
853
- return this.channel.applyStashedOp(innerContents.content);
851
+ return this.channel.applyStashedOp(contents);
854
852
  }
855
853
 
856
854
  private verifyNotClosed(
@@ -917,11 +915,6 @@ export abstract class FluidDataStoreContext
917
915
  this.mc.logger.sendTelemetryEvent({
918
916
  eventName,
919
917
  type,
920
- fluidDataStoreId: {
921
- value: this.id,
922
- tag: TelemetryDataTag.CodeArtifact,
923
- },
924
- packageName: packagePathToTelemetryProperty(this.pkg),
925
918
  isSummaryInProgress: this.summarizerNode.isSummaryInProgress?.(),
926
919
  stack: generateStack(),
927
920
  });
@@ -943,8 +936,11 @@ export abstract class FluidDataStoreContext
943
936
  );
944
937
  }
945
938
 
946
- public async uploadBlob(blob: ArrayBufferLike): Promise<IFluidHandle<ArrayBufferLike>> {
947
- return this.containerRuntime.uploadBlob(blob);
939
+ public async uploadBlob(
940
+ blob: ArrayBufferLike,
941
+ signal?: AbortSignal,
942
+ ): Promise<IFluidHandle<ArrayBufferLike>> {
943
+ return this.containerRuntime.uploadBlob(blob, signal);
948
944
  }
949
945
  }
950
946
 
@@ -3,11 +3,9 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import { ITelemetryBaseLogger } from "@fluidframework/common-definitions";
7
- import { assert, Deferred } from "@fluidframework/common-utils";
8
- import { Lazy } from "@fluidframework/core-utils";
9
- import { IDisposable } from "@fluidframework/core-interfaces";
10
- import { ChildLogger, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
6
+ import { assert, Deferred, Lazy } from "@fluidframework/core-utils";
7
+ import { IDisposable, ITelemetryBaseLogger } from "@fluidframework/core-interfaces";
8
+ import { createChildLogger, ITelemetryLoggerExt } from "@fluidframework/telemetry-utils";
11
9
  import { FluidDataStoreContext, LocalFluidDataStoreContext } from "./dataStoreContext";
12
10
 
13
11
  export class DataStoreContexts implements Iterable<[string, FluidDataStoreContext]>, IDisposable {
@@ -47,7 +45,7 @@ export class DataStoreContexts implements Iterable<[string, FluidDataStoreContex
47
45
  private readonly _logger: ITelemetryLoggerExt;
48
46
 
49
47
  constructor(baseLogger: ITelemetryBaseLogger) {
50
- this._logger = ChildLogger.create(baseLogger);
48
+ this._logger = createChildLogger({ logger: baseLogger });
51
49
  }
52
50
 
53
51
  [Symbol.iterator](): Iterator<[string, FluidDataStoreContext]> {
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { UsageError } from "@fluidframework/container-utils";
5
+ import { UsageError } from "@fluidframework/telemetry-utils";
6
6
  import {
7
7
  FluidDataStoreRegistryEntry,
8
8
  IFluidDataStoreRegistry,
package/src/dataStores.ts CHANGED
@@ -3,10 +3,6 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
- import {
7
- DataCorruptionError,
8
- extractSafePropertiesFromMessage,
9
- } from "@fluidframework/container-utils";
10
6
  import {
11
7
  ITelemetryBaseLogger,
12
8
  IDisposable,
@@ -42,16 +38,16 @@ import {
42
38
  unpackChildNodesUsedRoutes,
43
39
  } from "@fluidframework/runtime-utils";
44
40
  import {
45
- ChildLogger,
46
- loggerToMonitoringContext,
41
+ createChildMonitoringContext,
42
+ DataCorruptionError,
43
+ extractSafePropertiesFromMessage,
47
44
  LoggingError,
48
45
  MonitoringContext,
49
- TelemetryDataTag,
46
+ tagCodeArtifacts,
50
47
  } from "@fluidframework/telemetry-utils";
51
48
  import { AttachState } from "@fluidframework/container-definitions";
52
49
  import { buildSnapshotTree } from "@fluidframework/driver-utils";
53
- import { assert } from "@fluidframework/common-utils";
54
- import { Lazy } from "@fluidframework/core-utils";
50
+ import { assert, Lazy } from "@fluidframework/core-utils";
55
51
  import { v4 as uuid } from "uuid";
56
52
  import { DataStoreContexts } from "./dataStoreContexts";
57
53
  import {
@@ -71,7 +67,7 @@ import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs";
71
67
  import { IDataStoreAliasMessage, isDataStoreAliasMessage } from "./dataStore";
72
68
  import {
73
69
  GCNodeType,
74
- sweepDatastoresKey,
70
+ disableDatastoreSweepKey,
75
71
  throwOnTombstoneLoadKey,
76
72
  sendGCUnexpectedUsageEvent,
77
73
  } from "./gc";
@@ -137,7 +133,7 @@ export class DataStores implements IDisposable {
137
133
  private readonly aliasMap: Map<string, string>,
138
134
  private readonly contexts: DataStoreContexts = new DataStoreContexts(baseLogger),
139
135
  ) {
140
- this.mc = loggerToMonitoringContext(ChildLogger.create(baseLogger));
136
+ this.mc = createChildMonitoringContext({ logger: baseLogger });
141
137
  this.containerRuntimeHandle = new FluidObjectHandle(
142
138
  this.runtime,
143
139
  "/",
@@ -243,10 +239,7 @@ export class DataStores implements IDisposable {
243
239
  "Duplicate DataStore created with existing id",
244
240
  {
245
241
  ...extractSafePropertiesFromMessage(message),
246
- dataStoreId: {
247
- value: attachMessage.id,
248
- tag: TelemetryDataTag.CodeArtifact,
249
- },
242
+ ...tagCodeArtifacts({ dataStoreId: attachMessage.id }),
250
243
  },
251
244
  );
252
245
  throw error;
@@ -435,8 +428,7 @@ export class DataStores implements IDisposable {
435
428
  ) {
436
429
  const envelope = message.contents as IEnvelope;
437
430
  const transformed = { ...message, contents: envelope.contents };
438
- const request = { url: envelope.address };
439
- this.validateNotDeleted(envelope.address, request);
431
+ this.validateNotDeleted(envelope.address);
440
432
  const context = this.contexts.get(envelope.address);
441
433
  assert(!!context, 0x162 /* "There should be a store context for the op" */);
442
434
  context.process(transformed, local, localMessageMetadata);
@@ -455,114 +447,154 @@ export class DataStores implements IDisposable {
455
447
  requestHeaderData: RuntimeHeaderData,
456
448
  ): Promise<FluidDataStoreContext> {
457
449
  const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
458
- const request = { url: id };
459
-
460
- this.validateNotDeleted(id, request, headerData);
450
+ this.validateNotDeleted(id, headerData);
461
451
 
462
452
  const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
463
453
  if (context === undefined) {
464
454
  // The requested data store does not exits. Throw a 404 response exception.
455
+ const request: IRequest = { url: id };
465
456
  throw responseToException(create404Response(request), request);
466
457
  }
467
458
 
468
- this.validateNotTombstoned(context, request, requestHeaderData);
459
+ this.validateNotTombstoned(context, requestHeaderData);
469
460
 
470
461
  return context;
471
462
  }
472
463
 
473
464
  /**
474
- * Validate that the data store had not been deleted by GC.
475
- *
465
+ * Returns the data store requested with the given id if available. Otherwise, returns undefined.
466
+ */
467
+ public async getDataStoreIfAvailable(
468
+ id: string,
469
+ requestHeaderData: RuntimeHeaderData,
470
+ ): Promise<FluidDataStoreContext | undefined> {
471
+ // If the data store has been deleted, return undefined.
472
+ if (this.checkIfDeleted(id, requestHeaderData)) {
473
+ return undefined;
474
+ }
475
+ const headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };
476
+ const context = await this.contexts.getBoundOrRemoted(id, headerData.wait);
477
+ if (context === undefined) {
478
+ return undefined;
479
+ }
480
+ // Check if the data store is tombstoned. If so, we want to log a telemetry event.
481
+ this.checkIfTombstoned(context, requestHeaderData);
482
+ return context;
483
+ }
484
+
485
+ /**
486
+ * Checks if the data store has been deleted by GC.
476
487
  * @param id - data store id
477
488
  * @param request - the request information to log if the validation detects the data store has been deleted
478
489
  * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
490
+ * @returns true if the data store is deleted. Otherwise, returns false.
479
491
  */
480
- private validateNotDeleted(
481
- id: string,
482
- request: IRequest,
483
- requestHeaderData?: RuntimeHeaderData,
484
- ) {
492
+ private checkIfDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {
485
493
  const dataStoreNodePath = `/${id}`;
486
- if (this.isDataStoreDeleted(dataStoreNodePath)) {
487
- assert(
488
- !this.contexts.has(id),
489
- 0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,
490
- );
494
+ if (!this.isDataStoreDeleted(dataStoreNodePath)) {
495
+ return false;
496
+ }
497
+ assert(
498
+ !this.contexts.has(id),
499
+ 0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,
500
+ );
501
+ sendGCUnexpectedUsageEvent(
502
+ this.mc,
503
+ {
504
+ eventName: "GC_Deleted_DataStore_Requested",
505
+ category: "error",
506
+ isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
507
+ id,
508
+ headers: JSON.stringify(requestHeaderData),
509
+ gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
510
+ },
511
+ undefined /* packagePath */,
512
+ );
513
+ return true;
514
+ }
515
+
516
+ /**
517
+ * Validate that the data store had not been deleted by GC.
518
+ * @param id - data store id
519
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted
520
+ */
521
+ private validateNotDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {
522
+ if (this.checkIfDeleted(id, requestHeaderData)) {
491
523
  // The requested data store is removed by gc. Create a 404 gc response exception.
492
- const error = responseToException(
524
+ const request: IRequest = { url: id };
525
+ throw responseToException(
493
526
  createResponseError(404, "DataStore was deleted", request),
494
527
  request,
495
528
  );
496
- sendGCUnexpectedUsageEvent(
497
- this.mc,
498
- {
499
- eventName: "GC_Deleted_DataStore_Requested",
500
- category: "error",
501
- isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
502
- headers: JSON.stringify(requestHeaderData),
503
- gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
504
- },
505
- undefined /** packagePath */,
506
- error,
507
- );
508
- throw error;
509
529
  }
510
530
  }
511
531
 
532
+ /**
533
+ * Checks if the data store has not been marked as tombstone by GC or not.
534
+ * @param context - the data store context in question
535
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned
536
+ * @returns true if the data store is tombstoned. Otherwise, returns false.
537
+ */
538
+ private checkIfTombstoned(
539
+ context: FluidDataStoreContext,
540
+ requestHeaderData: RuntimeHeaderData,
541
+ ) {
542
+ if (!context.tombstoned) {
543
+ return false;
544
+ }
545
+ const logErrorEvent = this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone;
546
+ sendGCUnexpectedUsageEvent(
547
+ this.mc,
548
+ {
549
+ eventName: "GC_Tombstone_DataStore_Requested",
550
+ category: logErrorEvent ? "error" : "generic",
551
+ isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
552
+ id: context.id,
553
+ headers: JSON.stringify(requestHeaderData),
554
+ gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
555
+ },
556
+ context.isLoaded ? context.packagePath : undefined,
557
+ );
558
+ return true;
559
+ }
560
+
512
561
  /**
513
562
  * Validates that the data store context requested has not been marked as tombstone by GC.
514
- *
515
563
  * @param context - the data store context in question
516
564
  * @param request - the request information to log if the validation detects the data store has been tombstoned
517
- * @param headerData - the request header information to log if the validation detects the data store has been tombstoned
565
+ * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned
518
566
  */
519
567
  private validateNotTombstoned(
520
568
  context: FluidDataStoreContext,
521
- request: IRequest,
522
- headerData: RuntimeHeaderData,
569
+ requestHeaderData: RuntimeHeaderData,
523
570
  ) {
524
- if (context.tombstoned) {
525
- const shouldFail = this.throwOnTombstoneLoad && !headerData.allowTombstone;
526
-
571
+ if (this.checkIfTombstoned(context, requestHeaderData)) {
527
572
  // The requested data store is removed by gc. Create a 404 gc response exception.
573
+ const request: IRequest = { url: context.id };
528
574
  const error = responseToException(
529
575
  createResponseError(404, "DataStore was deleted", request, {
530
576
  [TombstoneResponseHeaderKey]: true,
531
577
  }),
532
578
  request,
533
579
  );
534
- sendGCUnexpectedUsageEvent(
535
- this.mc,
536
- {
537
- eventName: "GC_Tombstone_DataStore_Requested",
538
- category: shouldFail ? "error" : "generic",
539
- isSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,
540
- headers: JSON.stringify(headerData),
541
- gcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,
542
- },
543
- context.isLoaded ? context.packagePath : undefined,
544
- error,
545
- );
546
-
547
- if (shouldFail) {
580
+ // Throw an error if configured via options and via request headers.
581
+ if (this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone) {
548
582
  throw error;
549
583
  }
550
584
  }
551
585
  }
552
586
 
553
- public processSignal(address: string, message: IInboundSignalMessage, local: boolean) {
554
- const request = { url: address };
555
- this.validateNotDeleted(address, request);
556
- const context = this.contexts.get(address);
587
+ public processSignal(fluidDataStoreId: string, message: IInboundSignalMessage, local: boolean) {
588
+ this.validateNotDeleted(fluidDataStoreId);
589
+ const context = this.contexts.get(fluidDataStoreId);
557
590
  if (!context) {
558
591
  // Attach message may not have been processed yet
559
592
  assert(!local, 0x163 /* "Missing datastore for local signal" */);
560
593
  this.mc.logger.sendTelemetryEvent({
561
594
  eventName: "SignalFluidDataStoreNotFound",
562
- fluidDataStoreId: {
563
- value: address,
564
- tag: TelemetryDataTag.CodeArtifact,
565
- },
595
+ ...tagCodeArtifacts({
596
+ fluidDataStoreId,
597
+ }),
566
598
  });
567
599
  return;
568
600
  }
@@ -571,7 +603,7 @@ export class DataStores implements IDisposable {
571
603
  }
572
604
 
573
605
  public setConnectionState(connected: boolean, clientId?: string) {
574
- for (const [fluidDataStore, context] of this.contexts) {
606
+ for (const [fluidDataStoreId, context] of this.contexts) {
575
607
  try {
576
608
  context.setConnectionState(connected, clientId);
577
609
  } catch (error) {
@@ -579,7 +611,9 @@ export class DataStores implements IDisposable {
579
611
  {
580
612
  eventName: "SetConnectionStateError",
581
613
  clientId,
582
- fluidDataStore,
614
+ ...tagCodeArtifacts({
615
+ fluidDataStoreId,
616
+ }),
583
617
  details: JSON.stringify({
584
618
  runtimeConnected: this.runtime.connected,
585
619
  connected,
@@ -786,11 +820,11 @@ export class DataStores implements IDisposable {
786
820
  * Delete data stores and its objects that are sweep ready.
787
821
  * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
788
822
  * be deleted.
789
- * @returns - The routes of data stores and its objects that were deleted.
823
+ * @returns The routes of data stores and its objects that were deleted.
790
824
  */
791
825
  public deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[] {
792
826
  // If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
793
- if (this.mc.config.getBoolean(sweepDatastoresKey) !== true) {
827
+ if (this.mc.config.getBoolean(disableDatastoreSweepKey) === true) {
794
828
  return [];
795
829
  }
796
830
  for (const route of sweepReadyDataStoreRoutes) {
@@ -0,0 +1,111 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { EventForwarder } from "@fluid-internal/client-utils";
7
+ import {
8
+ IDeltaManager,
9
+ IDeltaManagerEvents,
10
+ IDeltaQueue,
11
+ IDeltaSender,
12
+ ReadOnlyInfo,
13
+ } from "@fluidframework/container-definitions";
14
+ import {
15
+ IClientConfiguration,
16
+ IClientDetails,
17
+ IDocumentMessage,
18
+ ISequencedDocumentMessage,
19
+ ISignalMessage,
20
+ } from "@fluidframework/protocol-definitions";
21
+
22
+ /**
23
+ * Base class for creating proxy to the real delta manager. It implements all required methods on IDeltaManager and
24
+ * proxy implementations can override specific methods.
25
+ */
26
+ export class DeltaManagerProxyBase
27
+ extends EventForwarder<IDeltaManagerEvents>
28
+ implements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
29
+ {
30
+ public get IDeltaSender(): IDeltaSender {
31
+ return this;
32
+ }
33
+
34
+ public get inbound(): IDeltaQueue<ISequencedDocumentMessage> {
35
+ return this.deltaManager.inbound;
36
+ }
37
+
38
+ public get outbound(): IDeltaQueue<IDocumentMessage[]> {
39
+ return this.deltaManager.outbound;
40
+ }
41
+
42
+ public get inboundSignal(): IDeltaQueue<ISignalMessage> {
43
+ return this.deltaManager.inboundSignal;
44
+ }
45
+
46
+ public get minimumSequenceNumber(): number {
47
+ return this.deltaManager.minimumSequenceNumber;
48
+ }
49
+
50
+ public get lastSequenceNumber(): number {
51
+ return this.deltaManager.lastSequenceNumber;
52
+ }
53
+
54
+ public get lastMessage() {
55
+ return this.deltaManager.lastMessage;
56
+ }
57
+
58
+ public get lastKnownSeqNumber() {
59
+ return this.deltaManager.lastKnownSeqNumber;
60
+ }
61
+
62
+ public get initialSequenceNumber(): number {
63
+ return this.deltaManager.initialSequenceNumber;
64
+ }
65
+
66
+ public get hasCheckpointSequenceNumber() {
67
+ return this.deltaManager.hasCheckpointSequenceNumber;
68
+ }
69
+
70
+ public get clientDetails(): IClientDetails {
71
+ return this.deltaManager.clientDetails;
72
+ }
73
+
74
+ public get version(): string {
75
+ return this.deltaManager.version;
76
+ }
77
+
78
+ public get maxMessageSize(): number {
79
+ return this.deltaManager.maxMessageSize;
80
+ }
81
+
82
+ public get serviceConfiguration(): IClientConfiguration | undefined {
83
+ return this.deltaManager.serviceConfiguration;
84
+ }
85
+
86
+ public get active(): boolean {
87
+ return this.deltaManager.active;
88
+ }
89
+
90
+ public get readOnlyInfo(): ReadOnlyInfo {
91
+ return this.deltaManager.readOnlyInfo;
92
+ }
93
+
94
+ constructor(
95
+ protected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,
96
+ ) {
97
+ super(deltaManager);
98
+ }
99
+
100
+ public dispose(): void {
101
+ super.dispose();
102
+ }
103
+
104
+ public submitSignal(content: any): void {
105
+ return this.deltaManager.submitSignal(content);
106
+ }
107
+
108
+ public flush(): void {
109
+ return this.deltaManager.flush();
110
+ }
111
+ }
@@ -4,8 +4,9 @@
4
4
  */
5
5
 
6
6
  import { IDeltaManager, ReadOnlyInfo } from "@fluidframework/container-definitions";
7
- import { DeltaManagerProxyBase } from "@fluidframework/container-utils";
8
7
  import { IDocumentMessage, ISequencedDocumentMessage } from "@fluidframework/protocol-definitions";
8
+
9
+ import { DeltaManagerProxyBase } from "./deltaManagerProxyBase";
9
10
  import { summarizerClientType } from "./summary";
10
11
 
11
12
  /**
@@ -41,6 +42,8 @@ export class DeltaManagerSummarizerProxy
41
42
 
42
43
  constructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {
43
44
  super(deltaManager);
45
+ // We are expecting this class to have many listeners, so we suppress noisy "MaxListenersExceededWarning" logging.
46
+ super.setMaxListeners(0);
44
47
  this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
45
48
  }
46
49
  }