@fluidframework/container-runtime 2.0.0-internal.6.3.3 → 2.0.0-internal.7.0.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 (286) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/dist/blobManager.d.ts +4 -3
  3. package/dist/blobManager.d.ts.map +1 -1
  4. package/dist/blobManager.js +35 -31
  5. package/dist/blobManager.js.map +1 -1
  6. package/dist/containerHandleContext.js +3 -3
  7. package/dist/containerHandleContext.js.map +1 -1
  8. package/dist/containerRuntime.d.ts +21 -78
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +378 -412
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/dataStore.js +9 -9
  13. package/dist/dataStore.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +1 -3
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +54 -56
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/dataStoreRegistry.js +3 -3
  19. package/dist/dataStoreRegistry.js.map +1 -1
  20. package/dist/dataStores.d.ts +1 -1
  21. package/dist/dataStores.js +3 -3
  22. package/dist/dataStores.js.map +1 -1
  23. package/dist/deltaManagerProxyBase.js +4 -4
  24. package/dist/deltaManagerProxyBase.js.map +1 -1
  25. package/dist/deltaManagerSummarizerProxy.js +6 -6
  26. package/dist/deltaManagerSummarizerProxy.js.map +1 -1
  27. package/dist/deltaScheduler.js.map +1 -1
  28. package/dist/gc/garbageCollection.d.ts +6 -3
  29. package/dist/gc/garbageCollection.d.ts.map +1 -1
  30. package/dist/gc/garbageCollection.js +19 -16
  31. package/dist/gc/garbageCollection.js.map +1 -1
  32. package/dist/gc/gcDefinitions.d.ts +17 -17
  33. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  34. package/dist/gc/gcDefinitions.js +14 -15
  35. package/dist/gc/gcDefinitions.js.map +1 -1
  36. package/dist/gc/gcHelpers.d.ts +0 -9
  37. package/dist/gc/gcHelpers.d.ts.map +1 -1
  38. package/dist/gc/gcHelpers.js +1 -13
  39. package/dist/gc/gcHelpers.js.map +1 -1
  40. package/dist/gc/gcTelemetry.d.ts +1 -1
  41. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  42. package/dist/gc/gcTelemetry.js +1 -4
  43. package/dist/gc/gcTelemetry.js.map +1 -1
  44. package/dist/gc/gcUnreferencedStateTracker.js +3 -3
  45. package/dist/gc/gcUnreferencedStateTracker.js.map +1 -1
  46. package/dist/gc/index.d.ts +2 -2
  47. package/dist/gc/index.d.ts.map +1 -1
  48. package/dist/gc/index.js +3 -4
  49. package/dist/gc/index.js.map +1 -1
  50. package/dist/id-compressor/appendOnlySortedMap.js.map +1 -1
  51. package/dist/id-compressor/idCompressor.js.map +1 -1
  52. package/dist/id-compressor/identifiers.d.ts +3 -3
  53. package/dist/id-compressor/identifiers.d.ts.map +1 -1
  54. package/dist/index.d.ts +2 -1
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +3 -2
  57. package/dist/index.js.map +1 -1
  58. package/dist/messageTypes.d.ts +134 -0
  59. package/dist/messageTypes.d.ts.map +1 -0
  60. package/dist/messageTypes.js +29 -0
  61. package/dist/messageTypes.js.map +1 -0
  62. package/dist/opLifecycle/batchManager.js +6 -6
  63. package/dist/opLifecycle/batchManager.js.map +1 -1
  64. package/dist/opLifecycle/definitions.d.ts +4 -3
  65. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  66. package/dist/opLifecycle/definitions.js.map +1 -1
  67. package/dist/opLifecycle/opDecompressor.d.ts.map +1 -1
  68. package/dist/opLifecycle/opDecompressor.js +0 -4
  69. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  70. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  71. package/dist/opLifecycle/opGroupingManager.js +4 -2
  72. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  73. package/dist/opLifecycle/opSplitter.js +3 -3
  74. package/dist/opLifecycle/opSplitter.js.map +1 -1
  75. package/dist/opLifecycle/remoteMessageProcessor.d.ts +17 -3
  76. package/dist/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  77. package/dist/opLifecycle/remoteMessageProcessor.js +38 -25
  78. package/dist/opLifecycle/remoteMessageProcessor.js.map +1 -1
  79. package/dist/packageVersion.d.ts +1 -1
  80. package/dist/packageVersion.js +1 -1
  81. package/dist/packageVersion.js.map +1 -1
  82. package/dist/pendingStateManager.d.ts +4 -20
  83. package/dist/pendingStateManager.d.ts.map +1 -1
  84. package/dist/pendingStateManager.js +33 -45
  85. package/dist/pendingStateManager.js.map +1 -1
  86. package/dist/summary/orderedClientElection.d.ts +3 -3
  87. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  88. package/dist/summary/orderedClientElection.js +54 -54
  89. package/dist/summary/orderedClientElection.js.map +1 -1
  90. package/dist/summary/runWhileConnectedCoordinator.js +6 -6
  91. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  92. package/dist/summary/runningSummarizer.d.ts +1 -1
  93. package/dist/summary/runningSummarizer.d.ts.map +1 -1
  94. package/dist/summary/runningSummarizer.js +41 -39
  95. package/dist/summary/runningSummarizer.js.map +1 -1
  96. package/dist/summary/summarizer.d.ts +2 -2
  97. package/dist/summary/summarizer.d.ts.map +1 -1
  98. package/dist/summary/summarizer.js +10 -8
  99. package/dist/summary/summarizer.js.map +1 -1
  100. package/dist/summary/summarizerClientElection.js +6 -6
  101. package/dist/summary/summarizerClientElection.js.map +1 -1
  102. package/dist/summary/summarizerHeuristics.js +9 -9
  103. package/dist/summary/summarizerHeuristics.js.map +1 -1
  104. package/dist/summary/summarizerNode/summarizerNode.d.ts +1 -1
  105. package/dist/summary/summarizerNode/summarizerNode.js +8 -8
  106. package/dist/summary/summarizerNode/summarizerNode.js.map +1 -1
  107. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  108. package/dist/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  109. package/dist/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  110. package/dist/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  111. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
  112. package/dist/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  113. package/dist/summary/summarizerTypes.d.ts +14 -13
  114. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  115. package/dist/summary/summarizerTypes.js.map +1 -1
  116. package/dist/summary/summaryCollection.d.ts +2 -2
  117. package/dist/summary/summaryCollection.d.ts.map +1 -1
  118. package/dist/summary/summaryCollection.js +21 -21
  119. package/dist/summary/summaryCollection.js.map +1 -1
  120. package/dist/summary/summaryFormat.d.ts +8 -5
  121. package/dist/summary/summaryFormat.d.ts.map +1 -1
  122. package/dist/summary/summaryFormat.js +3 -0
  123. package/dist/summary/summaryFormat.js.map +1 -1
  124. package/dist/summary/summaryGenerator.d.ts +3 -3
  125. package/dist/summary/summaryGenerator.d.ts.map +1 -1
  126. package/dist/summary/summaryManager.js +7 -7
  127. package/dist/summary/summaryManager.js.map +1 -1
  128. package/dist/throttler.js +16 -16
  129. package/dist/throttler.js.map +1 -1
  130. package/dist/tsdoc-metadata.json +1 -1
  131. package/lib/blobManager.d.ts +4 -3
  132. package/lib/blobManager.d.ts.map +1 -1
  133. package/lib/blobManager.js +36 -32
  134. package/lib/blobManager.js.map +1 -1
  135. package/lib/containerHandleContext.js +3 -3
  136. package/lib/containerHandleContext.js.map +1 -1
  137. package/lib/containerRuntime.d.ts +21 -78
  138. package/lib/containerRuntime.d.ts.map +1 -1
  139. package/lib/containerRuntime.js +339 -375
  140. package/lib/containerRuntime.js.map +1 -1
  141. package/lib/dataStore.js +9 -9
  142. package/lib/dataStore.js.map +1 -1
  143. package/lib/dataStoreContext.d.ts +1 -3
  144. package/lib/dataStoreContext.d.ts.map +1 -1
  145. package/lib/dataStoreContext.js +54 -56
  146. package/lib/dataStoreContext.js.map +1 -1
  147. package/lib/dataStoreRegistry.js +3 -3
  148. package/lib/dataStoreRegistry.js.map +1 -1
  149. package/lib/dataStores.d.ts +1 -1
  150. package/lib/dataStores.js +4 -4
  151. package/lib/dataStores.js.map +1 -1
  152. package/lib/deltaManagerProxyBase.js +4 -4
  153. package/lib/deltaManagerProxyBase.js.map +1 -1
  154. package/lib/deltaManagerSummarizerProxy.js +6 -6
  155. package/lib/deltaManagerSummarizerProxy.js.map +1 -1
  156. package/lib/deltaScheduler.js.map +1 -1
  157. package/lib/gc/garbageCollection.d.ts +6 -3
  158. package/lib/gc/garbageCollection.d.ts.map +1 -1
  159. package/lib/gc/garbageCollection.js +19 -16
  160. package/lib/gc/garbageCollection.js.map +1 -1
  161. package/lib/gc/gcDefinitions.d.ts +17 -17
  162. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  163. package/lib/gc/gcDefinitions.js +13 -14
  164. package/lib/gc/gcDefinitions.js.map +1 -1
  165. package/lib/gc/gcHelpers.d.ts +0 -9
  166. package/lib/gc/gcHelpers.d.ts.map +1 -1
  167. package/lib/gc/gcHelpers.js +0 -11
  168. package/lib/gc/gcHelpers.js.map +1 -1
  169. package/lib/gc/gcTelemetry.d.ts +1 -1
  170. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  171. package/lib/gc/gcTelemetry.js +1 -4
  172. package/lib/gc/gcTelemetry.js.map +1 -1
  173. package/lib/gc/gcUnreferencedStateTracker.js +3 -3
  174. package/lib/gc/gcUnreferencedStateTracker.js.map +1 -1
  175. package/lib/gc/index.d.ts +2 -2
  176. package/lib/gc/index.d.ts.map +1 -1
  177. package/lib/gc/index.js +2 -2
  178. package/lib/gc/index.js.map +1 -1
  179. package/lib/id-compressor/appendOnlySortedMap.js.map +1 -1
  180. package/lib/id-compressor/idCompressor.js.map +1 -1
  181. package/lib/id-compressor/identifiers.d.ts +3 -3
  182. package/lib/id-compressor/identifiers.d.ts.map +1 -1
  183. package/lib/index.d.ts +2 -1
  184. package/lib/index.d.ts.map +1 -1
  185. package/lib/index.js +2 -1
  186. package/lib/index.js.map +1 -1
  187. package/lib/messageTypes.d.ts +134 -0
  188. package/lib/messageTypes.d.ts.map +1 -0
  189. package/lib/messageTypes.js +26 -0
  190. package/lib/messageTypes.js.map +1 -0
  191. package/lib/opLifecycle/batchManager.js +6 -6
  192. package/lib/opLifecycle/batchManager.js.map +1 -1
  193. package/lib/opLifecycle/definitions.d.ts +4 -3
  194. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  195. package/lib/opLifecycle/definitions.js.map +1 -1
  196. package/lib/opLifecycle/opDecompressor.d.ts.map +1 -1
  197. package/lib/opLifecycle/opDecompressor.js +0 -4
  198. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  199. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  200. package/lib/opLifecycle/opGroupingManager.js +4 -2
  201. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  202. package/lib/opLifecycle/opSplitter.js +1 -1
  203. package/lib/opLifecycle/opSplitter.js.map +1 -1
  204. package/lib/opLifecycle/remoteMessageProcessor.d.ts +17 -3
  205. package/lib/opLifecycle/remoteMessageProcessor.d.ts.map +1 -1
  206. package/lib/opLifecycle/remoteMessageProcessor.js +37 -24
  207. package/lib/opLifecycle/remoteMessageProcessor.js.map +1 -1
  208. package/lib/packageVersion.d.ts +1 -1
  209. package/lib/packageVersion.js +1 -1
  210. package/lib/packageVersion.js.map +1 -1
  211. package/lib/pendingStateManager.d.ts +4 -20
  212. package/lib/pendingStateManager.d.ts.map +1 -1
  213. package/lib/pendingStateManager.js +32 -44
  214. package/lib/pendingStateManager.js.map +1 -1
  215. package/lib/summary/orderedClientElection.d.ts +3 -3
  216. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  217. package/lib/summary/orderedClientElection.js +54 -54
  218. package/lib/summary/orderedClientElection.js.map +1 -1
  219. package/lib/summary/runWhileConnectedCoordinator.js +6 -6
  220. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  221. package/lib/summary/runningSummarizer.d.ts +1 -1
  222. package/lib/summary/runningSummarizer.d.ts.map +1 -1
  223. package/lib/summary/runningSummarizer.js +41 -39
  224. package/lib/summary/runningSummarizer.js.map +1 -1
  225. package/lib/summary/summarizer.d.ts +2 -2
  226. package/lib/summary/summarizer.d.ts.map +1 -1
  227. package/lib/summary/summarizer.js +10 -8
  228. package/lib/summary/summarizer.js.map +1 -1
  229. package/lib/summary/summarizerClientElection.js +6 -6
  230. package/lib/summary/summarizerClientElection.js.map +1 -1
  231. package/lib/summary/summarizerHeuristics.js +9 -9
  232. package/lib/summary/summarizerHeuristics.js.map +1 -1
  233. package/lib/summary/summarizerNode/summarizerNode.d.ts +1 -1
  234. package/lib/summary/summarizerNode/summarizerNode.js +8 -8
  235. package/lib/summary/summarizerNode/summarizerNode.js.map +1 -1
  236. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts +1 -1
  237. package/lib/summary/summarizerNode/summarizerNodeUtils.d.ts.map +1 -1
  238. package/lib/summary/summarizerNode/summarizerNodeUtils.js +3 -3
  239. package/lib/summary/summarizerNode/summarizerNodeUtils.js.map +1 -1
  240. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts +2 -2
  241. package/lib/summary/summarizerNode/summarizerNodeWithGc.d.ts.map +1 -1
  242. package/lib/summary/summarizerTypes.d.ts +14 -13
  243. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  244. package/lib/summary/summarizerTypes.js.map +1 -1
  245. package/lib/summary/summaryCollection.d.ts +2 -2
  246. package/lib/summary/summaryCollection.d.ts.map +1 -1
  247. package/lib/summary/summaryCollection.js +21 -21
  248. package/lib/summary/summaryCollection.js.map +1 -1
  249. package/lib/summary/summaryFormat.d.ts +8 -5
  250. package/lib/summary/summaryFormat.d.ts.map +1 -1
  251. package/lib/summary/summaryFormat.js +3 -0
  252. package/lib/summary/summaryFormat.js.map +1 -1
  253. package/lib/summary/summaryGenerator.d.ts +3 -3
  254. package/lib/summary/summaryGenerator.d.ts.map +1 -1
  255. package/lib/summary/summaryManager.js +6 -6
  256. package/lib/summary/summaryManager.js.map +1 -1
  257. package/lib/throttler.js +16 -16
  258. package/lib/throttler.js.map +1 -1
  259. package/package.json +57 -22
  260. package/src/blobManager.ts +38 -28
  261. package/src/containerRuntime.ts +210 -278
  262. package/src/dataStore.ts +1 -1
  263. package/src/dataStoreContext.ts +4 -7
  264. package/src/dataStores.ts +4 -4
  265. package/src/gc/garbageCollection.md +53 -5
  266. package/src/gc/garbageCollection.ts +6 -3
  267. package/src/gc/gcDefinitions.ts +14 -27
  268. package/src/gc/gcEarlyAdoption.md +145 -0
  269. package/src/gc/gcHelpers.ts +0 -12
  270. package/src/gc/gcTelemetry.ts +1 -4
  271. package/src/gc/index.ts +2 -3
  272. package/src/index.ts +7 -4
  273. package/src/messageTypes.ts +225 -0
  274. package/src/opLifecycle/README.md +40 -40
  275. package/src/opLifecycle/definitions.ts +2 -1
  276. package/src/opLifecycle/opDecompressor.ts +0 -8
  277. package/src/opLifecycle/opGroupingManager.ts +7 -6
  278. package/src/opLifecycle/opSplitter.ts +2 -2
  279. package/src/opLifecycle/remoteMessageProcessor.ts +54 -33
  280. package/src/packageVersion.ts +1 -1
  281. package/src/pendingStateManager.ts +30 -52
  282. package/src/summary/runningSummarizer.ts +4 -2
  283. package/src/summary/summarizer.ts +5 -3
  284. package/src/summary/summarizerNode/summarizerNode.ts +1 -1
  285. package/src/summary/summarizerTypes.ts +2 -1
  286. package/src/summary/summaryFormat.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"dataStoreRegistry.js","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAO7D,MAAM,OAAO,sBAAsB;IAUlC,YAAY,YAAgD;QAC3D,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QACrB,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;YACjC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC3B,MAAM,IAAI,UAAU,CAAC,6BAA6B,CAAC,CAAC;aACpD;YACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACjC;IACF,CAAC;IAZD,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAYM,KAAK,CAAC,GAAG,CAAC,IAAY;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { UsageError } from \"@fluidframework/telemetry-utils\";\nimport {\n\tFluidDataStoreRegistryEntry,\n\tIFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\n\nexport class FluidDataStoreRegistry implements IFluidDataStoreRegistry {\n\tprivate readonly map: Map<\n\t\tstring,\n\t\tFluidDataStoreRegistryEntry | Promise<FluidDataStoreRegistryEntry>\n\t>;\n\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this;\n\t}\n\n\tconstructor(namedEntries: NamedFluidDataStoreRegistryEntries) {\n\t\tthis.map = new Map();\n\t\tfor (const entry of namedEntries) {\n\t\t\tif (this.map.has(entry[0])) {\n\t\t\t\tthrow new UsageError(\"Duplicate entry names exist\");\n\t\t\t}\n\t\t\tthis.map.set(entry[0], entry[1]);\n\t\t}\n\t}\n\n\tpublic async get(name: string): Promise<FluidDataStoreRegistryEntry | undefined> {\n\t\tif (this.map.has(name)) {\n\t\t\treturn this.map.get(name);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataStoreRegistry.js","sourceRoot":"","sources":["../src/dataStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAO7D,MAAM,OAAO,sBAAsB;IAMlC,IAAW,uBAAuB;QACjC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,YAAY,YAAgD;QAC3D,IAAI,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QACrB,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE;YACjC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC3B,MAAM,IAAI,UAAU,CAAC,6BAA6B,CAAC,CAAC;aACpD;YACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SACjC;IACF,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,IAAY;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;SAC1B;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { UsageError } from \"@fluidframework/telemetry-utils\";\nimport {\n\tFluidDataStoreRegistryEntry,\n\tIFluidDataStoreRegistry,\n\tNamedFluidDataStoreRegistryEntries,\n} from \"@fluidframework/runtime-definitions\";\n\nexport class FluidDataStoreRegistry implements IFluidDataStoreRegistry {\n\tprivate readonly map: Map<\n\t\tstring,\n\t\tFluidDataStoreRegistryEntry | Promise<FluidDataStoreRegistryEntry>\n\t>;\n\n\tpublic get IFluidDataStoreRegistry() {\n\t\treturn this;\n\t}\n\n\tconstructor(namedEntries: NamedFluidDataStoreRegistryEntries) {\n\t\tthis.map = new Map();\n\t\tfor (const entry of namedEntries) {\n\t\t\tif (this.map.has(entry[0])) {\n\t\t\t\tthrow new UsageError(\"Duplicate entry names exist\");\n\t\t\t}\n\t\t\tthis.map.set(entry[0], entry[1]);\n\t\t}\n\t}\n\n\tpublic async get(name: string): Promise<FluidDataStoreRegistryEntry | undefined> {\n\t\tif (this.map.has(name)) {\n\t\t\treturn this.map.get(name);\n\t\t}\n\n\t\treturn undefined;\n\t}\n}\n"]}
@@ -135,7 +135,7 @@ export declare class DataStores implements IDisposable {
135
135
  * Delete data stores and its objects that are sweep ready.
136
136
  * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
137
137
  * be deleted.
138
- * @returns - The routes of data stores and its objects that were deleted.
138
+ * @returns The routes of data stores and its objects that were deleted.
139
139
  */
140
140
  deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[];
141
141
  /**
package/lib/dataStores.js CHANGED
@@ -15,7 +15,7 @@ import { defaultRuntimeHeaderData, TombstoneResponseHeaderKey, } from "./contain
15
15
  import { RemoteFluidDataStoreContext, LocalFluidDataStoreContext, createAttributesBlob, LocalDetachedFluidDataStoreContext, } from "./dataStoreContext";
16
16
  import { StorageServiceWithAttachBlobs } from "./storageServiceWithAttachBlobs";
17
17
  import { isDataStoreAliasMessage } from "./dataStore";
18
- import { GCNodeType, sweepDatastoresKey, throwOnTombstoneLoadKey, sendGCUnexpectedUsageEvent, } from "./gc";
18
+ import { GCNodeType, disableDatastoreSweepKey, throwOnTombstoneLoadKey, sendGCUnexpectedUsageEvent, } from "./gc";
19
19
  import { summarizerClientType, nonDataStorePaths, rootHasIsolatedChannels, } from "./summary";
20
20
  /**
21
21
  * This class encapsulates data store handling. Currently it is only used by the container runtime,
@@ -111,7 +111,7 @@ export class DataStores {
111
111
  }
112
112
  async waitIfPendingAlias(maybeAlias) {
113
113
  const pendingAliasPromise = this.pendingAliases.get(maybeAlias);
114
- return pendingAliasPromise === undefined ? "Success" : pendingAliasPromise;
114
+ return pendingAliasPromise ?? "Success";
115
115
  }
116
116
  processAttachMessage(message, local) {
117
117
  const attachMessage = message.contents;
@@ -578,11 +578,11 @@ export class DataStores {
578
578
  * Delete data stores and its objects that are sweep ready.
579
579
  * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should
580
580
  * be deleted.
581
- * @returns - The routes of data stores and its objects that were deleted.
581
+ * @returns The routes of data stores and its objects that were deleted.
582
582
  */
583
583
  deleteSweepReadyNodes(sweepReadyDataStoreRoutes) {
584
584
  // If sweep for data stores is not enabled, return empty list indicating nothing is deleted.
585
- if (this.mc.config.getBoolean(sweepDatastoresKey) !== true) {
585
+ if (this.mc.config.getBoolean(disableDatastoreSweepKey) === true) {
586
586
  return [];
587
587
  }
588
588
  for (const route of sweepReadyDataStoreRoutes) {
@@ -1 +1 @@
1
- {"version":3,"file":"dataStores.js","sourceRoot":"","sources":["../src/dataStores.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAEN,gBAAgB,EAGhB,0BAA0B,GAU1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,gCAAgC,EAChC,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,4BAA4B,EAC5B,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EAEZ,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,4BAA4B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CAAC,EAAE,GAAG,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACI,aAAa,CAAC,QAAgB;QACpC,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;YACrC,OAAO,SAAS,CAAC;SACjB;QAED,sDAAsD;QACtD,qEAAqE;QACrE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3B,OAAO,UAAU,CAAC,SAAS,CAAC;SAC5B;QACD,OAAO,UAAU,CAAC,YAAY,CAAC;IAChC,CAAC;CACD;AAED,MAAM,UAAU,uBAAuB,CACtC,QAAmC,EACnC,QAAoC;IAEpC,IAAI,CAAC,QAAQ,EAAE;QACd,OAAO,SAAS,CAAC;KACjB;IAED,IAAI,uBAAuB,CAAC,QAAQ,CAAC,EAAE;QACtC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC5D,MAAM,CAAC,CAAC,CAAC,kBAAkB,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC9E,OAAO,kBAAkB,CAAC;KAC1B;SAAM;QACN,qFAAqF;QACrF,MAAM,eAAe,GAA2B,EAAE,CAAC;QACnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC1D,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACrC,eAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aAC7B;SACD;QACD,OAAO;YACN,GAAG,QAAQ;YACX,KAAK,EAAE,eAAe;SACtB,CAAC;KACF;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tIFluidHandle,\n\tIRequest,\n} from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tAliasResult,\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeFn,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tIAttachMessage,\n\tIEnvelope,\n\tIFluidDataStoreContextDetached,\n\tIGarbageCollectionData,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertToSummaryTree,\n\tcreate404Response,\n\tcreateResponseError,\n\tGCDataBuilder,\n\tresponseToException,\n\tSummaryTreeBuilder,\n\tunpackChildNodesUsedRoutes,\n} from \"@fluidframework/runtime-utils\";\nimport {\n\tcreateChildMonitoringContext,\n\tDataCorruptionError,\n\textractSafePropertiesFromMessage,\n\tLoggingError,\n\tMonitoringContext,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils\";\nimport { assert, Lazy } from \"@fluidframework/core-utils\";\nimport { v4 as uuid } from \"uuid\";\nimport { DataStoreContexts } from \"./dataStoreContexts\";\nimport {\n\tContainerRuntime,\n\tdefaultRuntimeHeaderData,\n\tRuntimeHeaderData,\n\tTombstoneResponseHeaderKey,\n} from \"./containerRuntime\";\nimport {\n\tFluidDataStoreContext,\n\tRemoteFluidDataStoreContext,\n\tLocalFluidDataStoreContext,\n\tcreateAttributesBlob,\n\tLocalDetachedFluidDataStoreContext,\n} from \"./dataStoreContext\";\nimport { StorageServiceWithAttachBlobs } from \"./storageServiceWithAttachBlobs\";\nimport { IDataStoreAliasMessage, isDataStoreAliasMessage } from \"./dataStore\";\nimport {\n\tGCNodeType,\n\tsweepDatastoresKey,\n\tthrowOnTombstoneLoadKey,\n\tsendGCUnexpectedUsageEvent,\n} from \"./gc\";\nimport {\n\tsummarizerClientType,\n\tIContainerRuntimeMetadata,\n\tnonDataStorePaths,\n\trootHasIsolatedChannels,\n} from \"./summary\";\n\ntype PendingAliasResolve = (success: boolean) => void;\n\n/**\n * This class encapsulates data store handling. Currently it is only used by the container runtime,\n * but eventually could be hosted on any channel once we formalize the channel api boundary.\n */\nexport class DataStores implements IDisposable {\n\t// Stores tracked by the Domain\n\tprivate readonly pendingAttach = new Map<string, IAttachMessage>();\n\t// 0.24 back-compat attachingBeforeSummary\n\tpublic readonly attachOpFiredForDataStore = new Set<string>();\n\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());\n\n\tpublic readonly containerLoadStats: {\n\t\t// number of dataStores during loadContainer\n\t\treadonly containerLoadDataStoreCount: number;\n\t\t// number of unreferenced dataStores during loadContainer\n\t\treadonly referencedDataStoreCount: number;\n\t};\n\n\t// Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new\n\t// root data stores that are added.\n\tprivate dataStoresSinceLastGC: string[] = [];\n\t/** If true, throw an error when a tombstone data store is retrieved. */\n\tprivate readonly throwOnTombstoneLoad: boolean;\n\t// The handle to the container runtime. This is used mainly for GC purposes to represent outbound reference from\n\t// the container runtime to other nodes.\n\tprivate readonly containerRuntimeHandle: IFluidHandle;\n\tprivate readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<\n\t\tstring,\n\t\tPromise<AliasResult>\n\t>();\n\n\tconstructor(\n\t\tprivate readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tprivate readonly runtime: ContainerRuntime,\n\t\tprivate readonly submitAttachFn: (attachContent: IAttachMessage) => void,\n\t\tprivate readonly getCreateChildSummarizerNodeFn: (\n\t\t\tid: string,\n\t\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\t) => CreateChildSummarizerNodeFn,\n\t\tprivate readonly deleteChildSummarizerNodeFn: (id: string) => void,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (\n\t\t\tnodePath: string,\n\t\t\ttimestampMs: number,\n\t\t\tpackagePath?: readonly string[],\n\t\t) => void,\n\t\tprivate readonly isDataStoreDeleted: (nodePath: string) => boolean,\n\t\tprivate readonly aliasMap: Map<string, string>,\n\t\tprivate readonly contexts: DataStoreContexts = new DataStoreContexts(baseLogger),\n\t) {\n\t\tthis.mc = createChildMonitoringContext({ logger: baseLogger });\n\t\tthis.containerRuntimeHandle = new FluidObjectHandle(\n\t\t\tthis.runtime,\n\t\t\t\"/\",\n\t\t\tthis.runtime.IFluidHandleContext,\n\t\t);\n\n\t\t// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer\n\t\tthis.throwOnTombstoneLoad =\n\t\t\tthis.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&\n\t\t\tthis.runtime.gcTombstoneEnforcementAllowed &&\n\t\t\tthis.runtime.clientDetails.type !== summarizerClientType;\n\n\t\t// Extract stores stored inside the snapshot\n\t\tconst fluidDataStores = new Map<string, ISnapshotTree>();\n\t\tif (baseSnapshot) {\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshot.trees)) {\n\t\t\t\tfluidDataStores.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\tlet unreferencedDataStoreCount = 0;\n\t\t// Create a context for each of them\n\t\tfor (const [key, value] of fluidDataStores) {\n\t\t\tlet dataStoreContext: FluidDataStoreContext;\n\n\t\t\t// counting number of unreferenced data stores\n\t\t\tif (value.unreferenced) {\n\t\t\t\tunreferencedDataStoreCount++;\n\t\t\t}\n\t\t\t// If we have a detached container, then create local data store contexts.\n\t\t\tif (this.runtime.attachState !== AttachState.Detached) {\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\truntime: this.runtime,\n\t\t\t\t\tstorage: this.runtime.storage,\n\t\t\t\t\tscope: this.runtime.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tthrow new LoggingError(\"Snapshot should be there to load from!!\");\n\t\t\t\t}\n\t\t\t\tconst snapshotTree = value;\n\t\t\t\tdataStoreContext = new LocalFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tpkg: undefined,\n\t\t\t\t\truntime: this.runtime,\n\t\t\t\t\tstorage: this.runtime.storage,\n\t\t\t\t\tscope: this.runtime.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),\n\t\t\t\t\tsnapshotTree,\n\t\t\t\t\tisRootDataStore: undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\t}\n\t\tthis.containerLoadStats = {\n\t\t\tcontainerLoadDataStoreCount: fluidDataStores.size,\n\t\t\treferencedDataStoreCount: fluidDataStores.size - unreferencedDataStoreCount,\n\t\t};\n\t}\n\n\tpublic get aliases(): ReadonlyMap<string, string> {\n\t\treturn this.aliasMap;\n\t}\n\n\tpublic get pendingAliases(): Map<string, Promise<AliasResult>> {\n\t\treturn this.pendingAliasMap;\n\t}\n\n\tpublic async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {\n\t\tconst pendingAliasPromise = this.pendingAliases.get(maybeAlias);\n\t\treturn pendingAliasPromise === undefined ? \"Success\" : pendingAliasPromise;\n\t}\n\n\tpublic processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {\n\t\tconst attachMessage = message.contents as InboundAttachMessage;\n\n\t\tthis.dataStoresSinceLastGC.push(attachMessage.id);\n\n\t\t// The local object has already been attached\n\t\tif (local) {\n\t\t\tassert(\n\t\t\t\tthis.pendingAttach.has(attachMessage.id),\n\t\t\t\t0x15e /* \"Local object does not have matching attach message id\" */,\n\t\t\t);\n\t\t\tthis.contexts.get(attachMessage.id)?.emit(\"attached\");\n\t\t\tthis.pendingAttach.delete(attachMessage.id);\n\t\t\treturn;\n\t\t}\n\n\t\t// If a non-local operation then go and create the object, otherwise mark it as officially attached.\n\t\tif (this.alreadyProcessed(attachMessage.id)) {\n\t\t\t// TODO: dataStoreId may require a different tag from PackageData #7488\n\t\t\tconst error = new DataCorruptionError(\n\t\t\t\t// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId\n\t\t\t\t\"Duplicate DataStore created with existing id\",\n\t\t\t\t{\n\t\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t\t\t...tagCodeArtifacts({ dataStoreId: attachMessage.id }),\n\t\t\t\t},\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tlet snapshotTree: ISnapshotTree | undefined;\n\t\tif (attachMessage.snapshot) {\n\t\t\tsnapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t}\n\n\t\t// Include the type of attach message which is the pkg of the store to be\n\t\t// used by RemoteFluidDataStoreContext in case it is not in the snapshot.\n\t\tconst pkg = [attachMessage.type];\n\t\tconst remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\tid: attachMessage.id,\n\t\t\tsnapshotTree,\n\t\t\truntime: this.runtime,\n\t\t\tstorage: new StorageServiceWithAttachBlobs(this.runtime.storage, flatAttachBlobs),\n\t\t\tscope: this.runtime.scope,\n\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(attachMessage.id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\tsequenceNumber: message.sequenceNumber,\n\t\t\t\tsnapshot: attachMessage.snapshot ?? {\n\t\t\t\t\tentries: [createAttributesBlob(pkg, true /* isRootDataStore */)],\n\t\t\t\t},\n\t\t\t}),\n\t\t\tpkg,\n\t\t});\n\n\t\tthis.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);\n\t}\n\n\tpublic processAliasMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tlocal: boolean,\n\t): void {\n\t\tconst aliasMessage = message.contents as IDataStoreAliasMessage;\n\t\tif (!isDataStoreAliasMessage(aliasMessage)) {\n\t\t\tthrow new DataCorruptionError(\"malformedDataStoreAliasMessage\", {\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\tconst resolve = localOpMetadata as PendingAliasResolve;\n\t\tconst aliasResult = this.processAliasMessageCore(aliasMessage);\n\t\tif (local) {\n\t\t\tresolve(aliasResult);\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(aliasMessage: IDataStoreAliasMessage): boolean {\n\t\tif (this.alreadyProcessed(aliasMessage.alias)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context = this.contexts.get(aliasMessage.internalId);\n\t\tif (context === undefined) {\n\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\teventName: \"AliasFluidDataStoreNotFound\",\n\t\t\t\tfluidDataStoreId: aliasMessage.internalId,\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst handle = new FluidObjectHandle(\n\t\t\tcontext,\n\t\t\taliasMessage.internalId,\n\t\t\tthis.runtime.IFluidHandleContext,\n\t\t);\n\t\tthis.runtime.addedGCOutboundReference(this.containerRuntimeHandle, handle);\n\n\t\tthis.aliasMap.set(aliasMessage.alias, context.id);\n\t\tcontext.setInMemoryRoot();\n\t\treturn true;\n\t}\n\n\tprivate alreadyProcessed(id: string): boolean {\n\t\treturn this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;\n\t}\n\n\t/**\n\t * Make the data stores locally visible in the container graph by moving the data store context from unbound to\n\t * bound list. This data store can now be reached from the root.\n\t * @param id - The id of the data store context to make visible.\n\t */\n\tprivate makeDataStoreLocallyVisible(id: string): void {\n\t\tconst localContext = this.contexts.getUnbound(id);\n\t\tassert(!!localContext, 0x15f /* \"Could not find unbound context to bind\" */);\n\n\t\t/**\n\t\t * If the container is not detached, it is globally visible to all clients. This data store should also be\n\t\t * globally visible. Move it to attaching state and send an \"attach\" op for it.\n\t\t * If the container is detached, this data store will be part of the summary that makes the container attached.\n\t\t */\n\t\tif (this.runtime.attachState !== AttachState.Detached) {\n\t\t\tlocalContext.emit(\"attaching\");\n\t\t\tconst message = localContext.generateAttachMessage();\n\n\t\t\tthis.pendingAttach.set(id, message);\n\t\t\tthis.submitAttachFn(message);\n\t\t\tthis.attachOpFiredForDataStore.add(id);\n\t\t}\n\n\t\tthis.contexts.bind(id);\n\t}\n\n\tpublic createDetachedDataStoreCore(\n\t\tpkg: Readonly<string[]>,\n\t\tisRoot: boolean,\n\t\tid = uuid(),\n\t): IFluidDataStoreContextDetached {\n\t\tassert(!id.includes(\"/\"), 0x30c /* Id cannot contain slashes */);\n\n\t\tconst context = new LocalDetachedFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\truntime: this.runtime,\n\t\t\tstorage: this.runtime.storage,\n\t\t\tscope: this.runtime.scope,\n\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tisRootDataStore: isRoot,\n\t\t});\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic _createFluidDataStoreContext(pkg: string[], id: string, props?: any) {\n\t\tassert(!id.includes(\"/\"), 0x30d /* Id cannot contain slashes */);\n\t\tconst context = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\truntime: this.runtime,\n\t\t\tstorage: this.runtime.storage,\n\t\t\tscope: this.runtime.scope,\n\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tisRootDataStore: false,\n\t\t\tcreateProps: props,\n\t\t});\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic get disposed() {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic readonly dispose = () => this.disposeOnce.value;\n\n\tpublic resubmitDataStoreOp(envelope: IEnvelope, localOpMetadata: unknown) {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x160 /* \"There should be a store context for the op\" */);\n\t\tcontext.reSubmit(envelope.contents, localOpMetadata);\n\t}\n\n\tpublic rollbackDataStoreOp(envelope: IEnvelope, localOpMetadata: unknown) {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x2e8 /* \"There should be a store context for the op\" */);\n\t\tcontext.rollback(envelope.contents, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(envelope: IEnvelope): Promise<unknown> {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x161 /* \"There should be a store context for the op\" */);\n\t\treturn context.applyStashedOp(envelope.contents);\n\t}\n\n\tpublic async applyStashedAttachOp(message: IAttachMessage) {\n\t\tthis.pendingAttach.set(message.id, message);\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\tthis.processAttachMessage({ contents: message } as ISequencedDocumentMessage, false);\n\t}\n\n\tpublic processFluidDataStoreOp(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalMessageMetadata: unknown,\n\t) {\n\t\tconst envelope = message.contents as IEnvelope;\n\t\tconst transformed = { ...message, contents: envelope.contents };\n\t\tthis.validateNotDeleted(envelope.address);\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x162 /* \"There should be a store context for the op\" */);\n\t\tcontext.process(transformed, local, localMessageMetadata);\n\n\t\t// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is\n\t\t// being used.\n\t\tthis.gcNodeUpdated(\n\t\t\t`/${envelope.address}`,\n\t\t\tmessage.timestamp,\n\t\t\tcontext.isLoaded ? context.packagePath : undefined,\n\t\t);\n\t}\n\n\tpublic async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<FluidDataStoreContext> {\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tthis.validateNotDeleted(id, headerData);\n\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\t// The requested data store does not exits. Throw a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(create404Response(request), request);\n\t\t}\n\n\t\tthis.validateNotTombstoned(context, requestHeaderData);\n\n\t\treturn context;\n\t}\n\n\t/**\n\t * Returns the data store requested with the given id if available. Otherwise, returns undefined.\n\t */\n\tpublic async getDataStoreIfAvailable(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<FluidDataStoreContext | undefined> {\n\t\t// If the data store has been deleted, return undefined.\n\t\tif (this.checkIfDeleted(id, requestHeaderData)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Check if the data store is tombstoned. If so, we want to log a telemetry event.\n\t\tthis.checkIfTombstoned(context, requestHeaderData);\n\t\treturn context;\n\t}\n\n\t/**\n\t * Checks if the data store has been deleted by GC.\n\t * @param id - data store id\n\t * @param request - the request information to log if the validation detects the data store has been deleted\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted\n\t * @returns true if the data store is deleted. Otherwise, returns false.\n\t */\n\tprivate checkIfDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\t\tassert(\n\t\t\t!this.contexts.has(id),\n\t\t\t0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,\n\t\t);\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName: \"GC_Deleted_DataStore_Requested\",\n\t\t\t\tcategory: \"error\",\n\t\t\t\tisSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,\n\t\t\t\tid,\n\t\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\tundefined /* packagePath */,\n\t\t);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Validate that the data store had not been deleted by GC.\n\t * @param id - data store id\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted\n\t */\n\tprivate validateNotDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {\n\t\tif (this.checkIfDeleted(id, requestHeaderData)) {\n\t\t\t// The requested data store is removed by gc. Create a 404 gc response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", request),\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the data store has not been marked as tombstone by GC or not.\n\t * @param context - the data store context in question\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned\n\t * @returns true if the data store is tombstoned. Otherwise, returns false.\n\t */\n\tprivate checkIfTombstoned(\n\t\tcontext: FluidDataStoreContext,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t) {\n\t\tif (!context.tombstoned) {\n\t\t\treturn false;\n\t\t}\n\t\tconst logErrorEvent = this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone;\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName: \"GC_Tombstone_DataStore_Requested\",\n\t\t\t\tcategory: logErrorEvent ? \"error\" : \"generic\",\n\t\t\t\tisSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,\n\t\t\t\tid: context.id,\n\t\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\tcontext.isLoaded ? context.packagePath : undefined,\n\t\t);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Validates that the data store context requested has not been marked as tombstone by GC.\n\t * @param context - the data store context in question\n\t * @param request - the request information to log if the validation detects the data store has been tombstoned\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned\n\t */\n\tprivate validateNotTombstoned(\n\t\tcontext: FluidDataStoreContext,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t) {\n\t\tif (this.checkIfTombstoned(context, requestHeaderData)) {\n\t\t\t// The requested data store is removed by gc. Create a 404 gc response exception.\n\t\t\tconst request: IRequest = { url: context.id };\n\t\t\tconst error = responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", request, {\n\t\t\t\t\t[TombstoneResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\trequest,\n\t\t\t);\n\t\t\t// Throw an error if configured via options and via request headers.\n\t\t\tif (this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic processSignal(fluidDataStoreId: string, message: IInboundSignalMessage, local: boolean) {\n\t\tthis.validateNotDeleted(fluidDataStoreId);\n\t\tconst context = this.contexts.get(fluidDataStoreId);\n\t\tif (!context) {\n\t\t\t// Attach message may not have been processed yet\n\t\t\tassert(!local, 0x163 /* \"Missing datastore for local signal\" */);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"SignalFluidDataStoreNotFound\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.processSignal(message, local);\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.setConnectionState(connected, clientId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetConnectionStateError\",\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\truntimeConnected: this.runtime.connected,\n\t\t\t\t\t\t\tconnected,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tconst eventName = attachState === AttachState.Attaching ? \"attaching\" : \"attached\";\n\t\tfor (const [, context] of this.contexts) {\n\t\t\t// Fire only for bounded stores.\n\t\t\tif (!this.contexts.isNotBound(context.id)) {\n\t\t\t\tcontext.emit(eventName);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.contexts.size;\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\n\t\t// Iterate over each store and ask it to snapshot\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer works only with clients with no local changes. A data store in attaching\n\t\t\t\t\t// state indicates an op was sent to attach a local data store.\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontext.attachState !== AttachState.Attaching,\n\t\t\t\t\t\t0x588 /* Local data store detected in attaching state during summarize */,\n\t\t\t\t\t);\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextSummary = await context.summarize(\n\t\t\t\t\t\tfullTree,\n\t\t\t\t\t\ttrackState,\n\t\t\t\t\t\ttelemetryContext,\n\t\t\t\t\t);\n\t\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t\t}),\n\t\t);\n\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\tpublic createSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\t// Attaching graph of some stores can cause other stores to get bound too.\n\t\t// So keep taking summary until no new stores get bound.\n\t\tlet notBoundContextsLength: number;\n\t\tdo {\n\t\t\tconst builderTree = builder.summary.tree;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\t// Iterate over each data store and ask it to snapshot\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(\n\t\t\t\t\t([key, _]) =>\n\t\t\t\t\t\t// Take summary of bounded data stores only, make sure we haven't summarized them already\n\t\t\t\t\t\t// and no attach op has been fired for that data store because for loader versions <= 0.24\n\t\t\t\t\t\t// we set attach state as \"attaching\" before taking createNew summary.\n\t\t\t\t\t\t!(\n\t\t\t\t\t\t\tthis.contexts.isNotBound(key) ||\n\t\t\t\t\t\t\tbuilderTree[key] ||\n\t\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(key)\n\t\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\t\tif (value.isLoaded) {\n\t\t\t\t\t\tconst snapshot = value.generateAttachMessage().snapshot;\n\t\t\t\t\t\tdataStoreSummary = convertToSummaryTree(snapshot, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If this data store is not yet loaded, then there should be no changes in the snapshot from\n\t\t\t\t\t\t// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\t\tthis.baseSnapshot.trees[key],\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbuilder.addWithStats(key, dataStoreSummary);\n\t\t\t\t});\n\t\t} while (notBoundContextsLength !== this.contexts.notBoundLength());\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Before GC runs, called by the garbage collector to update any pending GC state.\n\t * The garbage collector needs to know all outbound references that are added. Since root data stores are not\n\t * explicitly marked as referenced, notify GC of new root data stores that were added since the last GC run.\n\t */\n\tpublic async updateStateBeforeGC(): Promise<void> {\n\t\tfor (const id of this.dataStoresSinceLastGC) {\n\t\t\tconst context = this.contexts.get(id);\n\t\t\tassert(context !== undefined, 0x2b6 /* Missing data store context */);\n\t\t\tif (await context.isRoot()) {\n\t\t\t\t// A root data store is basically a reference from the container runtime to the data store.\n\t\t\t\tconst handle = new FluidObjectHandle(context, id, this.runtime.IFluidHandleContext);\n\t\t\t\tthis.runtime.addedGCOutboundReference(this.containerRuntimeHandle, handle);\n\t\t\t}\n\t\t}\n\t\tthis.dataStoresSinceLastGC = [];\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. It does the following:\n\t *\n\t * 1. Calls into each child data store context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst builder = new GCDataBuilder();\n\t\t// Iterate over each store and get their GC data.\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\t\t\t\t\t// attaching state indicates an op was sent to attach a local data store.\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontext.attachState !== AttachState.Attaching,\n\t\t\t\t\t\t0x589 /* Local data store detected in attaching state while running GC */,\n\t\t\t\t\t);\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t\t}),\n\t\t);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", await this.getOutboundRoutes());\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this Container's data stores of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in all data stores in this Container.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Get a map of data store ids to routes used in it.\n\t\tconst usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedDataStoreRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x167 /* \"Used route does not belong to any known data store\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are unused. The unused objects are deleted.\n\t * @param unusedRoutes - The routes that are unused in all data stores in this Container.\n\t */\n\tpublic updateUnusedRoutes(unusedRoutes: string[]) {\n\t\tfor (const route of unusedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Delete data store only if its route (/datastoreId) is in unusedRoutes. We don't want to delete a data\n\t\t\t// store based on its DDS being unused.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);\n\t\t\t// Delete the contexts of unused data stores.\n\t\t\tthis.contexts.delete(dataStoreId);\n\t\t\t// Delete the summarizer node of the unused data stores.\n\t\t\tthis.deleteChildSummarizerNodeFn(dataStoreId);\n\t\t}\n\t}\n\n\t/**\n\t * Delete data stores and its objects that are sweep ready.\n\t * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should\n\t * be deleted.\n\t * @returns - The routes of data stores and its objects that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[] {\n\t\t// If sweep for data stores is not enabled, return empty list indicating nothing is deleted.\n\t\tif (this.mc.config.getBoolean(sweepDatastoresKey) !== true) {\n\t\t\treturn [];\n\t\t}\n\t\tfor (const route of sweepReadyDataStoreRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tconst dataStoreId = pathParts[1];\n\n\t\t\t// TODO: GC:Validation - Skip any routes already deleted\n\t\t\t// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only\n\t\t\t// need to delete the data store.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!this.contexts.has(dataStoreId)) {\n\t\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\t\teventName: \"DeletedDataStoreNotFound\",\n\t\t\t\t\tdataStoreId,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst dataStore = this.contexts.get(dataStoreId);\n\t\t\tassert(dataStore !== undefined, 0x571 /* Attempting to delete unknown dataStore */);\n\t\t\tdataStore.delete();\n\n\t\t\t// Delete the contexts of sweep ready data stores.\n\t\t\tthis.contexts.delete(dataStoreId);\n\t\t\t// Delete the summarizer node of the sweep ready data stores.\n\t\t\tthis.deleteChildSummarizerNodeFn(dataStoreId);\n\t\t}\n\t\treturn Array.from(sweepReadyDataStoreRoutes);\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are tombstones. Tombstoned datastore contexts enable testing\n\t * scenarios with accessing deleted content without actually deleting content from summaries.\n\t * @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: string[]) {\n\t\tconst tombstonedDataStoresSet: Set<string> = new Set();\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Tombstone data store only if its route (/datastoreId) is directly in tombstoneRoutes.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);\n\t\t\ttombstonedDataStoresSet.add(dataStoreId);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.setTombstone(tombstonedDataStoresSet.has(contextId));\n\t\t}\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Only root data stores are considered referenced and their paths are\n\t * part of outbound routes.\n\t */\n\tprivate async getOutboundRoutes(): Promise<string[]> {\n\t\tconst outboundRoutes: string[] = [];\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isRootDataStore = await context.isRoot();\n\t\t\tif (isRootDataStore) {\n\t\t\t\toutboundRoutes.push(`/${contextId}`);\n\t\t\t}\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Called by GC to retrieve the package path of a data store node with the given path.\n\t */\n\tpublic async getDataStorePackagePath(nodePath: string): Promise<readonly string[] | undefined> {\n\t\t// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the\n\t\t// data store that contains it.\n\t\tconst context = this.contexts.get(nodePath.split(\"/\")[1]);\n\t\treturn (await context?.getInitialSnapshotDetails())?.pkg;\n\t}\n\n\t/**\n\t * Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).\n\t * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.\n\t */\n\tpublic getGCNodeType(nodePath: string): GCNodeType | undefined {\n\t\tconst pathParts = nodePath.split(\"/\");\n\t\tif (!this.contexts.has(pathParts[1])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Data stores paths are of the format \"/dataStoreId\".\n\t\t// Sub data store paths are of the format \"/dataStoreId/subPath/...\".\n\t\tif (pathParts.length === 2) {\n\t\t\treturn GCNodeType.DataStore;\n\t\t}\n\t\treturn GCNodeType.SubDataStore;\n\t}\n}\n\nexport function getSummaryForDatastores(\n\tsnapshot: ISnapshotTree | undefined,\n\tmetadata?: IContainerRuntimeMetadata,\n): ISnapshotTree | undefined {\n\tif (!snapshot) {\n\t\treturn undefined;\n\t}\n\n\tif (rootHasIsolatedChannels(metadata)) {\n\t\tconst datastoresSnapshot = snapshot.trees[channelsTreeName];\n\t\tassert(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);\n\t\treturn datastoresSnapshot;\n\t} else {\n\t\t// back-compat: strip out all non-datastore paths before giving to DataStores object.\n\t\tconst datastoresTrees: ISnapshotTree[\"trees\"] = {};\n\t\tfor (const [key, value] of Object.entries(snapshot.trees)) {\n\t\t\tif (!nonDataStorePaths.includes(key)) {\n\t\t\t\tdatastoresTrees[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...snapshot,\n\t\t\ttrees: datastoresTrees,\n\t\t};\n\t}\n}\n"]}
1
+ {"version":3,"file":"dataStores.js","sourceRoot":"","sources":["../src/dataStores.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,EAEN,gBAAgB,EAGhB,0BAA0B,GAU1B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACN,gCAAgC,EAChC,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACN,4BAA4B,EAC5B,mBAAmB,EACnB,gCAAgC,EAChC,YAAY,EAEZ,gBAAgB,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAEN,wBAAwB,EAExB,0BAA0B,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEN,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,E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SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YAC3B,OAAO,UAAU,CAAC,SAAS,CAAC;SAC5B;QACD,OAAO,UAAU,CAAC,YAAY,CAAC;IAChC,CAAC;CACD;AAED,MAAM,UAAU,uBAAuB,CACtC,QAAmC,EACnC,QAAoC;IAEpC,IAAI,CAAC,QAAQ,EAAE;QACd,OAAO,SAAS,CAAC;KACjB;IAED,IAAI,uBAAuB,CAAC,QAAQ,CAAC,EAAE;QACtC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAC5D,MAAM,CAAC,CAAC,CAAC,kBAAkB,EAAE,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAC9E,OAAO,kBAAkB,CAAC;KAC1B;SAAM;QACN,qFAAqF;QACrF,MAAM,eAAe,GAA2B,EAAE,CAAC;QACnD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC1D,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACrC,eAAe,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aAC7B;SACD;QACD,OAAO;YACN,GAAG,QAAQ;YACX,KAAK,EAAE,eAAe;SACtB,CAAC;KACF;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tITelemetryBaseLogger,\n\tIDisposable,\n\tIFluidHandle,\n\tIRequest,\n} from \"@fluidframework/core-interfaces\";\nimport { FluidObjectHandle } from \"@fluidframework/datastore\";\nimport { ISequencedDocumentMessage, ISnapshotTree } from \"@fluidframework/protocol-definitions\";\nimport {\n\tAliasResult,\n\tchannelsTreeName,\n\tCreateChildSummarizerNodeFn,\n\tCreateChildSummarizerNodeParam,\n\tCreateSummarizerNodeSource,\n\tIAttachMessage,\n\tIEnvelope,\n\tIFluidDataStoreContextDetached,\n\tIGarbageCollectionData,\n\tIInboundSignalMessage,\n\tInboundAttachMessage,\n\tISummarizeResult,\n\tISummaryTreeWithStats,\n\tITelemetryContext,\n} from \"@fluidframework/runtime-definitions\";\nimport {\n\tconvertSnapshotTreeToSummaryTree,\n\tconvertToSummaryTree,\n\tcreate404Response,\n\tcreateResponseError,\n\tGCDataBuilder,\n\tresponseToException,\n\tSummaryTreeBuilder,\n\tunpackChildNodesUsedRoutes,\n} from \"@fluidframework/runtime-utils\";\nimport {\n\tcreateChildMonitoringContext,\n\tDataCorruptionError,\n\textractSafePropertiesFromMessage,\n\tLoggingError,\n\tMonitoringContext,\n\ttagCodeArtifacts,\n} from \"@fluidframework/telemetry-utils\";\nimport { AttachState } from \"@fluidframework/container-definitions\";\nimport { buildSnapshotTree } from \"@fluidframework/driver-utils\";\nimport { assert, Lazy } from \"@fluidframework/core-utils\";\nimport { v4 as uuid } from \"uuid\";\nimport { DataStoreContexts } from \"./dataStoreContexts\";\nimport {\n\tContainerRuntime,\n\tdefaultRuntimeHeaderData,\n\tRuntimeHeaderData,\n\tTombstoneResponseHeaderKey,\n} from \"./containerRuntime\";\nimport {\n\tFluidDataStoreContext,\n\tRemoteFluidDataStoreContext,\n\tLocalFluidDataStoreContext,\n\tcreateAttributesBlob,\n\tLocalDetachedFluidDataStoreContext,\n} from \"./dataStoreContext\";\nimport { StorageServiceWithAttachBlobs } from \"./storageServiceWithAttachBlobs\";\nimport { IDataStoreAliasMessage, isDataStoreAliasMessage } from \"./dataStore\";\nimport {\n\tGCNodeType,\n\tdisableDatastoreSweepKey,\n\tthrowOnTombstoneLoadKey,\n\tsendGCUnexpectedUsageEvent,\n} from \"./gc\";\nimport {\n\tsummarizerClientType,\n\tIContainerRuntimeMetadata,\n\tnonDataStorePaths,\n\trootHasIsolatedChannels,\n} from \"./summary\";\n\ntype PendingAliasResolve = (success: boolean) => void;\n\n/**\n * This class encapsulates data store handling. Currently it is only used by the container runtime,\n * but eventually could be hosted on any channel once we formalize the channel api boundary.\n */\nexport class DataStores implements IDisposable {\n\t// Stores tracked by the Domain\n\tprivate readonly pendingAttach = new Map<string, IAttachMessage>();\n\t// 0.24 back-compat attachingBeforeSummary\n\tpublic readonly attachOpFiredForDataStore = new Set<string>();\n\n\tprivate readonly mc: MonitoringContext;\n\n\tprivate readonly disposeOnce = new Lazy<void>(() => this.contexts.dispose());\n\n\tpublic readonly containerLoadStats: {\n\t\t// number of dataStores during loadContainer\n\t\treadonly containerLoadDataStoreCount: number;\n\t\t// number of unreferenced dataStores during loadContainer\n\t\treadonly referencedDataStoreCount: number;\n\t};\n\n\t// Stores the ids of new data stores between two GC runs. This is used to notify the garbage collector of new\n\t// root data stores that are added.\n\tprivate dataStoresSinceLastGC: string[] = [];\n\t/** If true, throw an error when a tombstone data store is retrieved. */\n\tprivate readonly throwOnTombstoneLoad: boolean;\n\t// The handle to the container runtime. This is used mainly for GC purposes to represent outbound reference from\n\t// the container runtime to other nodes.\n\tprivate readonly containerRuntimeHandle: IFluidHandle;\n\tprivate readonly pendingAliasMap: Map<string, Promise<AliasResult>> = new Map<\n\t\tstring,\n\t\tPromise<AliasResult>\n\t>();\n\n\tconstructor(\n\t\tprivate readonly baseSnapshot: ISnapshotTree | undefined,\n\t\tprivate readonly runtime: ContainerRuntime,\n\t\tprivate readonly submitAttachFn: (attachContent: IAttachMessage) => void,\n\t\tprivate readonly getCreateChildSummarizerNodeFn: (\n\t\t\tid: string,\n\t\t\tcreateParam: CreateChildSummarizerNodeParam,\n\t\t) => CreateChildSummarizerNodeFn,\n\t\tprivate readonly deleteChildSummarizerNodeFn: (id: string) => void,\n\t\tbaseLogger: ITelemetryBaseLogger,\n\t\tprivate readonly gcNodeUpdated: (\n\t\t\tnodePath: string,\n\t\t\ttimestampMs: number,\n\t\t\tpackagePath?: readonly string[],\n\t\t) => void,\n\t\tprivate readonly isDataStoreDeleted: (nodePath: string) => boolean,\n\t\tprivate readonly aliasMap: Map<string, string>,\n\t\tprivate readonly contexts: DataStoreContexts = new DataStoreContexts(baseLogger),\n\t) {\n\t\tthis.mc = createChildMonitoringContext({ logger: baseLogger });\n\t\tthis.containerRuntimeHandle = new FluidObjectHandle(\n\t\t\tthis.runtime,\n\t\t\t\"/\",\n\t\t\tthis.runtime.IFluidHandleContext,\n\t\t);\n\n\t\t// Tombstone should only throw when the feature flag is enabled and the client isn't a summarizer\n\t\tthis.throwOnTombstoneLoad =\n\t\t\tthis.mc.config.getBoolean(throwOnTombstoneLoadKey) === true &&\n\t\t\tthis.runtime.gcTombstoneEnforcementAllowed &&\n\t\t\tthis.runtime.clientDetails.type !== summarizerClientType;\n\n\t\t// Extract stores stored inside the snapshot\n\t\tconst fluidDataStores = new Map<string, ISnapshotTree>();\n\t\tif (baseSnapshot) {\n\t\t\tfor (const [key, value] of Object.entries(baseSnapshot.trees)) {\n\t\t\t\tfluidDataStores.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\tlet unreferencedDataStoreCount = 0;\n\t\t// Create a context for each of them\n\t\tfor (const [key, value] of fluidDataStores) {\n\t\t\tlet dataStoreContext: FluidDataStoreContext;\n\n\t\t\t// counting number of unreferenced data stores\n\t\t\tif (value.unreferenced) {\n\t\t\t\tunreferencedDataStoreCount++;\n\t\t\t}\n\t\t\t// If we have a detached container, then create local data store contexts.\n\t\t\tif (this.runtime.attachState !== AttachState.Detached) {\n\t\t\t\tdataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tsnapshotTree: value,\n\t\t\t\t\truntime: this.runtime,\n\t\t\t\t\tstorage: this.runtime.storage,\n\t\t\t\t\tscope: this.runtime.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (typeof value !== \"object\") {\n\t\t\t\t\tthrow new LoggingError(\"Snapshot should be there to load from!!\");\n\t\t\t\t}\n\t\t\t\tconst snapshotTree = value;\n\t\t\t\tdataStoreContext = new LocalFluidDataStoreContext({\n\t\t\t\t\tid: key,\n\t\t\t\t\tpkg: undefined,\n\t\t\t\t\truntime: this.runtime,\n\t\t\t\t\tstorage: this.runtime.storage,\n\t\t\t\t\tscope: this.runtime.scope,\n\t\t\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(key, {\n\t\t\t\t\t\ttype: CreateSummarizerNodeSource.FromSummary,\n\t\t\t\t\t}),\n\t\t\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(key),\n\t\t\t\t\tsnapshotTree,\n\t\t\t\t\tisRootDataStore: undefined,\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis.contexts.addBoundOrRemoted(dataStoreContext);\n\t\t}\n\t\tthis.containerLoadStats = {\n\t\t\tcontainerLoadDataStoreCount: fluidDataStores.size,\n\t\t\treferencedDataStoreCount: fluidDataStores.size - unreferencedDataStoreCount,\n\t\t};\n\t}\n\n\tpublic get aliases(): ReadonlyMap<string, string> {\n\t\treturn this.aliasMap;\n\t}\n\n\tpublic get pendingAliases(): Map<string, Promise<AliasResult>> {\n\t\treturn this.pendingAliasMap;\n\t}\n\n\tpublic async waitIfPendingAlias(maybeAlias: string): Promise<AliasResult> {\n\t\tconst pendingAliasPromise = this.pendingAliases.get(maybeAlias);\n\t\treturn pendingAliasPromise ?? \"Success\";\n\t}\n\n\tpublic processAttachMessage(message: ISequencedDocumentMessage, local: boolean) {\n\t\tconst attachMessage = message.contents as InboundAttachMessage;\n\n\t\tthis.dataStoresSinceLastGC.push(attachMessage.id);\n\n\t\t// The local object has already been attached\n\t\tif (local) {\n\t\t\tassert(\n\t\t\t\tthis.pendingAttach.has(attachMessage.id),\n\t\t\t\t0x15e /* \"Local object does not have matching attach message id\" */,\n\t\t\t);\n\t\t\tthis.contexts.get(attachMessage.id)?.emit(\"attached\");\n\t\t\tthis.pendingAttach.delete(attachMessage.id);\n\t\t\treturn;\n\t\t}\n\n\t\t// If a non-local operation then go and create the object, otherwise mark it as officially attached.\n\t\tif (this.alreadyProcessed(attachMessage.id)) {\n\t\t\t// TODO: dataStoreId may require a different tag from PackageData #7488\n\t\t\tconst error = new DataCorruptionError(\n\t\t\t\t// pre-0.58 error message: duplicateDataStoreCreatedWithExistingId\n\t\t\t\t\"Duplicate DataStore created with existing id\",\n\t\t\t\t{\n\t\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t\t\t...tagCodeArtifacts({ dataStoreId: attachMessage.id }),\n\t\t\t\t},\n\t\t\t);\n\t\t\tthrow error;\n\t\t}\n\n\t\tconst flatAttachBlobs = new Map<string, ArrayBufferLike>();\n\t\tlet snapshotTree: ISnapshotTree | undefined;\n\t\tif (attachMessage.snapshot) {\n\t\t\tsnapshotTree = buildSnapshotTree(attachMessage.snapshot.entries, flatAttachBlobs);\n\t\t}\n\n\t\t// Include the type of attach message which is the pkg of the store to be\n\t\t// used by RemoteFluidDataStoreContext in case it is not in the snapshot.\n\t\tconst pkg = [attachMessage.type];\n\t\tconst remoteFluidDataStoreContext = new RemoteFluidDataStoreContext({\n\t\t\tid: attachMessage.id,\n\t\t\tsnapshotTree,\n\t\t\truntime: this.runtime,\n\t\t\tstorage: new StorageServiceWithAttachBlobs(this.runtime.storage, flatAttachBlobs),\n\t\t\tscope: this.runtime.scope,\n\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(attachMessage.id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.FromAttach,\n\t\t\t\tsequenceNumber: message.sequenceNumber,\n\t\t\t\tsnapshot: attachMessage.snapshot ?? {\n\t\t\t\t\tentries: [createAttributesBlob(pkg, true /* isRootDataStore */)],\n\t\t\t\t},\n\t\t\t}),\n\t\t\tpkg,\n\t\t});\n\n\t\tthis.contexts.addBoundOrRemoted(remoteFluidDataStoreContext);\n\t}\n\n\tpublic processAliasMessage(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocalOpMetadata: unknown,\n\t\tlocal: boolean,\n\t): void {\n\t\tconst aliasMessage = message.contents as IDataStoreAliasMessage;\n\t\tif (!isDataStoreAliasMessage(aliasMessage)) {\n\t\t\tthrow new DataCorruptionError(\"malformedDataStoreAliasMessage\", {\n\t\t\t\t...extractSafePropertiesFromMessage(message),\n\t\t\t});\n\t\t}\n\n\t\tconst resolve = localOpMetadata as PendingAliasResolve;\n\t\tconst aliasResult = this.processAliasMessageCore(aliasMessage);\n\t\tif (local) {\n\t\t\tresolve(aliasResult);\n\t\t}\n\t}\n\n\tpublic processAliasMessageCore(aliasMessage: IDataStoreAliasMessage): boolean {\n\t\tif (this.alreadyProcessed(aliasMessage.alias)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst context = this.contexts.get(aliasMessage.internalId);\n\t\tif (context === undefined) {\n\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\teventName: \"AliasFluidDataStoreNotFound\",\n\t\t\t\tfluidDataStoreId: aliasMessage.internalId,\n\t\t\t});\n\t\t\treturn false;\n\t\t}\n\n\t\tconst handle = new FluidObjectHandle(\n\t\t\tcontext,\n\t\t\taliasMessage.internalId,\n\t\t\tthis.runtime.IFluidHandleContext,\n\t\t);\n\t\tthis.runtime.addedGCOutboundReference(this.containerRuntimeHandle, handle);\n\n\t\tthis.aliasMap.set(aliasMessage.alias, context.id);\n\t\tcontext.setInMemoryRoot();\n\t\treturn true;\n\t}\n\n\tprivate alreadyProcessed(id: string): boolean {\n\t\treturn this.aliasMap.get(id) !== undefined || this.contexts.get(id) !== undefined;\n\t}\n\n\t/**\n\t * Make the data stores locally visible in the container graph by moving the data store context from unbound to\n\t * bound list. This data store can now be reached from the root.\n\t * @param id - The id of the data store context to make visible.\n\t */\n\tprivate makeDataStoreLocallyVisible(id: string): void {\n\t\tconst localContext = this.contexts.getUnbound(id);\n\t\tassert(!!localContext, 0x15f /* \"Could not find unbound context to bind\" */);\n\n\t\t/**\n\t\t * If the container is not detached, it is globally visible to all clients. This data store should also be\n\t\t * globally visible. Move it to attaching state and send an \"attach\" op for it.\n\t\t * If the container is detached, this data store will be part of the summary that makes the container attached.\n\t\t */\n\t\tif (this.runtime.attachState !== AttachState.Detached) {\n\t\t\tlocalContext.emit(\"attaching\");\n\t\t\tconst message = localContext.generateAttachMessage();\n\n\t\t\tthis.pendingAttach.set(id, message);\n\t\t\tthis.submitAttachFn(message);\n\t\t\tthis.attachOpFiredForDataStore.add(id);\n\t\t}\n\n\t\tthis.contexts.bind(id);\n\t}\n\n\tpublic createDetachedDataStoreCore(\n\t\tpkg: Readonly<string[]>,\n\t\tisRoot: boolean,\n\t\tid = uuid(),\n\t): IFluidDataStoreContextDetached {\n\t\tassert(!id.includes(\"/\"), 0x30c /* Id cannot contain slashes */);\n\n\t\tconst context = new LocalDetachedFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\truntime: this.runtime,\n\t\t\tstorage: this.runtime.storage,\n\t\t\tscope: this.runtime.scope,\n\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tisRootDataStore: isRoot,\n\t\t});\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic _createFluidDataStoreContext(pkg: string[], id: string, props?: any) {\n\t\tassert(!id.includes(\"/\"), 0x30d /* Id cannot contain slashes */);\n\t\tconst context = new LocalFluidDataStoreContext({\n\t\t\tid,\n\t\t\tpkg,\n\t\t\truntime: this.runtime,\n\t\t\tstorage: this.runtime.storage,\n\t\t\tscope: this.runtime.scope,\n\t\t\tcreateSummarizerNodeFn: this.getCreateChildSummarizerNodeFn(id, {\n\t\t\t\ttype: CreateSummarizerNodeSource.Local,\n\t\t\t}),\n\t\t\tmakeLocallyVisibleFn: () => this.makeDataStoreLocallyVisible(id),\n\t\t\tsnapshotTree: undefined,\n\t\t\tisRootDataStore: false,\n\t\t\tcreateProps: props,\n\t\t});\n\t\tthis.contexts.addUnbound(context);\n\t\treturn context;\n\t}\n\n\tpublic get disposed() {\n\t\treturn this.disposeOnce.evaluated;\n\t}\n\tpublic readonly dispose = () => this.disposeOnce.value;\n\n\tpublic resubmitDataStoreOp(envelope: IEnvelope, localOpMetadata: unknown) {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x160 /* \"There should be a store context for the op\" */);\n\t\tcontext.reSubmit(envelope.contents, localOpMetadata);\n\t}\n\n\tpublic rollbackDataStoreOp(envelope: IEnvelope, localOpMetadata: unknown) {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x2e8 /* \"There should be a store context for the op\" */);\n\t\tcontext.rollback(envelope.contents, localOpMetadata);\n\t}\n\n\tpublic async applyStashedOp(envelope: IEnvelope): Promise<unknown> {\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x161 /* \"There should be a store context for the op\" */);\n\t\treturn context.applyStashedOp(envelope.contents);\n\t}\n\n\tpublic async applyStashedAttachOp(message: IAttachMessage) {\n\t\tthis.pendingAttach.set(message.id, message);\n\t\t// eslint-disable-next-line @typescript-eslint/consistent-type-assertions\n\t\tthis.processAttachMessage({ contents: message } as ISequencedDocumentMessage, false);\n\t}\n\n\tpublic processFluidDataStoreOp(\n\t\tmessage: ISequencedDocumentMessage,\n\t\tlocal: boolean,\n\t\tlocalMessageMetadata: unknown,\n\t) {\n\t\tconst envelope = message.contents as IEnvelope;\n\t\tconst transformed = { ...message, contents: envelope.contents };\n\t\tthis.validateNotDeleted(envelope.address);\n\t\tconst context = this.contexts.get(envelope.address);\n\t\tassert(!!context, 0x162 /* \"There should be a store context for the op\" */);\n\t\tcontext.process(transformed, local, localMessageMetadata);\n\n\t\t// Notify that a GC node for the data store changed. This is used to detect if a deleted data store is\n\t\t// being used.\n\t\tthis.gcNodeUpdated(\n\t\t\t`/${envelope.address}`,\n\t\t\tmessage.timestamp,\n\t\t\tcontext.isLoaded ? context.packagePath : undefined,\n\t\t);\n\t}\n\n\tpublic async getDataStore(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<FluidDataStoreContext> {\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tthis.validateNotDeleted(id, headerData);\n\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\t// The requested data store does not exits. Throw a 404 response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(create404Response(request), request);\n\t\t}\n\n\t\tthis.validateNotTombstoned(context, requestHeaderData);\n\n\t\treturn context;\n\t}\n\n\t/**\n\t * Returns the data store requested with the given id if available. Otherwise, returns undefined.\n\t */\n\tpublic async getDataStoreIfAvailable(\n\t\tid: string,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t): Promise<FluidDataStoreContext | undefined> {\n\t\t// If the data store has been deleted, return undefined.\n\t\tif (this.checkIfDeleted(id, requestHeaderData)) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst headerData = { ...defaultRuntimeHeaderData, ...requestHeaderData };\n\t\tconst context = await this.contexts.getBoundOrRemoted(id, headerData.wait);\n\t\tif (context === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Check if the data store is tombstoned. If so, we want to log a telemetry event.\n\t\tthis.checkIfTombstoned(context, requestHeaderData);\n\t\treturn context;\n\t}\n\n\t/**\n\t * Checks if the data store has been deleted by GC.\n\t * @param id - data store id\n\t * @param request - the request information to log if the validation detects the data store has been deleted\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted\n\t * @returns true if the data store is deleted. Otherwise, returns false.\n\t */\n\tprivate checkIfDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {\n\t\tconst dataStoreNodePath = `/${id}`;\n\t\tif (!this.isDataStoreDeleted(dataStoreNodePath)) {\n\t\t\treturn false;\n\t\t}\n\t\tassert(\n\t\t\t!this.contexts.has(id),\n\t\t\t0x570 /* Inconsistent state! GC says the data store is deleted, but the data store is not deleted from the runtime. */,\n\t\t);\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName: \"GC_Deleted_DataStore_Requested\",\n\t\t\t\tcategory: \"error\",\n\t\t\t\tisSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,\n\t\t\t\tid,\n\t\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\tundefined /* packagePath */,\n\t\t);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Validate that the data store had not been deleted by GC.\n\t * @param id - data store id\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been deleted\n\t */\n\tprivate validateNotDeleted(id: string, requestHeaderData?: RuntimeHeaderData) {\n\t\tif (this.checkIfDeleted(id, requestHeaderData)) {\n\t\t\t// The requested data store is removed by gc. Create a 404 gc response exception.\n\t\t\tconst request: IRequest = { url: id };\n\t\t\tthrow responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", request),\n\t\t\t\trequest,\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Checks if the data store has not been marked as tombstone by GC or not.\n\t * @param context - the data store context in question\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned\n\t * @returns true if the data store is tombstoned. Otherwise, returns false.\n\t */\n\tprivate checkIfTombstoned(\n\t\tcontext: FluidDataStoreContext,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t) {\n\t\tif (!context.tombstoned) {\n\t\t\treturn false;\n\t\t}\n\t\tconst logErrorEvent = this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone;\n\t\tsendGCUnexpectedUsageEvent(\n\t\t\tthis.mc,\n\t\t\t{\n\t\t\t\teventName: \"GC_Tombstone_DataStore_Requested\",\n\t\t\t\tcategory: logErrorEvent ? \"error\" : \"generic\",\n\t\t\t\tisSummarizerClient: this.runtime.clientDetails.type === summarizerClientType,\n\t\t\t\tid: context.id,\n\t\t\t\theaders: JSON.stringify(requestHeaderData),\n\t\t\t\tgcTombstoneEnforcementAllowed: this.runtime.gcTombstoneEnforcementAllowed,\n\t\t\t},\n\t\t\tcontext.isLoaded ? context.packagePath : undefined,\n\t\t);\n\t\treturn true;\n\t}\n\n\t/**\n\t * Validates that the data store context requested has not been marked as tombstone by GC.\n\t * @param context - the data store context in question\n\t * @param request - the request information to log if the validation detects the data store has been tombstoned\n\t * @param requestHeaderData - the request header information to log if the validation detects the data store has been tombstoned\n\t */\n\tprivate validateNotTombstoned(\n\t\tcontext: FluidDataStoreContext,\n\t\trequestHeaderData: RuntimeHeaderData,\n\t) {\n\t\tif (this.checkIfTombstoned(context, requestHeaderData)) {\n\t\t\t// The requested data store is removed by gc. Create a 404 gc response exception.\n\t\t\tconst request: IRequest = { url: context.id };\n\t\t\tconst error = responseToException(\n\t\t\t\tcreateResponseError(404, \"DataStore was deleted\", request, {\n\t\t\t\t\t[TombstoneResponseHeaderKey]: true,\n\t\t\t\t}),\n\t\t\t\trequest,\n\t\t\t);\n\t\t\t// Throw an error if configured via options and via request headers.\n\t\t\tif (this.throwOnTombstoneLoad && !requestHeaderData.allowTombstone) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic processSignal(fluidDataStoreId: string, message: IInboundSignalMessage, local: boolean) {\n\t\tthis.validateNotDeleted(fluidDataStoreId);\n\t\tconst context = this.contexts.get(fluidDataStoreId);\n\t\tif (!context) {\n\t\t\t// Attach message may not have been processed yet\n\t\t\tassert(!local, 0x163 /* \"Missing datastore for local signal\" */);\n\t\t\tthis.mc.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"SignalFluidDataStoreNotFound\",\n\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t}),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tcontext.processSignal(message, local);\n\t}\n\n\tpublic setConnectionState(connected: boolean, clientId?: string) {\n\t\tfor (const [fluidDataStoreId, context] of this.contexts) {\n\t\t\ttry {\n\t\t\t\tcontext.setConnectionState(connected, clientId);\n\t\t\t} catch (error) {\n\t\t\t\tthis.mc.logger.sendErrorEvent(\n\t\t\t\t\t{\n\t\t\t\t\t\teventName: \"SetConnectionStateError\",\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t...tagCodeArtifacts({\n\t\t\t\t\t\t\tfluidDataStoreId,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdetails: JSON.stringify({\n\t\t\t\t\t\t\truntimeConnected: this.runtime.connected,\n\t\t\t\t\t\t\tconnected,\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t\terror,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {\n\t\tconst eventName = attachState === AttachState.Attaching ? \"attaching\" : \"attached\";\n\t\tfor (const [, context] of this.contexts) {\n\t\t\t// Fire only for bounded stores.\n\t\t\tif (!this.contexts.isNotBound(context.id)) {\n\t\t\t\tcontext.emit(eventName);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic get size(): number {\n\t\treturn this.contexts.size;\n\t}\n\n\tpublic async summarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<ISummaryTreeWithStats> {\n\t\tconst summaryBuilder = new SummaryTreeBuilder();\n\n\t\t// Iterate over each store and ask it to snapshot\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer works only with clients with no local changes. A data store in attaching\n\t\t\t\t\t// state indicates an op was sent to attach a local data store.\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontext.attachState !== AttachState.Attaching,\n\t\t\t\t\t\t0x588 /* Local data store detected in attaching state during summarize */,\n\t\t\t\t\t);\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextSummary = await context.summarize(\n\t\t\t\t\t\tfullTree,\n\t\t\t\t\t\ttrackState,\n\t\t\t\t\t\ttelemetryContext,\n\t\t\t\t\t);\n\t\t\t\t\tsummaryBuilder.addWithStats(contextId, contextSummary);\n\t\t\t\t}),\n\t\t);\n\n\t\treturn summaryBuilder.getSummaryTree();\n\t}\n\n\tpublic createSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats {\n\t\tconst builder = new SummaryTreeBuilder();\n\t\t// Attaching graph of some stores can cause other stores to get bound too.\n\t\t// So keep taking summary until no new stores get bound.\n\t\tlet notBoundContextsLength: number;\n\t\tdo {\n\t\t\tconst builderTree = builder.summary.tree;\n\t\t\tnotBoundContextsLength = this.contexts.notBoundLength();\n\t\t\t// Iterate over each data store and ask it to snapshot\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(\n\t\t\t\t\t([key, _]) =>\n\t\t\t\t\t\t// Take summary of bounded data stores only, make sure we haven't summarized them already\n\t\t\t\t\t\t// and no attach op has been fired for that data store because for loader versions <= 0.24\n\t\t\t\t\t\t// we set attach state as \"attaching\" before taking createNew summary.\n\t\t\t\t\t\t!(\n\t\t\t\t\t\t\tthis.contexts.isNotBound(key) ||\n\t\t\t\t\t\t\tbuilderTree[key] ||\n\t\t\t\t\t\t\tthis.attachOpFiredForDataStore.has(key)\n\t\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t\t.map(([key, value]) => {\n\t\t\t\t\tlet dataStoreSummary: ISummarizeResult;\n\t\t\t\t\tif (value.isLoaded) {\n\t\t\t\t\t\tconst snapshot = value.generateAttachMessage().snapshot;\n\t\t\t\t\t\tdataStoreSummary = convertToSummaryTree(snapshot, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If this data store is not yet loaded, then there should be no changes in the snapshot from\n\t\t\t\t\t\t// which it was created as it is detached container. So just use the previous snapshot.\n\t\t\t\t\t\tassert(\n\t\t\t\t\t\t\t!!this.baseSnapshot,\n\t\t\t\t\t\t\t0x166 /* \"BaseSnapshot should be there as detached container loaded from snapshot\" */,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tdataStoreSummary = convertSnapshotTreeToSummaryTree(\n\t\t\t\t\t\t\tthis.baseSnapshot.trees[key],\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbuilder.addWithStats(key, dataStoreSummary);\n\t\t\t\t});\n\t\t} while (notBoundContextsLength !== this.contexts.notBoundLength());\n\n\t\treturn builder.getSummaryTree();\n\t}\n\n\t/**\n\t * Before GC runs, called by the garbage collector to update any pending GC state.\n\t * The garbage collector needs to know all outbound references that are added. Since root data stores are not\n\t * explicitly marked as referenced, notify GC of new root data stores that were added since the last GC run.\n\t */\n\tpublic async updateStateBeforeGC(): Promise<void> {\n\t\tfor (const id of this.dataStoresSinceLastGC) {\n\t\t\tconst context = this.contexts.get(id);\n\t\t\tassert(context !== undefined, 0x2b6 /* Missing data store context */);\n\t\t\tif (await context.isRoot()) {\n\t\t\t\t// A root data store is basically a reference from the container runtime to the data store.\n\t\t\t\tconst handle = new FluidObjectHandle(context, id, this.runtime.IFluidHandleContext);\n\t\t\t\tthis.runtime.addedGCOutboundReference(this.containerRuntimeHandle, handle);\n\t\t\t}\n\t\t}\n\t\tthis.dataStoresSinceLastGC = [];\n\t}\n\n\t/**\n\t * Generates data used for garbage collection. It does the following:\n\t *\n\t * 1. Calls into each child data store context to get its GC data.\n\t *\n\t * 2. Prefixes the child context's id to the GC nodes in the child's GC data. This makes sure that the node can be\n\t * identified as belonging to the child.\n\t *\n\t * 3. Adds a GC node for this channel to the nodes received from the children. All these nodes together represent\n\t * the GC data of this channel.\n\t *\n\t * @param fullGC - true to bypass optimizations and force full generation of GC data.\n\t */\n\tpublic async getGCData(fullGC: boolean = false): Promise<IGarbageCollectionData> {\n\t\tconst builder = new GCDataBuilder();\n\t\t// Iterate over each store and get their GC data.\n\t\tawait Promise.all(\n\t\t\tArray.from(this.contexts)\n\t\t\t\t.filter(([_, context]) => {\n\t\t\t\t\t// Summarizer client and hence GC works only with clients with no local changes. A data store in\n\t\t\t\t\t// attaching state indicates an op was sent to attach a local data store.\n\t\t\t\t\tassert(\n\t\t\t\t\t\tcontext.attachState !== AttachState.Attaching,\n\t\t\t\t\t\t0x589 /* Local data store detected in attaching state while running GC */,\n\t\t\t\t\t);\n\t\t\t\t\treturn context.attachState === AttachState.Attached;\n\t\t\t\t})\n\t\t\t\t.map(async ([contextId, context]) => {\n\t\t\t\t\tconst contextGCData = await context.getGCData(fullGC);\n\t\t\t\t\t// Prefix the child's id to the ids of its GC nodes so they can be identified as belonging to the child.\n\t\t\t\t\t// This also gradually builds the id of each node to be a path from the root.\n\t\t\t\t\tbuilder.prefixAndAddNodes(contextId, contextGCData.gcNodes);\n\t\t\t\t}),\n\t\t);\n\n\t\t// Get the outbound routes and add a GC node for this channel.\n\t\tbuilder.addNode(\"/\", await this.getOutboundRoutes());\n\t\treturn builder.getGCData();\n\t}\n\n\t/**\n\t * After GC has run, called to notify this Container's data stores of routes that are used in it.\n\t * @param usedRoutes - The routes that are used in all data stores in this Container.\n\t */\n\tpublic updateUsedRoutes(usedRoutes: string[]) {\n\t\t// Get a map of data store ids to routes used in it.\n\t\tconst usedDataStoreRoutes = unpackChildNodesUsedRoutes(usedRoutes);\n\n\t\t// Verify that the used routes are correct.\n\t\tfor (const [id] of usedDataStoreRoutes) {\n\t\t\tassert(\n\t\t\t\tthis.contexts.has(id),\n\t\t\t\t0x167 /* \"Used route does not belong to any known data store\" */,\n\t\t\t);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.updateUsedRoutes(usedDataStoreRoutes.get(contextId) ?? []);\n\t\t}\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are unused. The unused objects are deleted.\n\t * @param unusedRoutes - The routes that are unused in all data stores in this Container.\n\t */\n\tpublic updateUnusedRoutes(unusedRoutes: string[]) {\n\t\tfor (const route of unusedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Delete data store only if its route (/datastoreId) is in unusedRoutes. We don't want to delete a data\n\t\t\t// store based on its DDS being unused.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x2d7 /* No data store with specified id */);\n\t\t\t// Delete the contexts of unused data stores.\n\t\t\tthis.contexts.delete(dataStoreId);\n\t\t\t// Delete the summarizer node of the unused data stores.\n\t\t\tthis.deleteChildSummarizerNodeFn(dataStoreId);\n\t\t}\n\t}\n\n\t/**\n\t * Delete data stores and its objects that are sweep ready.\n\t * @param sweepReadyDataStoreRoutes - The routes of data stores and its objects that are sweep ready and should\n\t * be deleted.\n\t * @returns The routes of data stores and its objects that were deleted.\n\t */\n\tpublic deleteSweepReadyNodes(sweepReadyDataStoreRoutes: string[]): string[] {\n\t\t// If sweep for data stores is not enabled, return empty list indicating nothing is deleted.\n\t\tif (this.mc.config.getBoolean(disableDatastoreSweepKey) === true) {\n\t\t\treturn [];\n\t\t}\n\t\tfor (const route of sweepReadyDataStoreRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\tconst dataStoreId = pathParts[1];\n\n\t\t\t// TODO: GC:Validation - Skip any routes already deleted\n\t\t\t// Ignore sub-data store routes because a data store and its sub-routes are deleted together, so, we only\n\t\t\t// need to delete the data store.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!this.contexts.has(dataStoreId)) {\n\t\t\t\tthis.mc.logger.sendErrorEvent({\n\t\t\t\t\teventName: \"DeletedDataStoreNotFound\",\n\t\t\t\t\tdataStoreId,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst dataStore = this.contexts.get(dataStoreId);\n\t\t\tassert(dataStore !== undefined, 0x571 /* Attempting to delete unknown dataStore */);\n\t\t\tdataStore.delete();\n\n\t\t\t// Delete the contexts of sweep ready data stores.\n\t\t\tthis.contexts.delete(dataStoreId);\n\t\t\t// Delete the summarizer node of the sweep ready data stores.\n\t\t\tthis.deleteChildSummarizerNodeFn(dataStoreId);\n\t\t}\n\t\treturn Array.from(sweepReadyDataStoreRoutes);\n\t}\n\n\t/**\n\t * This is called to update objects whose routes are tombstones. Tombstoned datastore contexts enable testing\n\t * scenarios with accessing deleted content without actually deleting content from summaries.\n\t * @param tombstonedRoutes - The routes that are tombstones in all data stores in this Container.\n\t */\n\tpublic updateTombstonedRoutes(tombstonedRoutes: string[]) {\n\t\tconst tombstonedDataStoresSet: Set<string> = new Set();\n\t\tfor (const route of tombstonedRoutes) {\n\t\t\tconst pathParts = route.split(\"/\");\n\t\t\t// Tombstone data store only if its route (/datastoreId) is directly in tombstoneRoutes.\n\t\t\tif (pathParts.length > 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst dataStoreId = pathParts[1];\n\t\t\tassert(this.contexts.has(dataStoreId), 0x510 /* No data store with specified id */);\n\t\t\ttombstonedDataStoresSet.add(dataStoreId);\n\t\t}\n\n\t\t// Update the used routes in each data store. Used routes is empty for unused data stores.\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tcontext.setTombstone(tombstonedDataStoresSet.has(contextId));\n\t\t}\n\t}\n\n\t/**\n\t * Returns the outbound routes of this channel. Only root data stores are considered referenced and their paths are\n\t * part of outbound routes.\n\t */\n\tprivate async getOutboundRoutes(): Promise<string[]> {\n\t\tconst outboundRoutes: string[] = [];\n\t\tfor (const [contextId, context] of this.contexts) {\n\t\t\tconst isRootDataStore = await context.isRoot();\n\t\t\tif (isRootDataStore) {\n\t\t\t\toutboundRoutes.push(`/${contextId}`);\n\t\t\t}\n\t\t}\n\t\treturn outboundRoutes;\n\t}\n\n\t/**\n\t * Called by GC to retrieve the package path of a data store node with the given path.\n\t */\n\tpublic async getDataStorePackagePath(nodePath: string): Promise<readonly string[] | undefined> {\n\t\t// If the node belongs to a data store, return its package path. For DDSes, we return the package path of the\n\t\t// data store that contains it.\n\t\tconst context = this.contexts.get(nodePath.split(\"/\")[1]);\n\t\treturn (await context?.getInitialSnapshotDetails())?.pkg;\n\t}\n\n\t/**\n\t * Called by GC to determine if a node is for a data store or for an object within a data store (for e.g. DDS).\n\t * @returns the GC node type if the node belongs to a data store or object within data store, undefined otherwise.\n\t */\n\tpublic getGCNodeType(nodePath: string): GCNodeType | undefined {\n\t\tconst pathParts = nodePath.split(\"/\");\n\t\tif (!this.contexts.has(pathParts[1])) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Data stores paths are of the format \"/dataStoreId\".\n\t\t// Sub data store paths are of the format \"/dataStoreId/subPath/...\".\n\t\tif (pathParts.length === 2) {\n\t\t\treturn GCNodeType.DataStore;\n\t\t}\n\t\treturn GCNodeType.SubDataStore;\n\t}\n}\n\nexport function getSummaryForDatastores(\n\tsnapshot: ISnapshotTree | undefined,\n\tmetadata?: IContainerRuntimeMetadata,\n): ISnapshotTree | undefined {\n\tif (!snapshot) {\n\t\treturn undefined;\n\t}\n\n\tif (rootHasIsolatedChannels(metadata)) {\n\t\tconst datastoresSnapshot = snapshot.trees[channelsTreeName];\n\t\tassert(!!datastoresSnapshot, 0x168 /* Expected tree in snapshot not found */);\n\t\treturn datastoresSnapshot;\n\t} else {\n\t\t// back-compat: strip out all non-datastore paths before giving to DataStores object.\n\t\tconst datastoresTrees: ISnapshotTree[\"trees\"] = {};\n\t\tfor (const [key, value] of Object.entries(snapshot.trees)) {\n\t\t\tif (!nonDataStorePaths.includes(key)) {\n\t\t\t\tdatastoresTrees[key] = value;\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\t...snapshot,\n\t\t\ttrees: datastoresTrees,\n\t\t};\n\t}\n}\n"]}
@@ -8,10 +8,6 @@ import { EventForwarder } from "@fluid-internal/client-utils";
8
8
  * proxy implementations can override specific methods.
9
9
  */
10
10
  export class DeltaManagerProxyBase extends EventForwarder {
11
- constructor(deltaManager) {
12
- super(deltaManager);
13
- this.deltaManager = deltaManager;
14
- }
15
11
  get IDeltaSender() {
16
12
  return this;
17
13
  }
@@ -60,6 +56,10 @@ export class DeltaManagerProxyBase extends EventForwarder {
60
56
  get readOnlyInfo() {
61
57
  return this.deltaManager.readOnlyInfo;
62
58
  }
59
+ constructor(deltaManager) {
60
+ super(deltaManager);
61
+ this.deltaManager = deltaManager;
62
+ }
63
63
  dispose() {
64
64
  super.dispose();
65
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"deltaManagerProxyBase.js","sourceRoot":"","sources":["../src/deltaManagerProxyBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAgB9D;;;GAGG;AACH,MAAM,OAAO,qBACZ,SAAQ,cAAmC;IAmE3C,YACoB,YAAwE;QAE3F,KAAK,CAAC,YAAY,CAAC,CAAC;QAFD,iBAAY,GAAZ,YAAY,CAA4D;IAG5F,CAAC;IApED,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IACxC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;IACtC,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,2BAA2B;QACrC,OAAO,IAAI,CAAC,YAAY,CAAC,2BAA2B,CAAC;IACtD,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IACxC,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC;IACzC,CAAC;IAED,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC;IAC/C,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;IAQM,OAAO;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEM,YAAY,CAAC,OAAY;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventForwarder } from \"@fluid-internal/client-utils\";\nimport {\n\tIDeltaManager,\n\tIDeltaManagerEvents,\n\tIDeltaQueue,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tIClientConfiguration,\n\tIClientDetails,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Base class for creating proxy to the real delta manager. It implements all required methods on IDeltaManager and\n * proxy implementations can override specific methods.\n */\nexport class DeltaManagerProxyBase\n\textends EventForwarder<IDeltaManagerEvents>\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get IDeltaSender(): IDeltaSender {\n\t\treturn this;\n\t}\n\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this.deltaManager.inbound;\n\t}\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this.deltaManager.outbound;\n\t}\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this.deltaManager.inboundSignal;\n\t}\n\n\tpublic get minimumSequenceNumber(): number {\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastSequenceNumber(): number {\n\t\treturn this.deltaManager.lastSequenceNumber;\n\t}\n\n\tpublic get lastMessage() {\n\t\treturn this.deltaManager.lastMessage;\n\t}\n\n\tpublic get lastKnownSeqNumber() {\n\t\treturn this.deltaManager.lastKnownSeqNumber;\n\t}\n\n\tpublic get initialSequenceNumber(): number {\n\t\treturn this.deltaManager.initialSequenceNumber;\n\t}\n\n\tpublic get hasCheckpointSequenceNumber() {\n\t\treturn this.deltaManager.hasCheckpointSequenceNumber;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.deltaManager.clientDetails;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.deltaManager.version;\n\t}\n\n\tpublic get maxMessageSize(): number {\n\t\treturn this.deltaManager.maxMessageSize;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration | undefined {\n\t\treturn this.deltaManager.serviceConfiguration;\n\t}\n\n\tpublic get active(): boolean {\n\t\treturn this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t) {\n\t\tsuper(deltaManager);\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic submitSignal(content: any): void {\n\t\treturn this.deltaManager.submitSignal(content);\n\t}\n\n\tpublic flush(): void {\n\t\treturn this.deltaManager.flush();\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaManagerProxyBase.js","sourceRoot":"","sources":["../src/deltaManagerProxyBase.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAgB9D;;;GAGG;AACH,MAAM,OAAO,qBACZ,SAAQ,cAAmC;IAG3C,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;IACnC,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IACxC,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAW,WAAW;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;IACtC,CAAC;IAED,IAAW,kBAAkB;QAC5B,OAAO,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC;IAC7C,CAAC;IAED,IAAW,qBAAqB;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC;IAChD,CAAC;IAED,IAAW,2BAA2B;QACrC,OAAO,IAAI,CAAC,YAAY,CAAC,2BAA2B,CAAC;IACtD,CAAC;IAED,IAAW,aAAa;QACvB,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;IACxC,CAAC;IAED,IAAW,OAAO;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;IAClC,CAAC;IAED,IAAW,cAAc;QACxB,OAAO,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC;IACzC,CAAC;IAED,IAAW,oBAAoB;QAC9B,OAAO,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC;IAC/C,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;IAED,YACoB,YAAwE;QAE3F,KAAK,CAAC,YAAY,CAAC,CAAC;QAFD,iBAAY,GAAZ,YAAY,CAA4D;IAG5F,CAAC;IAEM,OAAO;QACb,KAAK,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAEM,YAAY,CAAC,OAAY;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAEM,KAAK;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { EventForwarder } from \"@fluid-internal/client-utils\";\nimport {\n\tIDeltaManager,\n\tIDeltaManagerEvents,\n\tIDeltaQueue,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"@fluidframework/container-definitions\";\nimport {\n\tIClientConfiguration,\n\tIClientDetails,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/protocol-definitions\";\n\n/**\n * Base class for creating proxy to the real delta manager. It implements all required methods on IDeltaManager and\n * proxy implementations can override specific methods.\n */\nexport class DeltaManagerProxyBase\n\textends EventForwarder<IDeltaManagerEvents>\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get IDeltaSender(): IDeltaSender {\n\t\treturn this;\n\t}\n\n\tpublic get inbound(): IDeltaQueue<ISequencedDocumentMessage> {\n\t\treturn this.deltaManager.inbound;\n\t}\n\n\tpublic get outbound(): IDeltaQueue<IDocumentMessage[]> {\n\t\treturn this.deltaManager.outbound;\n\t}\n\n\tpublic get inboundSignal(): IDeltaQueue<ISignalMessage> {\n\t\treturn this.deltaManager.inboundSignal;\n\t}\n\n\tpublic get minimumSequenceNumber(): number {\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastSequenceNumber(): number {\n\t\treturn this.deltaManager.lastSequenceNumber;\n\t}\n\n\tpublic get lastMessage() {\n\t\treturn this.deltaManager.lastMessage;\n\t}\n\n\tpublic get lastKnownSeqNumber() {\n\t\treturn this.deltaManager.lastKnownSeqNumber;\n\t}\n\n\tpublic get initialSequenceNumber(): number {\n\t\treturn this.deltaManager.initialSequenceNumber;\n\t}\n\n\tpublic get hasCheckpointSequenceNumber() {\n\t\treturn this.deltaManager.hasCheckpointSequenceNumber;\n\t}\n\n\tpublic get clientDetails(): IClientDetails {\n\t\treturn this.deltaManager.clientDetails;\n\t}\n\n\tpublic get version(): string {\n\t\treturn this.deltaManager.version;\n\t}\n\n\tpublic get maxMessageSize(): number {\n\t\treturn this.deltaManager.maxMessageSize;\n\t}\n\n\tpublic get serviceConfiguration(): IClientConfiguration | undefined {\n\t\treturn this.deltaManager.serviceConfiguration;\n\t}\n\n\tpublic get active(): boolean {\n\t\treturn this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t) {\n\t\tsuper(deltaManager);\n\t}\n\n\tpublic dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic submitSignal(content: any): void {\n\t\treturn this.deltaManager.submitSignal(content);\n\t}\n\n\tpublic flush(): void {\n\t\treturn this.deltaManager.flush();\n\t}\n}\n"]}
@@ -10,12 +10,6 @@ import { summarizerClientType } from "./summary";
10
10
  * - Summarizer client should not be active to layers below the container runtime to restrict local changes.
11
11
  */
12
12
  export class DeltaManagerSummarizerProxy extends DeltaManagerProxyBase {
13
- constructor(deltaManager) {
14
- super(deltaManager);
15
- // We are expecting this class to have many listeners, so we suppress noisy "MaxListenersExceededWarning" logging.
16
- super.setMaxListeners(0);
17
- this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
18
- }
19
13
  get active() {
20
14
  // Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer
21
15
  // except for the SummarizeOp which is generated by the runtime.
@@ -34,5 +28,11 @@ export class DeltaManagerSummarizerProxy extends DeltaManagerProxyBase {
34
28
  }
35
29
  return this.deltaManager.readOnlyInfo;
36
30
  }
31
+ constructor(deltaManager) {
32
+ super(deltaManager);
33
+ // We are expecting this class to have many listeners, so we suppress noisy "MaxListenersExceededWarning" logging.
34
+ super.setMaxListeners(0);
35
+ this.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;
36
+ }
37
37
  }
38
38
  //# sourceMappingURL=deltaManagerSummarizerProxy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deltaManagerSummarizerProxy.js","sourceRoot":"","sources":["../src/deltaManagerSummarizerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,2BACZ,SAAQ,qBAAqB;IAyB7B,YAAY,YAAwE;QACnF,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,kHAAkH;QAClH,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,KAAK,oBAAoB,CAAC;IACzF,CAAC;IA3BD,IAAW,MAAM;QAChB,0GAA0G;QAC1G,gEAAgE;QAChE,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IAC7D,CAAC;IAED,IAAW,YAAY;QACtB,+GAA+G;QAC/G,iHAAiH;QACjH,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC5B,OAAO;gBACN,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,KAAK;gBACb,WAAW,EAAE,SAAS;gBACtB,WAAW,EAAE,KAAK;aAClB,CAAC;SACF;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;CAUD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDeltaManager, ReadOnlyInfo } from \"@fluidframework/container-definitions\";\nimport { IDocumentMessage, ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\n\nimport { DeltaManagerProxyBase } from \"./deltaManagerProxyBase\";\nimport { summarizerClientType } from \"./summary\";\n\n/**\n * Proxy to the real IDeltaManager for restricting certain access to layers below container runtime in summarizer clients:\n * - Summarizer client should be read-only to layers below the container runtime to restrict local changes.\n * - Summarizer client should not be active to layers below the container runtime to restrict local changes.\n */\nexport class DeltaManagerSummarizerProxy\n\textends DeltaManagerProxyBase\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get active(): boolean {\n\t\t// Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer\n\t\t// except for the SummarizeOp which is generated by the runtime.\n\t\treturn !this.isSummarizerClient && this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\t// Summarizer clients should be read-only as far as the runtime and layers below are concerned. There shouldn't\n\t\t// be any local changes (writes) in the summarizer except for the summarize op which is generated by the runtime.\n\t\tif (this.isSummarizerClient) {\n\t\t\treturn {\n\t\t\t\treadonly: true,\n\t\t\t\tforced: false,\n\t\t\t\tpermissions: undefined,\n\t\t\t\tstorageOnly: false,\n\t\t\t};\n\t\t}\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tprivate readonly isSummarizerClient: boolean;\n\n\tconstructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {\n\t\tsuper(deltaManager);\n\t\t// We are expecting this class to have many listeners, so we suppress noisy \"MaxListenersExceededWarning\" logging.\n\t\tsuper.setMaxListeners(0);\n\t\tthis.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaManagerSummarizerProxy.js","sourceRoot":"","sources":["../src/deltaManagerSummarizerProxy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;GAIG;AACH,MAAM,OAAO,2BACZ,SAAQ,qBAAqB;IAG7B,IAAW,MAAM;QAChB,0GAA0G;QAC1G,gEAAgE;QAChE,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IAC7D,CAAC;IAED,IAAW,YAAY;QACtB,+GAA+G;QAC/G,iHAAiH;QACjH,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC5B,OAAO;gBACN,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,KAAK;gBACb,WAAW,EAAE,SAAS;gBACtB,WAAW,EAAE,KAAK;aAClB,CAAC;SACF;QACD,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC;IACvC,CAAC;IAID,YAAY,YAAwE;QACnF,KAAK,CAAC,YAAY,CAAC,CAAC;QACpB,kHAAkH;QAClH,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,IAAI,KAAK,oBAAoB,CAAC;IACzF,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IDeltaManager, ReadOnlyInfo } from \"@fluidframework/container-definitions\";\nimport { IDocumentMessage, ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\n\nimport { DeltaManagerProxyBase } from \"./deltaManagerProxyBase\";\nimport { summarizerClientType } from \"./summary\";\n\n/**\n * Proxy to the real IDeltaManager for restricting certain access to layers below container runtime in summarizer clients:\n * - Summarizer client should be read-only to layers below the container runtime to restrict local changes.\n * - Summarizer client should not be active to layers below the container runtime to restrict local changes.\n */\nexport class DeltaManagerSummarizerProxy\n\textends DeltaManagerProxyBase\n\timplements IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>\n{\n\tpublic get active(): boolean {\n\t\t// Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer\n\t\t// except for the SummarizeOp which is generated by the runtime.\n\t\treturn !this.isSummarizerClient && this.deltaManager.active;\n\t}\n\n\tpublic get readOnlyInfo(): ReadOnlyInfo {\n\t\t// Summarizer clients should be read-only as far as the runtime and layers below are concerned. There shouldn't\n\t\t// be any local changes (writes) in the summarizer except for the summarize op which is generated by the runtime.\n\t\tif (this.isSummarizerClient) {\n\t\t\treturn {\n\t\t\t\treadonly: true,\n\t\t\t\tforced: false,\n\t\t\t\tpermissions: undefined,\n\t\t\t\tstorageOnly: false,\n\t\t\t};\n\t\t}\n\t\treturn this.deltaManager.readOnlyInfo;\n\t}\n\n\tprivate readonly isSummarizerClient: boolean;\n\n\tconstructor(deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>) {\n\t\tsuper(deltaManager);\n\t\t// We are expecting this class to have many listeners, so we suppress noisy \"MaxListenersExceededWarning\" logging.\n\t\tsuper.setMaxListeners(0);\n\t\tthis.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"deltaScheduler.js","sourceRoot":"","sources":["../src/deltaScheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IA4B1B,YACC,YAAwE,EACvD,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;QAzB7C,2DAA2D;QAC1C,4BAAuB,GAAG,EAAE,CAAC;QAGtC,wCAAmC,GAAW,cAAc,CAAC,cAAc,CAAC;QAEpF,+FAA+F;QAC/F,gGAAgG;QAChG,sBAAsB;QACd,oBAAe,GAAW,CAAC,CAAC;QAkBnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,UAAU,CAAC,OAAkC;QACnD,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC9B,IAAI,CAAC,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;SAC7C;QACD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,GAAG,GAAG,KAAK,CAAC,EAAE;YACzE,iFAAiF;YACjF,oFAAoF;YACpF,IAAI,CAAC,aAA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,aAAa,CAAC,kBAAkB;oBACrC,IAAI,CAAC,aAAa,CAAC,mBAAmB;oBACtC,CAAC;gBACF,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,wBAAwB;gBAC7D,QAAQ,EAAE,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;gBAChE,eAAe,EAAE,IAAI,CAAC,eAAe;aACrC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;SAC/B;QAED,yFAAyF;QACzF,qCAAqC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,8BAA8B;QAC9B,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;QACrC,IAAI,CAAC,mCAAmC,GAAG,cAAc,CAAC,cAAc,CAAC;IAC1E,CAAC;IAED;;OAEG;IACK,kBAAkB;QACzB,qFAAqF;QACrF,qBAAqB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;;AArJD,gDAAgD;AACzB,6BAAc,GAAG,EAAE,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, formatTick } from \"@fluidframework/telemetry-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport { IDocumentMessage, ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\n\n/**\n * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there\n * is more than one op a particular run of the queue. It does not schedule if there is just one\n * op or just one batch in the run. It does the following two things:\n *\n * 1. If the ops have been processed for more than a specific amount of time, it pauses the queue\n * and calls setTimeout to schedule a resume of the queue. This ensures that we don't block\n * the JS thread for a long time processing ops synchronously (for example, when catching up\n * ops right after boot or catching up ops / delayed realizing data stores by summarizer).\n *\n * 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops\n * processed, the time and number of turns it took to process the ops.\n */\nexport class DeltaScheduler {\n\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\t// The time for processing ops in a single turn.\n\tpublic static readonly processingTime = 50;\n\n\t// The increase in time for processing ops after each turn.\n\tprivate readonly processingTimeIncrement = 10;\n\n\tprivate processingStartTime: number | undefined;\n\tprivate currentAllowedProcessingTimeForTurn: number = DeltaScheduler.processingTime;\n\n\t// This keeps track of the number of times inbound queue has been scheduled. After a particular\n\t// count, we log telemetry for the number of ops processed, the time and number of turns it took\n\t// to process the ops.\n\tprivate schedulingCount: number = 0;\n\n\tprivate schedulingLog:\n\t\t| {\n\t\t\t\topsRemainingToProcess: number;\n\t\t\t\ttotalProcessingTime: number;\n\t\t\t\tnumberOfTurns: number;\n\t\t\t\tnumberOfBatchesProcessed: number;\n\t\t\t\tlastSequenceNumber: number;\n\t\t\t\tfirstSequenceNumber: number;\n\t\t\t\tstartTime: number;\n\t\t }\n\t\t| undefined;\n\n\tconstructor(\n\t\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaManager = deltaManager;\n\t\tthis.deltaManager.inbound.on(\"idle\", () => {\n\t\t\tthis.inboundQueueIdle();\n\t\t});\n\t}\n\n\tpublic batchBegin(message: ISequencedDocumentMessage) {\n\t\tif (!this.processingStartTime) {\n\t\t\tthis.processingStartTime = performance.now();\n\t\t}\n\t\tif (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {\n\t\t\t// Every 500th time we are scheduling the inbound queue, we log telemetry for the\n\t\t\t// number of ops processed, the time and number of turns it took to process the ops.\n\t\t\tthis.schedulingLog = {\n\t\t\t\topsRemainingToProcess: 0,\n\t\t\t\tnumberOfTurns: 1,\n\t\t\t\ttotalProcessingTime: 0,\n\t\t\t\tnumberOfBatchesProcessed: 0,\n\t\t\t\tfirstSequenceNumber: message.sequenceNumber,\n\t\t\t\tlastSequenceNumber: message.sequenceNumber,\n\t\t\t\tstartTime: performance.now(),\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic batchEnd(message: ISequencedDocumentMessage) {\n\t\tif (this.schedulingLog) {\n\t\t\tthis.schedulingLog.numberOfBatchesProcessed++;\n\t\t\tthis.schedulingLog.lastSequenceNumber = message.sequenceNumber;\n\t\t\tthis.schedulingLog.opsRemainingToProcess = this.deltaManager.inbound.length;\n\t\t}\n\n\t\tif (this.shouldRunScheduler()) {\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst elapsedTime = currentTime - this.processingStartTime!;\n\t\t\tif (elapsedTime > this.currentAllowedProcessingTimeForTurn) {\n\t\t\t\t// We have processed ops for more than the total processing time. So, pause the\n\t\t\t\t// queue, yield the thread and schedule a resume.\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tthis.deltaManager.inbound.pause();\n\n\t\t\t\t// Increase the total processing time. Keep doing this after each turn until all the ops have\n\t\t\t\t// been processed. This way we keep the responsiveness at the beginning while also making sure\n\t\t\t\t// that all the ops process fairly quickly.\n\t\t\t\tthis.currentAllowedProcessingTimeForTurn += this.processingTimeIncrement;\n\n\t\t\t\t// If we are logging the telemetry this time, update the telemetry log object.\n\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\tthis.schedulingLog.numberOfTurns++;\n\t\t\t\t\tthis.schedulingLog.totalProcessingTime += elapsedTime;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"InboundOpsPartialProcessingTime\",\n\t\t\t\t\t\t\tduration: formatTick(elapsedTime),\n\t\t\t\t\t\t\topsProcessed:\n\t\t\t\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\topsRemainingToProcess: this.deltaManager.inbound.length,\n\t\t\t\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\t\t\t\ttimeToResume: formatTick(performance.now() - currentTime),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.deltaManager.inbound.resume();\n\t\t\t\t});\n\n\t\t\t\tthis.processingStartTime = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate inboundQueueIdle() {\n\t\tif (this.schedulingLog) {\n\t\t\t// Add the time taken for processing the final ops to the total processing time in the\n\t\t\t// telemetry log object.\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tthis.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;\n\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"InboundOpsProcessingTime\",\n\t\t\t\topsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,\n\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\topsProcessed:\n\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t1,\n\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\tduration: formatTick(currentTime - this.schedulingLog.startTime),\n\t\t\t\tschedulingCount: this.schedulingCount,\n\t\t\t});\n\n\t\t\tthis.schedulingLog = undefined;\n\t\t}\n\n\t\t// If we scheduled this batch of the inbound queue, increment the counter that tracks the\n\t\t// number of times we have done this.\n\t\tthis.schedulingCount++;\n\n\t\t// Reset the processing times.\n\t\tthis.processingStartTime = undefined;\n\t\tthis.currentAllowedProcessingTimeForTurn = DeltaScheduler.processingTime;\n\t}\n\n\t/**\n\t * This function tells whether we should run the scheduler.\n\t */\n\tprivate shouldRunScheduler(): boolean {\n\t\t// If there are still ops in the queue after the one we are processing now, we should\n\t\t// run the scheduler.\n\t\treturn this.deltaManager.inbound.length > 0;\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaScheduler.js","sourceRoot":"","sources":["../src/deltaScheduler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAuB,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI3D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,cAAc;IA4B1B,YACC,YAAwE,EACvD,MAA2B;QAA3B,WAAM,GAAN,MAAM,CAAqB;QAzB7C,2DAA2D;QAC1C,4BAAuB,GAAG,EAAE,CAAC;QAGtC,wCAAmC,GAAW,cAAc,CAAC,cAAc,CAAC;QAEpF,+FAA+F;QAC/F,gGAAgG;QAChG,sBAAsB;QACd,oBAAe,GAAW,CAAC,CAAC;QAkBnC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACzC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzB,CAAC,CAAC,CAAC;IACJ,CAAC;IAEM,UAAU,CAAC,OAAkC;QACnD,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE;YAC9B,IAAI,CAAC,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;SAC7C;QACD,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,IAAI,IAAI,CAAC,eAAe,GAAG,GAAG,KAAK,CAAC,EAAE;YACzE,iFAAiF;YACjF,oFAAoF;YACpF,IAAI,CAAC,aAA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,aAAa,CAAC,kBAAkB;oBACrC,IAAI,CAAC,aAAa,CAAC,mBAAmB;oBACtC,CAAC;gBACF,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,wBAAwB;gBAC7D,QAAQ,EAAE,UAAU,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;gBAChE,eAAe,EAAE,IAAI,CAAC,eAAe;aACrC,CAAC,CAAC;YAEH,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;SAC/B;QAED,yFAAyF;QACzF,qCAAqC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;QAEvB,8BAA8B;QAC9B,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;QACrC,IAAI,CAAC,mCAAmC,GAAG,cAAc,CAAC,cAAc,CAAC;IAC1E,CAAC;IAED;;OAEG;IACK,kBAAkB;QACzB,qFAAqF;QACrF,qBAAqB;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7C,CAAC;;AArJD,gDAAgD;AACzB,6BAAc,GAAG,EAAE,AAAL,CAAM","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ITelemetryLoggerExt, formatTick } from \"@fluidframework/telemetry-utils\";\nimport { performance } from \"@fluid-internal/client-utils\";\nimport { IDeltaManager } from \"@fluidframework/container-definitions\";\nimport { IDocumentMessage, ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\n\n/**\n * DeltaScheduler is responsible for the scheduling of inbound delta queue in cases where there\n * is more than one op a particular run of the queue. It does not schedule if there is just one\n * op or just one batch in the run. It does the following two things:\n *\n * 1. If the ops have been processed for more than a specific amount of time, it pauses the queue\n * and calls setTimeout to schedule a resume of the queue. This ensures that we don't block\n * the JS thread for a long time processing ops synchronously (for example, when catching up\n * ops right after boot or catching up ops / delayed realizing data stores by summarizer).\n *\n * 2. If we scheduled a particular run of the queue, it logs telemetry for the number of ops\n * processed, the time and number of turns it took to process the ops.\n */\nexport class DeltaScheduler {\n\tprivate readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;\n\t// The time for processing ops in a single turn.\n\tpublic static readonly processingTime = 50;\n\n\t// The increase in time for processing ops after each turn.\n\tprivate readonly processingTimeIncrement = 10;\n\n\tprivate processingStartTime: number | undefined;\n\tprivate currentAllowedProcessingTimeForTurn: number = DeltaScheduler.processingTime;\n\n\t// This keeps track of the number of times inbound queue has been scheduled. After a particular\n\t// count, we log telemetry for the number of ops processed, the time and number of turns it took\n\t// to process the ops.\n\tprivate schedulingCount: number = 0;\n\n\tprivate schedulingLog:\n\t\t| {\n\t\t\t\topsRemainingToProcess: number;\n\t\t\t\ttotalProcessingTime: number;\n\t\t\t\tnumberOfTurns: number;\n\t\t\t\tnumberOfBatchesProcessed: number;\n\t\t\t\tlastSequenceNumber: number;\n\t\t\t\tfirstSequenceNumber: number;\n\t\t\t\tstartTime: number;\n\t\t }\n\t\t| undefined;\n\n\tconstructor(\n\t\tdeltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>,\n\t\tprivate readonly logger: ITelemetryLoggerExt,\n\t) {\n\t\tthis.deltaManager = deltaManager;\n\t\tthis.deltaManager.inbound.on(\"idle\", () => {\n\t\t\tthis.inboundQueueIdle();\n\t\t});\n\t}\n\n\tpublic batchBegin(message: ISequencedDocumentMessage) {\n\t\tif (!this.processingStartTime) {\n\t\t\tthis.processingStartTime = performance.now();\n\t\t}\n\t\tif (this.schedulingLog === undefined && this.schedulingCount % 500 === 0) {\n\t\t\t// Every 500th time we are scheduling the inbound queue, we log telemetry for the\n\t\t\t// number of ops processed, the time and number of turns it took to process the ops.\n\t\t\tthis.schedulingLog = {\n\t\t\t\topsRemainingToProcess: 0,\n\t\t\t\tnumberOfTurns: 1,\n\t\t\t\ttotalProcessingTime: 0,\n\t\t\t\tnumberOfBatchesProcessed: 0,\n\t\t\t\tfirstSequenceNumber: message.sequenceNumber,\n\t\t\t\tlastSequenceNumber: message.sequenceNumber,\n\t\t\t\tstartTime: performance.now(),\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic batchEnd(message: ISequencedDocumentMessage) {\n\t\tif (this.schedulingLog) {\n\t\t\tthis.schedulingLog.numberOfBatchesProcessed++;\n\t\t\tthis.schedulingLog.lastSequenceNumber = message.sequenceNumber;\n\t\t\tthis.schedulingLog.opsRemainingToProcess = this.deltaManager.inbound.length;\n\t\t}\n\n\t\tif (this.shouldRunScheduler()) {\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tconst elapsedTime = currentTime - this.processingStartTime!;\n\t\t\tif (elapsedTime > this.currentAllowedProcessingTimeForTurn) {\n\t\t\t\t// We have processed ops for more than the total processing time. So, pause the\n\t\t\t\t// queue, yield the thread and schedule a resume.\n\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-floating-promises\n\t\t\t\tthis.deltaManager.inbound.pause();\n\n\t\t\t\t// Increase the total processing time. Keep doing this after each turn until all the ops have\n\t\t\t\t// been processed. This way we keep the responsiveness at the beginning while also making sure\n\t\t\t\t// that all the ops process fairly quickly.\n\t\t\t\tthis.currentAllowedProcessingTimeForTurn += this.processingTimeIncrement;\n\n\t\t\t\t// If we are logging the telemetry this time, update the telemetry log object.\n\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\tthis.schedulingLog.numberOfTurns++;\n\t\t\t\t\tthis.schedulingLog.totalProcessingTime += elapsedTime;\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tif (this.schedulingLog) {\n\t\t\t\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\t\t\t\teventName: \"InboundOpsPartialProcessingTime\",\n\t\t\t\t\t\t\tduration: formatTick(elapsedTime),\n\t\t\t\t\t\t\topsProcessed:\n\t\t\t\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\topsRemainingToProcess: this.deltaManager.inbound.length,\n\t\t\t\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\t\t\t\ttimeToResume: formatTick(performance.now() - currentTime),\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tthis.deltaManager.inbound.resume();\n\t\t\t\t});\n\n\t\t\t\tthis.processingStartTime = undefined;\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate inboundQueueIdle() {\n\t\tif (this.schedulingLog) {\n\t\t\t// Add the time taken for processing the final ops to the total processing time in the\n\t\t\t// telemetry log object.\n\t\t\tconst currentTime = performance.now();\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t\t\tthis.schedulingLog.totalProcessingTime += currentTime - this.processingStartTime!;\n\n\t\t\tthis.logger.sendTelemetryEvent({\n\t\t\t\teventName: \"InboundOpsProcessingTime\",\n\t\t\t\topsRemainingToProcess: this.schedulingLog.opsRemainingToProcess,\n\t\t\t\tnumberOfTurns: this.schedulingLog.numberOfTurns,\n\t\t\t\tprocessingTime: formatTick(this.schedulingLog.totalProcessingTime),\n\t\t\t\topsProcessed:\n\t\t\t\t\tthis.schedulingLog.lastSequenceNumber -\n\t\t\t\t\tthis.schedulingLog.firstSequenceNumber +\n\t\t\t\t\t1,\n\t\t\t\tbatchesProcessed: this.schedulingLog.numberOfBatchesProcessed,\n\t\t\t\tduration: formatTick(currentTime - this.schedulingLog.startTime),\n\t\t\t\tschedulingCount: this.schedulingCount,\n\t\t\t});\n\n\t\t\tthis.schedulingLog = undefined;\n\t\t}\n\n\t\t// If we scheduled this batch of the inbound queue, increment the counter that tracks the\n\t\t// number of times we have done this.\n\t\tthis.schedulingCount++;\n\n\t\t// Reset the processing times.\n\t\tthis.processingStartTime = undefined;\n\t\tthis.currentAllowedProcessingTimeForTurn = DeltaScheduler.processingTime;\n\t}\n\n\t/**\n\t * This function tells whether we should run the scheduler.\n\t */\n\tprivate shouldRunScheduler(): boolean {\n\t\t// If there are still ops in the queue after the one we are processing now, we should\n\t\t// run the scheduler.\n\t\treturn this.deltaManager.inbound.length > 0;\n\t}\n}\n"]}
@@ -106,14 +106,17 @@ export declare class GarbageCollector implements IGarbageCollector {
106
106
  private runGC;
107
107
  /**
108
108
  * Runs the GC Mark phase. It does the following:
109
+ *
109
110
  * 1. Marks all referenced nodes in this run by clearing tracking for them.
111
+ *
110
112
  * 2. Marks unreferenced nodes in this run by starting tracking for them.
113
+ *
111
114
  * 3. Calls the runtime to update nodes that were marked referenced.
112
115
  *
113
116
  * @param gcResult - The result of the GC run on the gcData.
114
117
  * @param allReferencedNodeIds - Nodes referenced in this GC run + referenced between previous and current GC run.
115
118
  * @param currentReferenceTimestampMs - The timestamp to be used for unreferenced nodes' timestamp.
116
- * @returns - A list of sweep ready nodes, i.e., nodes that ready to be deleted.
119
+ * @returns A list of sweep ready nodes, i.e., nodes that ready to be deleted.
117
120
  */
118
121
  private runMarkPhase;
119
122
  /**
@@ -125,7 +128,7 @@ export declare class GarbageCollector implements IGarbageCollector {
125
128
  * @param sweepReadyNodes - List of nodes that are sweep ready.
126
129
  * @param currentReferenceTimestampMs - The timestamp to be used for unreferenced nodes' timestamp.
127
130
  * @param logger - The logger to be used to log any telemetry.
128
- * @returns - A list of nodes that have been deleted.
131
+ * @returns A list of nodes that have been deleted.
129
132
  */
130
133
  private runSweepPhase;
131
134
  /**
@@ -141,7 +144,7 @@ export declare class GarbageCollector implements IGarbageCollector {
141
144
  * This function identifies nodes that were referenced since the last run.
142
145
  * If these nodes are currently unreferenced, they will be assigned new unreferenced state by the current run.
143
146
  *
144
- * @returns - a list of all nodes referenced from the last local summary until now.
147
+ * @returns A list of all nodes referenced from the last local summary until now.
145
148
  */
146
149
  private findAllNodesReferencedBetweenGCs;
147
150
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"garbageCollection.d.ts","sourceRoot":"","sources":["../../src/gc/garbageCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAY,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAGN,6BAA6B,EAC7B,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAIN,mBAAmB,EAGnB,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD,OAAO,EAEN,iBAAiB,EACjB,6BAA6B,EAG7B,QAAQ,EAER,WAAW,EAEX,MAAM,iBAAiB,CAAC;AAQzB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,gBAAiB,YAAW,iBAAiB;WAC3C,MAAM,CAAC,YAAY,EAAE,6BAA6B,GAAG,iBAAiB;IAIpF,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAoB;IAEvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IAEnD,IAAW,WAAW,IAAI,OAAO,CAEhC;IAGD,OAAO,CAAC,iBAAiB,CAAqC;IAG9D,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAoC;IAE9E,OAAO,CAAC,UAAU,CAAgB;IAElC,OAAO,CAAC,YAAY,CAA0B;IAG9C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAsD;IAExF,OAAO,CAAC,QAAQ,CAAC,kCAAkC,CAAgB;IAEnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyC;IAExE,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAoD;IAE3F,OAAO,CAAC,kBAAkB,CAAoB;IAG9C,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IACpD,OAAO,CAAC,QAAQ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