@fluidframework/container-runtime 2.33.0-333010 → 2.33.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 (180) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-report/container-runtime.legacy.alpha.api.md +71 -67
  3. package/container-runtime.test-files.tar +0 -0
  4. package/dist/blobManager/blobManager.d.ts +7 -4
  5. package/dist/blobManager/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager/blobManager.js +38 -12
  7. package/dist/blobManager/blobManager.js.map +1 -1
  8. package/dist/channelCollection.d.ts +4 -0
  9. package/dist/channelCollection.d.ts.map +1 -1
  10. package/dist/channelCollection.js +24 -0
  11. package/dist/channelCollection.js.map +1 -1
  12. package/dist/compatUtils.d.ts +74 -0
  13. package/dist/compatUtils.d.ts.map +1 -0
  14. package/dist/compatUtils.js +151 -0
  15. package/dist/compatUtils.js.map +1 -0
  16. package/dist/compressionDefinitions.d.ts +39 -0
  17. package/dist/compressionDefinitions.d.ts.map +1 -0
  18. package/dist/compressionDefinitions.js +30 -0
  19. package/dist/compressionDefinitions.js.map +1 -0
  20. package/dist/containerRuntime.d.ts +78 -52
  21. package/dist/containerRuntime.d.ts.map +1 -1
  22. package/dist/containerRuntime.js +141 -54
  23. package/dist/containerRuntime.js.map +1 -1
  24. package/dist/dataStoreContext.d.ts +3 -0
  25. package/dist/dataStoreContext.d.ts.map +1 -1
  26. package/dist/dataStoreContext.js +122 -66
  27. package/dist/dataStoreContext.js.map +1 -1
  28. package/dist/deltaManagerProxies.d.ts +55 -12
  29. package/dist/deltaManagerProxies.d.ts.map +1 -1
  30. package/dist/deltaManagerProxies.js +63 -55
  31. package/dist/deltaManagerProxies.js.map +1 -1
  32. package/dist/gc/gcDefinitions.d.ts +2 -0
  33. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  34. package/dist/gc/gcDefinitions.js.map +1 -1
  35. package/dist/index.d.ts +4 -2
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +3 -2
  38. package/dist/index.js.map +1 -1
  39. package/dist/legacy.d.ts +1 -0
  40. package/dist/opLifecycle/batchManager.d.ts +1 -1
  41. package/dist/opLifecycle/batchManager.d.ts.map +1 -1
  42. package/dist/opLifecycle/batchManager.js +4 -1
  43. package/dist/opLifecycle/batchManager.js.map +1 -1
  44. package/dist/opLifecycle/definitions.d.ts +35 -4
  45. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  46. package/dist/opLifecycle/definitions.js.map +1 -1
  47. package/dist/opLifecycle/index.d.ts +1 -1
  48. package/dist/opLifecycle/index.d.ts.map +1 -1
  49. package/dist/opLifecycle/index.js.map +1 -1
  50. package/dist/opLifecycle/opCompressor.js +2 -2
  51. package/dist/opLifecycle/opCompressor.js.map +1 -1
  52. package/dist/opLifecycle/opDecompressor.js +3 -3
  53. package/dist/opLifecycle/opDecompressor.js.map +1 -1
  54. package/dist/opLifecycle/opGroupingManager.d.ts +2 -2
  55. package/dist/opLifecycle/opGroupingManager.d.ts.map +1 -1
  56. package/dist/opLifecycle/opGroupingManager.js +1 -2
  57. package/dist/opLifecycle/opGroupingManager.js.map +1 -1
  58. package/dist/opLifecycle/opSerialization.d.ts +3 -1
  59. package/dist/opLifecycle/opSerialization.d.ts.map +1 -1
  60. package/dist/opLifecycle/opSerialization.js +4 -2
  61. package/dist/opLifecycle/opSerialization.js.map +1 -1
  62. package/dist/opLifecycle/outbox.d.ts +6 -3
  63. package/dist/opLifecycle/outbox.d.ts.map +1 -1
  64. package/dist/opLifecycle/outbox.js +46 -20
  65. package/dist/opLifecycle/outbox.js.map +1 -1
  66. package/dist/packageVersion.d.ts +1 -1
  67. package/dist/packageVersion.d.ts.map +1 -1
  68. package/dist/packageVersion.js +1 -1
  69. package/dist/packageVersion.js.map +1 -1
  70. package/dist/pendingStateManager.d.ts +36 -7
  71. package/dist/pendingStateManager.d.ts.map +1 -1
  72. package/dist/pendingStateManager.js +83 -16
  73. package/dist/pendingStateManager.js.map +1 -1
  74. package/dist/runtimeLayerCompatState.d.ts.map +1 -1
  75. package/dist/runtimeLayerCompatState.js +1 -1
  76. package/dist/runtimeLayerCompatState.js.map +1 -1
  77. package/dist/summary/documentSchema.d.ts +1 -0
  78. package/dist/summary/documentSchema.d.ts.map +1 -1
  79. package/dist/summary/documentSchema.js +2 -0
  80. package/dist/summary/documentSchema.js.map +1 -1
  81. package/lib/blobManager/blobManager.d.ts +7 -4
  82. package/lib/blobManager/blobManager.d.ts.map +1 -1
  83. package/lib/blobManager/blobManager.js +38 -12
  84. package/lib/blobManager/blobManager.js.map +1 -1
  85. package/lib/channelCollection.d.ts +4 -0
  86. package/lib/channelCollection.d.ts.map +1 -1
  87. package/lib/channelCollection.js +24 -0
  88. package/lib/channelCollection.js.map +1 -1
  89. package/lib/compatUtils.d.ts +74 -0
  90. package/lib/compatUtils.d.ts.map +1 -0
  91. package/lib/compatUtils.js +142 -0
  92. package/lib/compatUtils.js.map +1 -0
  93. package/lib/compressionDefinitions.d.ts +39 -0
  94. package/lib/compressionDefinitions.d.ts.map +1 -0
  95. package/lib/compressionDefinitions.js +27 -0
  96. package/lib/compressionDefinitions.js.map +1 -0
  97. package/lib/containerRuntime.d.ts +78 -52
  98. package/lib/containerRuntime.d.ts.map +1 -1
  99. package/lib/containerRuntime.js +143 -56
  100. package/lib/containerRuntime.js.map +1 -1
  101. package/lib/dataStoreContext.d.ts +3 -0
  102. package/lib/dataStoreContext.d.ts.map +1 -1
  103. package/lib/dataStoreContext.js +57 -1
  104. package/lib/dataStoreContext.js.map +1 -1
  105. package/lib/deltaManagerProxies.d.ts +55 -12
  106. package/lib/deltaManagerProxies.d.ts.map +1 -1
  107. package/lib/deltaManagerProxies.js +63 -55
  108. package/lib/deltaManagerProxies.js.map +1 -1
  109. package/lib/gc/gcDefinitions.d.ts +2 -0
  110. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  111. package/lib/gc/gcDefinitions.js.map +1 -1
  112. package/lib/index.d.ts +4 -2
  113. package/lib/index.d.ts.map +1 -1
  114. package/lib/index.js +2 -1
  115. package/lib/index.js.map +1 -1
  116. package/lib/legacy.d.ts +1 -0
  117. package/lib/opLifecycle/batchManager.d.ts +1 -1
  118. package/lib/opLifecycle/batchManager.d.ts.map +1 -1
  119. package/lib/opLifecycle/batchManager.js +4 -1
  120. package/lib/opLifecycle/batchManager.js.map +1 -1
  121. package/lib/opLifecycle/definitions.d.ts +35 -4
  122. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  123. package/lib/opLifecycle/definitions.js.map +1 -1
  124. package/lib/opLifecycle/index.d.ts +1 -1
  125. package/lib/opLifecycle/index.d.ts.map +1 -1
  126. package/lib/opLifecycle/index.js.map +1 -1
  127. package/lib/opLifecycle/opCompressor.js +1 -1
  128. package/lib/opLifecycle/opCompressor.js.map +1 -1
  129. package/lib/opLifecycle/opDecompressor.js +1 -1
  130. package/lib/opLifecycle/opDecompressor.js.map +1 -1
  131. package/lib/opLifecycle/opGroupingManager.d.ts +2 -2
  132. package/lib/opLifecycle/opGroupingManager.d.ts.map +1 -1
  133. package/lib/opLifecycle/opGroupingManager.js +1 -2
  134. package/lib/opLifecycle/opGroupingManager.js.map +1 -1
  135. package/lib/opLifecycle/opSerialization.d.ts +3 -1
  136. package/lib/opLifecycle/opSerialization.d.ts.map +1 -1
  137. package/lib/opLifecycle/opSerialization.js +4 -2
  138. package/lib/opLifecycle/opSerialization.js.map +1 -1
  139. package/lib/opLifecycle/outbox.d.ts +6 -3
  140. package/lib/opLifecycle/outbox.d.ts.map +1 -1
  141. package/lib/opLifecycle/outbox.js +46 -20
  142. package/lib/opLifecycle/outbox.js.map +1 -1
  143. package/lib/packageVersion.d.ts +1 -1
  144. package/lib/packageVersion.d.ts.map +1 -1
  145. package/lib/packageVersion.js +1 -1
  146. package/lib/packageVersion.js.map +1 -1
  147. package/lib/pendingStateManager.d.ts +36 -7
  148. package/lib/pendingStateManager.d.ts.map +1 -1
  149. package/lib/pendingStateManager.js +84 -17
  150. package/lib/pendingStateManager.js.map +1 -1
  151. package/lib/runtimeLayerCompatState.d.ts.map +1 -1
  152. package/lib/runtimeLayerCompatState.js +2 -2
  153. package/lib/runtimeLayerCompatState.js.map +1 -1
  154. package/lib/summary/documentSchema.d.ts +1 -0
  155. package/lib/summary/documentSchema.d.ts.map +1 -1
  156. package/lib/summary/documentSchema.js +2 -0
  157. package/lib/summary/documentSchema.js.map +1 -1
  158. package/lib/tsdoc-metadata.json +1 -1
  159. package/package.json +21 -20
  160. package/src/blobManager/blobManager.ts +48 -15
  161. package/src/channelCollection.ts +27 -0
  162. package/src/compatUtils.ts +211 -0
  163. package/src/compressionDefinitions.ts +47 -0
  164. package/src/containerRuntime.ts +259 -108
  165. package/src/dataStoreContext.ts +82 -2
  166. package/src/deltaManagerProxies.ts +132 -70
  167. package/src/gc/gcDefinitions.ts +2 -0
  168. package/src/index.ts +5 -3
  169. package/src/opLifecycle/batchManager.ts +5 -4
  170. package/src/opLifecycle/definitions.ts +34 -4
  171. package/src/opLifecycle/index.ts +1 -0
  172. package/src/opLifecycle/opCompressor.ts +1 -1
  173. package/src/opLifecycle/opDecompressor.ts +1 -1
  174. package/src/opLifecycle/opGroupingManager.ts +7 -5
  175. package/src/opLifecycle/opSerialization.ts +6 -2
  176. package/src/opLifecycle/outbox.ts +65 -30
  177. package/src/packageVersion.ts +1 -1
  178. package/src/pendingStateManager.ts +135 -21
  179. package/src/runtimeLayerCompatState.ts +5 -2
  180. package/src/summary/documentSchema.ts +3 -0
@@ -62,48 +62,52 @@ class BaseDeltaManagerProxy extends client_utils_1.TypedEventEmitter {
62
62
  get readOnlyInfo() {
63
63
  return this.deltaManager.readOnlyInfo;
64
64
  }
65
- constructor(deltaManager) {
65
+ constructor(deltaManager, overrides) {
66
66
  super();
67
67
  this.deltaManager = deltaManager;
68
- this.onPrepareSend = (messageBuffer) => {
69
- this.emit("prepareSend", messageBuffer);
70
- };
71
- this.onSubmitOp = (message) => {
72
- this.emit("submitOp", message);
73
- };
74
- this.onOp = (message, processingTime) => {
75
- this.emit("op", message, processingTime);
76
- };
77
- this.onPong = (latency) => {
78
- this.emit("pong", latency);
79
- };
80
- this.onConnect = (details, opsBehind) => {
81
- this.emit("connect", details, opsBehind);
82
- };
83
- this.onDisconnect = (reason, error) => {
84
- this.emit("disconnect", reason, error);
85
- };
86
- this.onReadonly = (readonly, readonlyConnectionReason) => {
87
- this.emit("readonly", readonly, readonlyConnectionReason);
68
+ this.eventHandlers = {
69
+ onPrepareSend: (messageBuffer) => {
70
+ this.emit("prepareSend", messageBuffer);
71
+ },
72
+ onSubmitOp: (message) => {
73
+ this.emit("submitOp", message);
74
+ },
75
+ onOp: (message, processingTime) => {
76
+ this.emit("op", message, processingTime);
77
+ },
78
+ onPong: (latency) => {
79
+ this.emit("pong", latency);
80
+ },
81
+ onConnect: (details, opsBehind) => {
82
+ this.emit("connect", details, opsBehind);
83
+ },
84
+ onDisconnect: (reason, error) => {
85
+ this.emit("disconnect", reason, error);
86
+ },
87
+ onReadonly: (readonly, readonlyConnectionReason) => {
88
+ this.emit("readonly", readonly, readonlyConnectionReason);
89
+ },
90
+ ...overrides,
88
91
  };
89
92
  // We are expecting this class to have many listeners, so we suppress noisy "MaxListenersExceededWarning" logging.
90
93
  super.setMaxListeners(0);
91
- this.deltaManager.on("prepareSend", this.onPrepareSend);
92
- this.deltaManager.on("submitOp", this.onSubmitOp);
93
- this.deltaManager.on("op", this.onOp);
94
- this.deltaManager.on("pong", this.onPong);
95
- this.deltaManager.on("connect", this.onConnect);
96
- this.deltaManager.on("disconnect", this.onDisconnect);
97
- this.deltaManager.on("readonly", this.onReadonly);
94
+ this.deltaManager.on("prepareSend", this.eventHandlers.onPrepareSend);
95
+ this.deltaManager.on("submitOp", this.eventHandlers.onSubmitOp);
96
+ this.deltaManager.on("op", this.eventHandlers.onOp);
97
+ this.deltaManager.on("pong", this.eventHandlers.onPong);
98
+ this.deltaManager.on("connect", this.eventHandlers.onConnect);
99
+ this.deltaManager.on("disconnect", this.eventHandlers.onDisconnect);
100
+ this.deltaManager.on("readonly", this.eventHandlers.onReadonly);
98
101
  }
99
102
  dispose() {
100
- this.deltaManager.off("prepareSend", this.onPrepareSend);
101
- this.deltaManager.off("submitOp", this.onSubmitOp);
102
- this.deltaManager.off("op", this.onOp);
103
- this.deltaManager.off("pong", this.onPong);
104
- this.deltaManager.off("connect", this.onConnect);
105
- this.deltaManager.off("disconnect", this.onDisconnect);
106
- this.deltaManager.off("readonly", this.onReadonly);
103
+ this.deltaManager.off("prepareSend", this.eventHandlers.onPrepareSend);
104
+ this.deltaManager.off("submitOp", this.eventHandlers.onSubmitOp);
105
+ this.deltaManager.off("op", this.eventHandlers.onOp);
106
+ this.deltaManager.off("pong", this.eventHandlers.onPong);
107
+ this.deltaManager.off("connect", this.eventHandlers.onConnect);
108
+ this.deltaManager.off("disconnect", this.eventHandlers.onDisconnect);
109
+ this.deltaManager.off("readonly", this.eventHandlers.onReadonly);
110
+ this.removeAllListeners();
107
111
  }
108
112
  submitSignal(content, targetClientId) {
109
113
  return this.deltaManager.submitSignal(content, targetClientId);
@@ -119,28 +123,31 @@ exports.BaseDeltaManagerProxy = BaseDeltaManagerProxy;
119
123
  * - Summarizer client should not be active to layers below the container runtime to restrict local changes.
120
124
  */
121
125
  class DeltaManagerSummarizerProxy extends BaseDeltaManagerProxy {
126
+ static wrapIfSummarizer(deltaManager) {
127
+ if (deltaManager.clientDetails.type === index_js_1.summarizerClientType) {
128
+ return new DeltaManagerSummarizerProxy(deltaManager);
129
+ }
130
+ return deltaManager;
131
+ }
132
+ // eslint-disable-next-line @typescript-eslint/class-literal-property-style
122
133
  get active() {
123
134
  // Summarize clients should not be active. There shouldn't be any local changes (writes) in the summarizer
124
135
  // except for the SummarizeOp which is generated by the runtime.
125
- return !this.isSummarizerClient && this.deltaManager.active;
136
+ return false;
126
137
  }
127
138
  get readOnlyInfo() {
128
139
  // Summarizer clients should be read-only as far as the runtime and layers below are concerned. There shouldn't
129
140
  // be any local changes (writes) in the summarizer except for the summarize op which is generated by the runtime.
130
- if (this.isSummarizerClient) {
131
- return {
132
- readonly: true,
133
- forced: false,
134
- permissions: undefined,
135
- storageOnly: false,
136
- };
137
- }
138
- return this.deltaManager.readOnlyInfo;
141
+ return {
142
+ readonly: true,
143
+ forced: false,
144
+ permissions: undefined,
145
+ storageOnly: false,
146
+ };
139
147
  }
140
148
  constructor(deltaManager) {
141
- super(deltaManager);
149
+ super(deltaManager, { onReadonly: () => { } });
142
150
  this.deltaManager = deltaManager;
143
- this.isSummarizerClient = this.deltaManager.clientDetails.type === index_js_1.summarizerClientType;
144
151
  }
145
152
  }
146
153
  exports.DeltaManagerSummarizerProxy = DeltaManagerSummarizerProxy;
@@ -174,16 +181,17 @@ class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {
174
181
  };
175
182
  }
176
183
  constructor(deltaManager, pendingStateManager) {
177
- super(deltaManager);
184
+ super(deltaManager, {
185
+ onOp: (message, processingTime) => {
186
+ const messageIntercept = {
187
+ ...message,
188
+ minimumSequenceNumber: this.minimumSequenceNumber,
189
+ };
190
+ this.emit("op", messageIntercept, processingTime);
191
+ },
192
+ });
178
193
  this.deltaManager = deltaManager;
179
194
  this.pendingStateManager = pendingStateManager;
180
- this.onOp = (message, processingTime) => {
181
- const messageIntercept = {
182
- ...message,
183
- minimumSequenceNumber: this.minimumSequenceNumber,
184
- };
185
- this.emit("op", messageIntercept, processingTime);
186
- };
187
195
  }
188
196
  }
189
197
  exports.DeltaManagerPendingOpsProxy = DeltaManagerPendingOpsProxy;
@@ -1 +1 @@
1
- {"version":3,"file":"deltaManagerProxies.js","sourceRoot":"","sources":["../src/deltaManagerProxies.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAoBjE,iDAA0D;AAE1D;;;;;GAKG;AACH,MAAsB,qBACrB,SAAQ,gCAAsC;IAG9C,IAAW,YAAY;QACtB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAW,OAAO;QAC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AAI,CAAC,YAAY,CAAC,WAAW;YAChC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;SACjD,CAAC;IACH,CAAC;IAaD,YACoB,YAA+B,EACjC,mBAGhB;QAED,KAAK,CAAC,YAAY,CAAC,CAAC;QAND,iBAAY,GAAZ,YAAY,CAAmB;QACjC,wBAAmB,GAAnB,mBAAmB,CAGnC;QAhBiB,SAAI,GAAG,CACzB,OAAkC,EAClC,cAAsB,EACf,EAAE;YACT,MAAM,gBAAgB,GAAG;gBACxB,GAAG,OAAO;gBACV,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;aACjD,CAAC;YACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;QACnD,CAAC,CAAC;IAUF,CAAC;CACD;AArDD,kEAqDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tIConnectionDetails,\n\tIDeltaManagerEvents,\n\tIDeltaManagerFull,\n\tIDeltaQueue,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type { IAnyDriverError } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIClientConfiguration,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { PendingStateManager } from \"./pendingStateManager.js\";\nimport { summarizerClientType } from \"./summary/index.js\";\n\n/**\n * Base class for DeltaManager proxy that proxy's access to the real DeltaManager.\n *\n * This class allows us to build proxy functionality without actually having to implement all the methods\n * of the DeltaManager.\n */\nexport abstract class BaseDeltaManagerProxy\n\textends TypedEventEmitter<IDeltaManagerEvents>\n\timplements IDeltaManagerFull\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(): ISequencedDocumentMessage | undefined {\n\t\treturn this.deltaManager.lastMessage;\n\t}\n\n\tpublic get lastKnownSeqNumber(): number {\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(): boolean {\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(protected readonly deltaManager: IDeltaManagerFull) {\n\t\tsuper();\n\n\t\t// We are expecting this class to have many listeners, so we suppress noisy \"MaxListenersExceededWarning\" logging.\n\t\tsuper.setMaxListeners(0);\n\n\t\tthis.deltaManager.on(\"prepareSend\", this.onPrepareSend);\n\t\tthis.deltaManager.on(\"submitOp\", this.onSubmitOp);\n\t\tthis.deltaManager.on(\"op\", this.onOp);\n\t\tthis.deltaManager.on(\"pong\", this.onPong);\n\t\tthis.deltaManager.on(\"connect\", this.onConnect);\n\t\tthis.deltaManager.on(\"disconnect\", this.onDisconnect);\n\t\tthis.deltaManager.on(\"readonly\", this.onReadonly);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.deltaManager.off(\"prepareSend\", this.onPrepareSend);\n\t\tthis.deltaManager.off(\"submitOp\", this.onSubmitOp);\n\t\tthis.deltaManager.off(\"op\", this.onOp);\n\t\tthis.deltaManager.off(\"pong\", this.onPong);\n\t\tthis.deltaManager.off(\"connect\", this.onConnect);\n\t\tthis.deltaManager.off(\"disconnect\", this.onDisconnect);\n\t\tthis.deltaManager.off(\"readonly\", this.onReadonly);\n\t}\n\n\tpublic submitSignal(content: string, targetClientId?: string): void {\n\t\treturn this.deltaManager.submitSignal(content, targetClientId);\n\t}\n\n\tpublic flush(): void {\n\t\treturn this.deltaManager.flush();\n\t}\n\n\tprivate readonly onPrepareSend = (messageBuffer: unknown[]): void => {\n\t\tthis.emit(\"prepareSend\", messageBuffer);\n\t};\n\tprivate readonly onSubmitOp = (message: IDocumentMessage): void => {\n\t\tthis.emit(\"submitOp\", message);\n\t};\n\tprotected readonly onOp = (\n\t\tmessage: ISequencedDocumentMessage,\n\t\tprocessingTime: number,\n\t): void => {\n\t\tthis.emit(\"op\", message, processingTime);\n\t};\n\tprivate readonly onPong = (latency: number): void => {\n\t\tthis.emit(\"pong\", latency);\n\t};\n\tprivate readonly onConnect = (details: IConnectionDetails, opsBehind?: number): void => {\n\t\tthis.emit(\"connect\", details, opsBehind);\n\t};\n\tprivate readonly onDisconnect = (reason: string, error?: IAnyDriverError): void => {\n\t\tthis.emit(\"disconnect\", reason, error);\n\t};\n\tprivate readonly onReadonly = (\n\t\treadonly: boolean,\n\t\treadonlyConnectionReason?: { reason: string; error?: IErrorBase },\n\t): void => {\n\t\tthis.emit(\"readonly\", readonly, readonlyConnectionReason);\n\t};\n}\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 extends BaseDeltaManagerProxy {\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(protected readonly deltaManager: IDeltaManagerFull) {\n\t\tsuper(deltaManager);\n\t\tthis.isSummarizerClient = this.deltaManager.clientDetails.type === summarizerClientType;\n\t}\n}\n\nexport class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {\n\tpublic get minimumSequenceNumber(): number {\n\t\tconst minPendingSeqNum = this.pendingStateManager.minimumPendingMessageSequenceNumber;\n\t\t/**\n\t\t * The reason why the minimum pending sequence number can be less than the delta manager's minimum sequence\n\t\t * number (DM's msn) is that when we are processing messages in the container runtime/delta manager, the delta\n\t\t * manager's msn can be updated to continually increase. In the meantime, the pending state manager's op which\n\t\t * hasn't been sent can still have a lower sequence number than the DM's msn (think about a disconnected\n\t\t * scenario). To successfully resubmit that pending op it has to be rebased first by the DDS. The DDS still\n\t\t * needs to keep the local data for that op that has a reference sequence number lower than the DM's msn. To\n\t\t * achieve this, the msn passed to the DDS needs to be the minimum of the DM's msn and the minimum pending\n\t\t * sequence number, so that it can keep the relevant local data to generate the right data for the new op\n\t\t * during resubmission.\n\t\t */\n\t\tif (\n\t\t\tminPendingSeqNum !== undefined &&\n\t\t\tminPendingSeqNum < this.deltaManager.minimumSequenceNumber\n\t\t) {\n\t\t\treturn minPendingSeqNum;\n\t\t}\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastMessage(): ISequencedDocumentMessage | undefined {\n\t\tif (this.deltaManager.lastMessage === undefined) {\n\t\t\treturn this.deltaManager.lastMessage;\n\t\t}\n\t\treturn {\n\t\t\t...this.deltaManager.lastMessage,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t}\n\n\tprotected readonly onOp = (\n\t\tmessage: ISequencedDocumentMessage,\n\t\tprocessingTime: number,\n\t): void => {\n\t\tconst messageIntercept = {\n\t\t\t...message,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t\tthis.emit(\"op\", messageIntercept, processingTime);\n\t};\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly pendingStateManager: Pick<\n\t\t\tPendingStateManager,\n\t\t\t\"minimumPendingMessageSequenceNumber\"\n\t\t>,\n\t) {\n\t\tsuper(deltaManager);\n\t}\n}\n"]}
1
+ {"version":3,"file":"deltaManagerProxies.js","sourceRoot":"","sources":["../src/deltaManagerProxies.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,+DAAiE;AAoBjE,iDAA0D;AAyD1D;;;;;GAKG;AACH,MAAa,qBACZ,SAAQ,gCAAsC;IAG9C,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,CAA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QACrB,IAAI,IAAI,CAAC,YAAY,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACjD,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC;QACtC,CAAC;QACD,OAAO;YACN,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW;YAChC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;SACjD,CAAC;IACH,CAAC;IAED,YACoB,YAA+B,EACjC,mBAGhB;QAED,KAAK,CAAC,YAAY,EAAE;YACnB,IAAI,EAAE,CAAC,OAAkC,EAAE,cAAsB,EAAQ,EAAE;gBAC1E,MAAM,gBAAgB,GAAG;oBACxB,GAAG,OAAO;oBACV,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;iBACjD,CAAC;gBACF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;YACnD,CAAC;SACD,CAAC,CAAC;QAdgB,iBAAY,GAAZ,YAAY,CAAmB;QACjC,wBAAmB,GAAnB,mBAAmB,CAGnC;IAWF,CAAC;CACD;AAlDD,kEAkDC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { TypedEventEmitter } from \"@fluid-internal/client-utils\";\nimport type {\n\tIConnectionDetails,\n\tIDeltaManagerEvents,\n\tIDeltaManagerFull,\n\tIDeltaQueue,\n\tIDeltaSender,\n\tReadOnlyInfo,\n} from \"@fluidframework/container-definitions/internal\";\nimport type { IErrorBase } from \"@fluidframework/core-interfaces\";\nimport { IClientDetails } from \"@fluidframework/driver-definitions\";\nimport type { IAnyDriverError } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tIClientConfiguration,\n\tIDocumentMessage,\n\tISequencedDocumentMessage,\n\tISignalMessage,\n} from \"@fluidframework/driver-definitions/internal\";\n\nimport type { PendingStateManager } from \"./pendingStateManager.js\";\nimport { summarizerClientType } from \"./summary/index.js\";\n\n/**\n * Interface defining event handlers for the BaseDeltaManagerProxy.\n * These handlers allow customization of behavior for various DeltaManager events.\n */\nexport interface BaseDeltaManagerProxyEventHandlers {\n\t/**\n\t * Event handler triggered when the readonly state changes.\n\t * @param readonly - Indicates if the connection is readonly.\n\t * @param readonlyConnectionReason - Optional reason and error details for the readonly state.\n\t */\n\tonReadonly: (\n\t\treadonly: boolean,\n\t\treadonlyConnectionReason?: { reason: string; error?: IErrorBase },\n\t) => void;\n\n\t/**\n\t * Event handler triggered before sending a message.\n\t * @param messageBuffer - The buffer of messages to be sent.\n\t */\n\tonPrepareSend: (messageBuffer: unknown[]) => void;\n\n\t/**\n\t * Event handler triggered when an operation is submitted.\n\t * @param message - The document message being submitted.\n\t */\n\tonSubmitOp: (message: IDocumentMessage) => void;\n\n\t/**\n\t * Event handler triggered when an operation is received.\n\t * @param message - The sequenced document message received.\n\t * @param processingTime - The time taken to process the message.\n\t */\n\tonOp: (message: ISequencedDocumentMessage, processingTime: number) => void;\n\n\t/**\n\t * Event handler triggered when a pong response is received.\n\t * @param latency - The latency of the pong response.\n\t */\n\tonPong: (latency: number) => void;\n\n\t/**\n\t * Event handler triggered when a connection is established.\n\t * @param details - The connection details.\n\t * @param opsBehind - Optional number of operations behind the latest state.\n\t */\n\tonConnect: (details: IConnectionDetails, opsBehind?: number) => void;\n\n\t/**\n\t * Event handler triggered when a disconnection occurs.\n\t * @param reason - The reason for the disconnection.\n\t * @param error - Optional error details for the disconnection.\n\t */\n\tonDisconnect: (reason: string, error?: IAnyDriverError) => void;\n}\n\n/**\n * Base class for DeltaManager proxy that proxy's access to the real DeltaManager.\n *\n * This class allows us to build proxy functionality without actually having to implement all the methods\n * of the DeltaManager.\n */\nexport class BaseDeltaManagerProxy\n\textends TypedEventEmitter<IDeltaManagerEvents>\n\timplements IDeltaManagerFull\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(): ISequencedDocumentMessage | undefined {\n\t\treturn this.deltaManager.lastMessage;\n\t}\n\n\tpublic get lastKnownSeqNumber(): number {\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(): boolean {\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\tprivate readonly eventHandlers: BaseDeltaManagerProxyEventHandlers;\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManagerFull,\n\t\toverrides?: Partial<BaseDeltaManagerProxyEventHandlers>,\n\t) {\n\t\tsuper();\n\n\t\tthis.eventHandlers = {\n\t\t\tonPrepareSend: (messageBuffer: unknown[]): void => {\n\t\t\t\tthis.emit(\"prepareSend\", messageBuffer);\n\t\t\t},\n\t\t\tonSubmitOp: (message: IDocumentMessage): void => {\n\t\t\t\tthis.emit(\"submitOp\", message);\n\t\t\t},\n\t\t\tonOp: (message: ISequencedDocumentMessage, processingTime: number): void => {\n\t\t\t\tthis.emit(\"op\", message, processingTime);\n\t\t\t},\n\t\t\tonPong: (latency: number): void => {\n\t\t\t\tthis.emit(\"pong\", latency);\n\t\t\t},\n\t\t\tonConnect: (details: IConnectionDetails, opsBehind?: number): void => {\n\t\t\t\tthis.emit(\"connect\", details, opsBehind);\n\t\t\t},\n\t\t\tonDisconnect: (reason: string, error?: IAnyDriverError): void => {\n\t\t\t\tthis.emit(\"disconnect\", reason, error);\n\t\t\t},\n\t\t\tonReadonly: (\n\t\t\t\treadonly: boolean,\n\t\t\t\treadonlyConnectionReason?: { reason: string; error?: IErrorBase },\n\t\t\t): void => {\n\t\t\t\tthis.emit(\"readonly\", readonly, readonlyConnectionReason);\n\t\t\t},\n\n\t\t\t...overrides,\n\t\t};\n\n\t\t// We are expecting this class to have many listeners, so we suppress noisy \"MaxListenersExceededWarning\" logging.\n\t\tsuper.setMaxListeners(0);\n\n\t\tthis.deltaManager.on(\"prepareSend\", this.eventHandlers.onPrepareSend);\n\t\tthis.deltaManager.on(\"submitOp\", this.eventHandlers.onSubmitOp);\n\t\tthis.deltaManager.on(\"op\", this.eventHandlers.onOp);\n\t\tthis.deltaManager.on(\"pong\", this.eventHandlers.onPong);\n\t\tthis.deltaManager.on(\"connect\", this.eventHandlers.onConnect);\n\t\tthis.deltaManager.on(\"disconnect\", this.eventHandlers.onDisconnect);\n\t\tthis.deltaManager.on(\"readonly\", this.eventHandlers.onReadonly);\n\t}\n\n\tpublic dispose(): void {\n\t\tthis.deltaManager.off(\"prepareSend\", this.eventHandlers.onPrepareSend);\n\t\tthis.deltaManager.off(\"submitOp\", this.eventHandlers.onSubmitOp);\n\t\tthis.deltaManager.off(\"op\", this.eventHandlers.onOp);\n\t\tthis.deltaManager.off(\"pong\", this.eventHandlers.onPong);\n\t\tthis.deltaManager.off(\"connect\", this.eventHandlers.onConnect);\n\t\tthis.deltaManager.off(\"disconnect\", this.eventHandlers.onDisconnect);\n\t\tthis.deltaManager.off(\"readonly\", this.eventHandlers.onReadonly);\n\t\tthis.removeAllListeners();\n\t}\n\n\tpublic submitSignal(content: string, targetClientId?: string): void {\n\t\treturn this.deltaManager.submitSignal(content, targetClientId);\n\t}\n\n\tpublic flush(): void {\n\t\treturn this.deltaManager.flush();\n\t}\n}\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 extends BaseDeltaManagerProxy {\n\tpublic static wrapIfSummarizer(deltaManager: IDeltaManagerFull): IDeltaManagerFull {\n\t\tif (deltaManager.clientDetails.type === summarizerClientType) {\n\t\t\treturn new DeltaManagerSummarizerProxy(deltaManager);\n\t\t}\n\t\treturn deltaManager;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/class-literal-property-style\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 false;\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\n\t\treturn {\n\t\t\treadonly: true,\n\t\t\tforced: false,\n\t\t\tpermissions: undefined,\n\t\t\tstorageOnly: false,\n\t\t};\n\t}\n\n\tconstructor(protected readonly deltaManager: IDeltaManagerFull) {\n\t\tsuper(deltaManager, { onReadonly: () => {} });\n\t}\n}\n\nexport class DeltaManagerPendingOpsProxy extends BaseDeltaManagerProxy {\n\tpublic get minimumSequenceNumber(): number {\n\t\tconst minPendingSeqNum = this.pendingStateManager.minimumPendingMessageSequenceNumber;\n\t\t/**\n\t\t * The reason why the minimum pending sequence number can be less than the delta manager's minimum sequence\n\t\t * number (DM's msn) is that when we are processing messages in the container runtime/delta manager, the delta\n\t\t * manager's msn can be updated to continually increase. In the meantime, the pending state manager's op which\n\t\t * hasn't been sent can still have a lower sequence number than the DM's msn (think about a disconnected\n\t\t * scenario). To successfully resubmit that pending op it has to be rebased first by the DDS. The DDS still\n\t\t * needs to keep the local data for that op that has a reference sequence number lower than the DM's msn. To\n\t\t * achieve this, the msn passed to the DDS needs to be the minimum of the DM's msn and the minimum pending\n\t\t * sequence number, so that it can keep the relevant local data to generate the right data for the new op\n\t\t * during resubmission.\n\t\t */\n\t\tif (\n\t\t\tminPendingSeqNum !== undefined &&\n\t\t\tminPendingSeqNum < this.deltaManager.minimumSequenceNumber\n\t\t) {\n\t\t\treturn minPendingSeqNum;\n\t\t}\n\t\treturn this.deltaManager.minimumSequenceNumber;\n\t}\n\n\tpublic get lastMessage(): ISequencedDocumentMessage | undefined {\n\t\tif (this.deltaManager.lastMessage === undefined) {\n\t\t\treturn this.deltaManager.lastMessage;\n\t\t}\n\t\treturn {\n\t\t\t...this.deltaManager.lastMessage,\n\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t};\n\t}\n\n\tconstructor(\n\t\tprotected readonly deltaManager: IDeltaManagerFull,\n\t\tprivate readonly pendingStateManager: Pick<\n\t\t\tPendingStateManager,\n\t\t\t\"minimumPendingMessageSequenceNumber\"\n\t\t>,\n\t) {\n\t\tsuper(deltaManager, {\n\t\t\tonOp: (message: ISequencedDocumentMessage, processingTime: number): void => {\n\t\t\t\tconst messageIntercept = {\n\t\t\t\t\t...message,\n\t\t\t\t\tminimumSequenceNumber: this.minimumSequenceNumber,\n\t\t\t\t};\n\t\t\t\tthis.emit(\"op\", messageIntercept, processingTime);\n\t\t\t},\n\t\t});\n\t}\n}\n"]}
@@ -289,6 +289,8 @@ export interface ITombstoneLoadedMessage {
289
289
  export type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;
290
290
  /**
291
291
  * Defines the APIs for the runtime object to be passed to the garbage collector.
292
+ *
293
+ * @internal
292
294
  */
293
295
  export interface IGarbageCollectionRuntime {
294
296
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"gcDefinitions.d.ts","sourceRoot":"","sources":["../../src/gc/gcDefinitions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EACN,iBAAiB,EACjB,sBAAsB,EACtB,6BAA6B,EAC7B,gBAAgB,EAChB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EACN,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACN,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,SAAa,CAAC;AAC5C;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAa,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,iBAAiB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,aAAa,uCAAuC,CAAC;AAClE;;GAEG;AACH,eAAO,MAAM,mBAAmB,6CAA6C,CAAC;AAC9E;;GAEG;AACH,eAAO,MAAM,8BAA8B,wDACW,CAAC;AACvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,iDAAiD,CAAC;AAGtF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;;GAUG;AACU,QAAA,sBAAsB,GAAG,cAAc,CAAC;AAErD;;GAEG;AACU,QAAA,aAAa,GAAG,oCAAoC,CAAC;AAClE;;GAEG;AACU,QAAA,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E;;GAEG;AACU,QAAA,8BAA8B,GAC1C,qDAAqD,CAAC;AACvD;;GAEG;AACU,QAAA,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF,2BAA2B;AACd,QAAA,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG,CAAC,GAAG,gBAAQ,CAAC;AAExC,QAAA,wBAAwB,GAAG,CAAC,GAAG,gBAAQ,CAAC,CAAC,SAAS;AAClD,QAAA,8BAA8B,GAAG,EAAE,GAAG,gBAAQ,CAAC,CAAC,UAAU;AAC1D,QAAA,yBAAyB,GAAG,CAAC,GAAG,gBAAQ,CAAC,CAAC,QAAQ;AA0K/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACzB,kCAAkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACL,CAAC;AAOX;;;GAGG;AACU,QAAA,4BAA4B,GAAG;IAC3C;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAqUX;;GAEG;AACU,QAAA,iBAAiB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\ttype ITelemetryPropertiesExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { RuntimeHeaderData } from \"../containerRuntime.js\";\nimport { ContainerRuntimeGCMessage } from \"../messageTypes.js\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary/index.js\";\n\n/**\n * @internal\n */\nexport type GCVersion = number;\n\n/**\n * The stable/default version of GC Data\n */\nexport const stableGCVersion: GCVersion = 3;\n/**\n * The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files.\n */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows configuring which documents can have Sweep enabled.\n * This provides a way to disable both Tombstone Enforcement and Sweep.\n *\n * If unset, Tombstone Enforcement + Sweep will operate as otherwise configured.\n * Otherwise, the Sweep Phase will be disabled for documents where persisted value doesn't match what is passed into this session.\n * This provides a way to disallow Sweep for old documents that may be too difficult for an app to repair,\n * in case a bug is found that violates GC's assumptions.\n *\n * @see GCFeatureMatrix (gcGeneration)\n */\nexport const gcGenerationOptionName = \"gcGeneration\";\n\n/**\n * Config key to turn GC test mode on / off.\n */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/**\n * Config key to expire a session after a set period of time. Defaults to true.\n */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/**\n * Config key to disable throwing an error when tombstone object is loaded (requested).\n */\nexport const disableThrowOnTombstoneLoadKey =\n\t\"Fluid.GarbageCollection.DisableThrowOnTombstoneLoad\";\n/**\n * Config key to enable GC version upgrade.\n */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the tombstone timeout.\n * Tombstone timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\nexport const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day\n\n/**\n * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName\n * @internal\n */\nexport type GCFeatureMatrix =\n\t| {\n\t\t\t/**\n\t\t\t * The GC Generation value in effect when this file was created.\n\t\t\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t\t\t * Provided via Container Runtime Options.\n\t\t\t */\n\t\t\tgcGeneration?: number;\n\t\t\t/**\n\t\t\t * Deprecated property from legacy type. Will not be set concurrently with gcGeneration\n\t\t\t */\n\t\t\ttombstoneGeneration?: undefined;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Tombstone Generation value in effect when this file was created.\n\t\t\t * Legacy - new containers would get gcGeneration instead (if anything)\n\t\t\t */\n\t\t\ttombstoneGeneration: number;\n\t };\n\n/**\n * Deprecated properties formerly included in @see IGCMetadata.\n * These may be found in old snapshots, so we need to support them for backwards compatibility.\n */\nexport interface IGCMetadata_Deprecated {\n\t/**\n\t * How long to wait after an object is unreferenced before deleting it via GC Sweep\n\t *\n\t * @deprecated Replaced by @see IGCMetadata.tombstoneTimeoutMs\n\t */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/**\n * GC-specific metadata to be written into the summary.\n *\n * @internal\n */\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t *\n\t * @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/**\n\t * If this is present, the session for this container will expire after this time and the container will close\n\t */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/**\n\t * How long to wait after an object is unreferenced before it becomes a Tombstone.\n\t *\n\t * After this point, there's a grace period before the object is deleted.\n\t * @see IGCRuntimeOptions.sweepGracePeriodMs\n\t *\n\t * So the full sweep timeout in a session is tombstoneTimeoutMs + sweepGracePeriodMs.\n\t */\n\treadonly tombstoneTimeoutMs?: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection mark phase run.\n * @internal\n */\nexport interface IMarkPhaseStats {\n\t/**\n\t * The number of nodes in the container.\n\t */\n\tnodeCount: number;\n\t/**\n\t * The number of data stores in the container.\n\t */\n\tdataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the container.\n\t */\n\tattachmentBlobCount: number;\n\t/**\n\t * The number of unreferenced nodes in the container.\n\t */\n\tunrefNodeCount: number;\n\t/**\n\t * The number of unreferenced data stores in the container.\n\t */\n\tunrefDataStoreCount: number;\n\t/**\n\t * The number of unreferenced attachment blobs in the container.\n\t */\n\tunrefAttachmentBlobCount: number;\n\t/**\n\t * The number of nodes whose reference state updated since last GC run.\n\t */\n\tupdatedNodeCount: number;\n\t/**\n\t * The number of data stores whose reference state updated since last GC run.\n\t */\n\tupdatedDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs whose reference state updated since last GC run.\n\t */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection sweep phase run.\n * @internal\n */\nexport interface ISweepPhaseStats {\n\t/**\n\t * The number of nodes in the lifetime of the container.\n\t */\n\tlifetimeNodeCount: number;\n\t/**\n\t * The number of data stores in the lifetime of the container.\n\t */\n\tlifetimeDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the lifetime of the container.\n\t */\n\tlifetimeAttachmentBlobCount: number;\n\t/**\n\t * The number of deleted nodes in the container.\n\t */\n\tdeletedNodeCount: number;\n\t/**\n\t * The number of deleted data stores in the container.\n\t */\n\tdeletedDataStoreCount: number;\n\t/**\n\t * The number of deleted attachment blobs in the container.\n\t */\n\tdeletedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection run.\n * @internal\n */\nexport interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}\n\n/**\n * The types of GC nodes in the GC reference graph.\n * @internal\n */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n} as const;\n\n/**\n * @internal\n */\nexport type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];\n\n/**\n * The type of a garbage collection message.\n * @internal\n */\nexport const GarbageCollectionMessageType = {\n\t/**\n\t * Message sent directing GC to delete the given nodes\n\t */\n\tSweep: \"Sweep\",\n\t/**\n\t * Message sent notifying GC that a Tombstoned object was Loaded\n\t */\n\tTombstoneLoaded: \"TombstoneLoaded\",\n} as const;\n\n/**\n * @internal\n */\nexport type GarbageCollectionMessageType =\n\t(typeof GarbageCollectionMessageType)[keyof typeof GarbageCollectionMessageType];\n\n/**\n * The garbage collection sweep message.\n * @internal\n */\nexport interface ISweepMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.Sweep\n\t */\n\ttype: typeof GarbageCollectionMessageType.Sweep;\n\t/**\n\t * The ids of nodes that are deleted.\n\t */\n\tdeletedNodeIds: string[];\n}\n\n/**\n * The GC TombstoneLoaded message.\n * @internal\n */\nexport interface ITombstoneLoadedMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.TombstoneLoaded\n\t */\n\ttype: typeof GarbageCollectionMessageType.TombstoneLoaded;\n\t/**\n\t * The id of Tombstoned node that was loaded.\n\t */\n\tnodePath: string;\n}\n\n/**\n * Type for a message to be used for sending / received garbage collection messages.\n * @internal\n */\nexport type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n */\nexport interface IGarbageCollectionRuntime {\n\t/**\n\t * Returns the garbage collection data of the runtime.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/**\n\t * After GC has run, called to notify the runtime of routes that are used in it.\n\t */\n\tupdateUsedRoutes(usedRoutes: readonly string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];\n\t/**\n\t * Called to notify the runtime of routes that are tombstones.\n\t */\n\tupdateTombstonedRoutes(tombstoneRoutes: readonly string[]): void;\n\t/**\n\t * Returns a referenced timestamp to be used to track unreferenced nodes.\n\t */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/**\n\t * Returns the type of the GC node.\n\t */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/**\n\t * Called when the runtime should close because of an error.\n\t */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n}\n\n/**\n * Defines the contract for the garbage collector.\n */\nexport interface IGarbageCollector {\n\t/**\n\t * Tells the time at which session expiry timer started in a previous container.\n\t * This is only set when loading from a stashed container and will be equal to the\n\t * original container's local client time when it was loaded (and started the session expiry timer).\n\t */\n\treadonly sessionExpiryTimerStarted: number | undefined;\n\t/**\n\t * Tells whether GC should run or not.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * The count of data stores whose GC state updated since the last summary.\n\t */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/**\n\t * Initialize the state from the base snapshot after its creation.\n\t */\n\tinitializeBaseState(): Promise<void>;\n\t/**\n\t * Run garbage collection and update the reference / used state of the system.\n\t */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/**\n\t * Summarizes the GC data and returns it as a summary tree.\n\t */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/**\n\t * Returns the garbage collector specific metadata to be written into the summary.\n\t */\n\tgetMetadata(): IGCMetadata;\n\t/**\n\t * Returns the GC details generated from the base snapshot.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/**\n\t * Called when the latest summary of the system has been refreshed.\n\t */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/**\n\t * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t */\n\tnodeUpdated(props: IGCNodeUpdatedProps): void;\n\t/**\n\t * Called when a reference is added to a node. Used to identify nodes that were referenced between summaries.\n\t */\n\taddedOutboundReference(\n\t\tfromNodePath: string,\n\t\ttoNodePath: string,\n\t\ttimestampMs: number,\n\t\tautorecovery?: true,\n\t): void;\n\t/**\n\t * Called to process garbage collection messages\n\t */\n\tprocessMessages(\n\t\tmessageContents: GarbageCollectionMessage[],\n\t\tmessageTimestampMs: number,\n\t\tlocal: boolean,\n\t): void;\n\t/**\n\t * Returns true if this node has been deleted by GC during sweep phase.\n\t */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(connected: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/**\n * Info needed by GC when notified that a node was updated (loaded or changed)\n * @internal\n */\nexport interface IGCNodeUpdatedProps {\n\t/**\n\t * Type and path of the updated node\n\t */\n\tnode: { type: (typeof GCNodeType)[\"DataStore\" | \"Blob\"]; path: string };\n\t/**\n\t * Whether the node (or a subpath) was loaded or changed.\n\t */\n\treason: \"Loaded\" | \"Changed\" | \"Realized\";\n\t/**\n\t * The op-based timestamp when the node changed. If the update is from receiving an op, this should\n\t * be the timestamp of the op. If not, this should be the timestamp of the last op processed.\n\t */\n\ttimestampMs: number | undefined;\n\t/**\n\t * The package path of the node. This may not be available if the node hasn't been loaded yet\n\t */\n\tpackagePath?: readonly string[];\n\t/**\n\t * The original request for loads to preserve it in telemetry\n\t */\n\trequest?: IRequest;\n\t/**\n\t * If the node was loaded via request path, the header data. May be modified from the original request\n\t */\n\theaderData?: RuntimeHeaderData;\n\t/**\n\t * Any other properties to be logged.\n\t */\n\tadditionalProps?: ITelemetryPropertiesExt;\n}\n\n/**\n * Parameters necessary for creating a GarbageCollector.\n */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly submitMessage: (message: ContainerRuntimeGCMessage) => void;\n\treadonly sessionExpiryTimerStarted?: number | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,\n\t * where Tombstoned objects are permanently deleted from the container.\n\t *\n\t * IMPORTANT: This only applies if this document is allowed to run Sweep Phase.\n\t *\n\t * Current default behavior is for Sweep Phase not to delete Tombstoned objects,\n\t * but merely to prevent them from being loaded.\n\t */\n\tenableGCSweep?: true;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Delay between when Tombstone should run and when the object should be deleted.\n\t * This grace period gives a chance to intervene to recover if needed, before Sweep deletes the object.\n\t * If not present, a default (non-zero) value will be used.\n\t */\n\tsweepGracePeriodMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t// TODO: Use unknown (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is allowed for this document. GC may not be allowed for old documents created pre-GC.\n\t * If GC is allowed for a document, it will always be enabled. It cannot be disabled per session.\n\t */\n\treadonly gcAllowed: boolean;\n\t/**\n\t * Tracks whether sweep phase is allowed for this document. Sweep can be disabled per session via the sweepEnabled\n\t * flag defined below.\n\t */\n\treadonly sweepAllowed: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled to run in this session or not\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/**\n\t * The time in ms to expire a session for a client for gc.\n\t */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/**\n\t * The time after which an unreferenced node can be Tombstoned - i.e. GC knows it can't be referenced again (revived).\n\t */\n\treadonly tombstoneTimeoutMs: number | undefined;\n\t/**\n\t * The delay between tombstone and sweep. Not persisted, so concurrent sessions may use different values.\n\t * Sweep is implemented in an eventually-consistent way so this is acceptable.\n\t */\n\treadonly sweepGracePeriodMs: number;\n\t/**\n\t * The time after which an unreferenced node is inactive.\n\t */\n\treadonly inactiveTimeoutMs: number;\n\t/**\n\t * Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately.\n\t */\n\treadonly testMode: boolean;\n\t/**\n\t * @see GCFeatureMatrix.\n\t */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/**\n\t * The version of GC in the base snapshot.\n\t */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/**\n\t * The current version of GC data in the running code\n\t */\n\treadonly gcVersionInEffect: GCVersion;\n\t/**\n\t * If true, throw an error when a tombstone data store is retrieved\n\t */\n\treadonly throwOnTombstoneLoad: boolean;\n}\n\n/**\n * The state of node that is unreferenced.\n */\nexport const UnreferencedState = {\n\t/**\n\t * The node is active, i.e., it can become referenced again.\n\t */\n\tActive: \"Active\",\n\t/**\n\t * The node is inactive, i.e., it should not become referenced.\n\t */\n\tInactive: \"Inactive\",\n\t/**\n\t * The node is ready to be tombstoned\n\t */\n\tTombstoneReady: \"TombstoneReady\",\n\t/**\n\t * The node is ready to be deleted by the sweep phase.\n\t */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/**\n\t * The ids of nodes that are referenced in the referenced graph\n\t */\n\treferencedNodeIds: string[];\n\t/**\n\t * The ids of nodes that are not-referenced or deleted in the referenced graph\n\t */\n\tdeletedNodeIds: string[];\n}\n"]}
1
+ {"version":3,"file":"gcDefinitions.js","sourceRoot":"","sources":["../../src/gc/gcDefinitions.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA8BH;;GAEG;AACU,QAAA,eAAe,GAAc,CAAC,CAAC;AAC5C;;GAEG;AACU,QAAA,aAAa,GAAc,CAAC,CAAC;AAE1C;;;;;;;;;;GAUG;AACU,QAAA,sBAAsB,GAAG,cAAc,CAAC;AAErD;;GAEG;AACU,QAAA,aAAa,GAAG,oCAAoC,CAAC;AAClE;;GAEG;AACU,QAAA,mBAAmB,GAAG,0CAA0C,CAAC;AAC9E;;GAEG;AACU,QAAA,8BAA8B,GAC1C,qDAAqD,CAAC;AACvD;;GAEG;AACU,QAAA,uBAAuB,GAAG,8CAA8C,CAAC;AAEtF,2BAA2B;AACd,QAAA,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD;;;;;GAKG;AACU,QAAA,wBAAwB,GAAG,CAAC,GAAG,gBAAQ,CAAC;AAExC,QAAA,wBAAwB,GAAG,CAAC,GAAG,gBAAQ,CAAC,CAAC,SAAS;AAClD,QAAA,8BAA8B,GAAG,EAAE,GAAG,gBAAQ,CAAC,CAAC,UAAU;AAC1D,QAAA,yBAAyB,GAAG,CAAC,GAAG,gBAAQ,CAAC,CAAC,QAAQ;AA0K/D;;;GAGG;AACU,QAAA,UAAU,GAAG;IACzB,kCAAkC;IAClC,SAAS,EAAE,WAAW;IACtB,8DAA8D;IAC9D,YAAY,EAAE,cAAc;IAC5B,6EAA6E;IAC7E,IAAI,EAAE,MAAM;IACZ,+DAA+D;IAC/D,KAAK,EAAE,OAAO;CACL,CAAC;AAOX;;;GAGG;AACU,QAAA,4BAA4B,GAAG;IAC3C;;OAEG;IACH,KAAK,EAAE,OAAO;IACd;;OAEG;IACH,eAAe,EAAE,iBAAiB;CACzB,CAAC;AAuUX;;GAEG;AACU,QAAA,iBAAiB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,QAAQ;IAChB;;OAEG;IACH,QAAQ,EAAE,UAAU;IACpB;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAChC;;OAEG;IACH,UAAU,EAAE,YAAY;CACf,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICriticalContainerError } from \"@fluidframework/container-definitions\";\nimport { IRequest } from \"@fluidframework/core-interfaces\";\nimport { ISnapshotTree } from \"@fluidframework/driver-definitions/internal\";\nimport {\n\tITelemetryContext,\n\tIGarbageCollectionData,\n\tIGarbageCollectionDetailsBase,\n\tISummarizeResult,\n} from \"@fluidframework/runtime-definitions/internal\";\nimport { ReadAndParseBlob } from \"@fluidframework/runtime-utils/internal\";\nimport {\n\tITelemetryLoggerExt,\n\ttype ITelemetryPropertiesExt,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { RuntimeHeaderData } from \"../containerRuntime.js\";\nimport { ContainerRuntimeGCMessage } from \"../messageTypes.js\";\nimport {\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIRefreshSummaryResult,\n} from \"../summary/index.js\";\n\n/**\n * @internal\n */\nexport type GCVersion = number;\n\n/**\n * The stable/default version of GC Data\n */\nexport const stableGCVersion: GCVersion = 3;\n/**\n * The next version of GC Data, to bump to in case we need to regenerate all GC Data across all files.\n */\nexport const nextGCVersion: GCVersion = 4;\n\n/**\n * This undocumented GC Option (on ContainerRuntime Options) allows configuring which documents can have Sweep enabled.\n * This provides a way to disable both Tombstone Enforcement and Sweep.\n *\n * If unset, Tombstone Enforcement + Sweep will operate as otherwise configured.\n * Otherwise, the Sweep Phase will be disabled for documents where persisted value doesn't match what is passed into this session.\n * This provides a way to disallow Sweep for old documents that may be too difficult for an app to repair,\n * in case a bug is found that violates GC's assumptions.\n *\n * @see GCFeatureMatrix (gcGeneration)\n */\nexport const gcGenerationOptionName = \"gcGeneration\";\n\n/**\n * Config key to turn GC test mode on / off.\n */\nexport const gcTestModeKey = \"Fluid.GarbageCollection.GCTestMode\";\n/**\n * Config key to expire a session after a set period of time. Defaults to true.\n */\nexport const runSessionExpiryKey = \"Fluid.GarbageCollection.RunSessionExpiry\";\n/**\n * Config key to disable throwing an error when tombstone object is loaded (requested).\n */\nexport const disableThrowOnTombstoneLoadKey =\n\t\"Fluid.GarbageCollection.DisableThrowOnTombstoneLoad\";\n/**\n * Config key to enable GC version upgrade.\n */\nexport const gcVersionUpgradeToV4Key = \"Fluid.GarbageCollection.GCVersionUpgradeToV4\";\n\n// One day in milliseconds.\nexport const oneDayMs = 1 * 24 * 60 * 60 * 1000;\n\n/**\n * The maximum snapshot cache expiry in the driver. This is used to calculate the tombstone timeout.\n * Tombstone timeout = session expiry timeout + snapshot cache expiry timeout + a buffer.\n * The snapshot cache expiry timeout cannot be known precisely but the upper bound is 5 days, i.e., any snapshot\n * in cache will be invalidated before 5 days.\n */\nexport const maxSnapshotCacheExpiryMs = 5 * oneDayMs;\n\nexport const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days\nexport const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days\nexport const defaultSweepGracePeriodMs = 1 * oneDayMs; // 1 day\n\n/**\n * @see IGCMetadata.gcFeatureMatrix and @see gcGenerationOptionName\n * @internal\n */\nexport type GCFeatureMatrix =\n\t| {\n\t\t\t/**\n\t\t\t * The GC Generation value in effect when this file was created.\n\t\t\t * Gives a way for an app to disqualify old files from GC Sweep.\n\t\t\t * Provided via Container Runtime Options.\n\t\t\t */\n\t\t\tgcGeneration?: number;\n\t\t\t/**\n\t\t\t * Deprecated property from legacy type. Will not be set concurrently with gcGeneration\n\t\t\t */\n\t\t\ttombstoneGeneration?: undefined;\n\t }\n\t| {\n\t\t\t/**\n\t\t\t * The Tombstone Generation value in effect when this file was created.\n\t\t\t * Legacy - new containers would get gcGeneration instead (if anything)\n\t\t\t */\n\t\t\ttombstoneGeneration: number;\n\t };\n\n/**\n * Deprecated properties formerly included in @see IGCMetadata.\n * These may be found in old snapshots, so we need to support them for backwards compatibility.\n */\nexport interface IGCMetadata_Deprecated {\n\t/**\n\t * How long to wait after an object is unreferenced before deleting it via GC Sweep\n\t *\n\t * @deprecated Replaced by @see IGCMetadata.tombstoneTimeoutMs\n\t */\n\treadonly sweepTimeoutMs?: number;\n}\n\n/**\n * GC-specific metadata to be written into the summary.\n *\n * @internal\n */\nexport interface IGCMetadata {\n\t/**\n\t * The version of the GC code that was run to generate the GC data that is written in the summary.\n\t * If the persisted value doesn't match the current value in the code, saved GC data will be discarded and regenerated from scratch.\n\t * Also, used to determine whether GC is enabled for this container or not:\n\t * - A value of 0 or undefined means GC is disabled.\n\t * - A value greater than 0 means GC is enabled.\n\t */\n\treadonly gcFeature?: GCVersion;\n\n\t/**\n\t * A collection of different numerical \"Generations\" for different features,\n\t * used to determine feature availability over time.\n\t * This info may come from multiple sources (FF code, config service, app via Container Runtime Options),\n\t * and pertains to aspects of the document that may be fixed for its lifetime.\n\t *\n\t * For each dimension, if the persisted value doesn't match the currently provided value,\n\t * then this file does not support the corresponding feature as currently implemented.\n\t *\n\t * Guidance is that if no value is provided at runtime, it should result in the current default behavior.\n\t */\n\treadonly gcFeatureMatrix?: GCFeatureMatrix;\n\t/**\n\t * Tells whether the GC sweep phase is enabled for this container.\n\t * - True means sweep phase is enabled.\n\t * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.\n\t *\n\t * @deprecated use GCFeatureMatrix.gcGeneration instead. @see GCFeatureMatrix.gcGeneration\n\t */\n\treadonly sweepEnabled?: boolean;\n\t/**\n\t * If this is present, the session for this container will expire after this time and the container will close\n\t */\n\treadonly sessionExpiryTimeoutMs?: number;\n\t/**\n\t * How long to wait after an object is unreferenced before it becomes a Tombstone.\n\t *\n\t * After this point, there's a grace period before the object is deleted.\n\t * @see IGCRuntimeOptions.sweepGracePeriodMs\n\t *\n\t * So the full sweep timeout in a session is tombstoneTimeoutMs + sweepGracePeriodMs.\n\t */\n\treadonly tombstoneTimeoutMs?: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection mark phase run.\n * @internal\n */\nexport interface IMarkPhaseStats {\n\t/**\n\t * The number of nodes in the container.\n\t */\n\tnodeCount: number;\n\t/**\n\t * The number of data stores in the container.\n\t */\n\tdataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the container.\n\t */\n\tattachmentBlobCount: number;\n\t/**\n\t * The number of unreferenced nodes in the container.\n\t */\n\tunrefNodeCount: number;\n\t/**\n\t * The number of unreferenced data stores in the container.\n\t */\n\tunrefDataStoreCount: number;\n\t/**\n\t * The number of unreferenced attachment blobs in the container.\n\t */\n\tunrefAttachmentBlobCount: number;\n\t/**\n\t * The number of nodes whose reference state updated since last GC run.\n\t */\n\tupdatedNodeCount: number;\n\t/**\n\t * The number of data stores whose reference state updated since last GC run.\n\t */\n\tupdatedDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs whose reference state updated since last GC run.\n\t */\n\tupdatedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection sweep phase run.\n * @internal\n */\nexport interface ISweepPhaseStats {\n\t/**\n\t * The number of nodes in the lifetime of the container.\n\t */\n\tlifetimeNodeCount: number;\n\t/**\n\t * The number of data stores in the lifetime of the container.\n\t */\n\tlifetimeDataStoreCount: number;\n\t/**\n\t * The number of attachment blobs in the lifetime of the container.\n\t */\n\tlifetimeAttachmentBlobCount: number;\n\t/**\n\t * The number of deleted nodes in the container.\n\t */\n\tdeletedNodeCount: number;\n\t/**\n\t * The number of deleted data stores in the container.\n\t */\n\tdeletedDataStoreCount: number;\n\t/**\n\t * The number of deleted attachment blobs in the container.\n\t */\n\tdeletedAttachmentBlobCount: number;\n}\n\n/**\n * The statistics of the system state after a garbage collection run.\n * @internal\n */\nexport interface IGCStats extends IMarkPhaseStats, ISweepPhaseStats {}\n\n/**\n * The types of GC nodes in the GC reference graph.\n * @internal\n */\nexport const GCNodeType = {\n\t// Nodes that are for data stores.\n\tDataStore: \"DataStore\",\n\t// Nodes that are within a data store. For example, DDS nodes.\n\tSubDataStore: \"SubDataStore\",\n\t// Nodes that are for attachment blobs, i.e., blobs uploaded via BlobManager.\n\tBlob: \"Blob\",\n\t// Nodes that are neither of the above. For example, root node.\n\tOther: \"Other\",\n} as const;\n\n/**\n * @internal\n */\nexport type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];\n\n/**\n * The type of a garbage collection message.\n * @internal\n */\nexport const GarbageCollectionMessageType = {\n\t/**\n\t * Message sent directing GC to delete the given nodes\n\t */\n\tSweep: \"Sweep\",\n\t/**\n\t * Message sent notifying GC that a Tombstoned object was Loaded\n\t */\n\tTombstoneLoaded: \"TombstoneLoaded\",\n} as const;\n\n/**\n * @internal\n */\nexport type GarbageCollectionMessageType =\n\t(typeof GarbageCollectionMessageType)[keyof typeof GarbageCollectionMessageType];\n\n/**\n * The garbage collection sweep message.\n * @internal\n */\nexport interface ISweepMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.Sweep\n\t */\n\ttype: typeof GarbageCollectionMessageType.Sweep;\n\t/**\n\t * The ids of nodes that are deleted.\n\t */\n\tdeletedNodeIds: string[];\n}\n\n/**\n * The GC TombstoneLoaded message.\n * @internal\n */\nexport interface ITombstoneLoadedMessage {\n\t/**\n\t * @see GarbageCollectionMessageType.TombstoneLoaded\n\t */\n\ttype: typeof GarbageCollectionMessageType.TombstoneLoaded;\n\t/**\n\t * The id of Tombstoned node that was loaded.\n\t */\n\tnodePath: string;\n}\n\n/**\n * Type for a message to be used for sending / received garbage collection messages.\n * @internal\n */\nexport type GarbageCollectionMessage = ISweepMessage | ITombstoneLoadedMessage;\n\n/**\n * Defines the APIs for the runtime object to be passed to the garbage collector.\n *\n * @internal\n */\nexport interface IGarbageCollectionRuntime {\n\t/**\n\t * Returns the garbage collection data of the runtime.\n\t */\n\tgetGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;\n\t/**\n\t * After GC has run, called to notify the runtime of routes that are used in it.\n\t */\n\tupdateUsedRoutes(usedRoutes: readonly string[]): void;\n\t/**\n\t * After GC has run and identified nodes that are sweep ready, called to delete the sweep ready nodes. The runtime\n\t * should return the routes of nodes that were deleted.\n\t * @param sweepReadyRoutes - The routes of nodes that are sweep ready and should be deleted.\n\t */\n\tdeleteSweepReadyNodes(sweepReadyRoutes: readonly string[]): readonly string[];\n\t/**\n\t * Called to notify the runtime of routes that are tombstones.\n\t */\n\tupdateTombstonedRoutes(tombstoneRoutes: readonly string[]): void;\n\t/**\n\t * Returns a referenced timestamp to be used to track unreferenced nodes.\n\t */\n\tgetCurrentReferenceTimestampMs(): number | undefined;\n\t/**\n\t * Returns the type of the GC node.\n\t */\n\tgetNodeType(nodePath: string): GCNodeType;\n\t/**\n\t * Called when the runtime should close because of an error.\n\t */\n\tcloseFn: (error?: ICriticalContainerError) => void;\n}\n\n/**\n * Defines the contract for the garbage collector.\n */\nexport interface IGarbageCollector {\n\t/**\n\t * Tells the time at which session expiry timer started in a previous container.\n\t * This is only set when loading from a stashed container and will be equal to the\n\t * original container's local client time when it was loaded (and started the session expiry timer).\n\t */\n\treadonly sessionExpiryTimerStarted: number | undefined;\n\t/**\n\t * Tells whether GC should run or not.\n\t */\n\treadonly shouldRunGC: boolean;\n\t/**\n\t * The count of data stores whose GC state updated since the last summary.\n\t */\n\treadonly updatedDSCountSinceLastSummary: number;\n\t/**\n\t * Initialize the state from the base snapshot after its creation.\n\t */\n\tinitializeBaseState(): Promise<void>;\n\t/**\n\t * Run garbage collection and update the reference / used state of the system.\n\t */\n\tcollectGarbage(\n\t\toptions: {\n\t\t\tlogger?: ITelemetryLoggerExt;\n\t\t\trunSweep?: boolean;\n\t\t\tfullGC?: boolean;\n\t\t},\n\t\ttelemetryContext?: ITelemetryContext,\n\t): Promise<IGCStats | undefined>;\n\t/**\n\t * Summarizes the GC data and returns it as a summary tree.\n\t */\n\tsummarize(\n\t\tfullTree: boolean,\n\t\ttrackState: boolean,\n\t\ttelemetryContext?: ITelemetryContext,\n\t): ISummarizeResult | undefined;\n\t/**\n\t * Returns the garbage collector specific metadata to be written into the summary.\n\t */\n\tgetMetadata(): IGCMetadata;\n\t/**\n\t * Returns the GC details generated from the base snapshot.\n\t */\n\tgetBaseGCDetails(): Promise<IGarbageCollectionDetailsBase>;\n\t/**\n\t * Called when the latest summary of the system has been refreshed.\n\t */\n\trefreshLatestSummary(result: IRefreshSummaryResult): Promise<void>;\n\t/**\n\t * Called when a node with the given path is updated. If the node is inactive or tombstoned, this will log an error\n\t * or throw an error if failing on incorrect usage is configured.\n\t */\n\tnodeUpdated(props: IGCNodeUpdatedProps): void;\n\t/**\n\t * Called when a reference is added to a node. Used to identify nodes that were referenced between summaries.\n\t */\n\taddedOutboundReference(\n\t\tfromNodePath: string,\n\t\ttoNodePath: string,\n\t\ttimestampMs: number,\n\t\tautorecovery?: true,\n\t): void;\n\t/**\n\t * Called to process garbage collection messages\n\t */\n\tprocessMessages(\n\t\tmessageContents: GarbageCollectionMessage[],\n\t\tmessageTimestampMs: number,\n\t\tlocal: boolean,\n\t): void;\n\t/**\n\t * Returns true if this node has been deleted by GC during sweep phase.\n\t */\n\tisNodeDeleted(nodePath: string): boolean;\n\tsetConnectionState(connected: boolean, clientId?: string): void;\n\tdispose(): void;\n}\n\n/**\n * Info needed by GC when notified that a node was updated (loaded or changed)\n * @internal\n */\nexport interface IGCNodeUpdatedProps {\n\t/**\n\t * Type and path of the updated node\n\t */\n\tnode: { type: (typeof GCNodeType)[\"DataStore\" | \"Blob\"]; path: string };\n\t/**\n\t * Whether the node (or a subpath) was loaded or changed.\n\t */\n\treason: \"Loaded\" | \"Changed\" | \"Realized\";\n\t/**\n\t * The op-based timestamp when the node changed. If the update is from receiving an op, this should\n\t * be the timestamp of the op. If not, this should be the timestamp of the last op processed.\n\t */\n\ttimestampMs: number | undefined;\n\t/**\n\t * The package path of the node. This may not be available if the node hasn't been loaded yet\n\t */\n\tpackagePath?: readonly string[];\n\t/**\n\t * The original request for loads to preserve it in telemetry\n\t */\n\trequest?: IRequest;\n\t/**\n\t * If the node was loaded via request path, the header data. May be modified from the original request\n\t */\n\theaderData?: RuntimeHeaderData;\n\t/**\n\t * Any other properties to be logged.\n\t */\n\tadditionalProps?: ITelemetryPropertiesExt;\n}\n\n/**\n * Parameters necessary for creating a GarbageCollector.\n */\nexport interface IGarbageCollectorCreateParams {\n\treadonly runtime: IGarbageCollectionRuntime;\n\treadonly gcOptions: IGCRuntimeOptions;\n\treadonly baseLogger: ITelemetryLoggerExt;\n\treadonly existing: boolean;\n\n\treadonly metadata: IContainerRuntimeMetadata | undefined;\n\n\treadonly createContainerMetadata: ICreateContainerMetadata;\n\treadonly baseSnapshot: ISnapshotTree | undefined;\n\treadonly isSummarizerClient: boolean;\n\treadonly getNodePackagePath: (nodePath: string) => Promise<readonly string[] | undefined>;\n\treadonly getLastSummaryTimestampMs: () => number | undefined;\n\treadonly readAndParseBlob: ReadAndParseBlob;\n\treadonly submitMessage: (message: ContainerRuntimeGCMessage) => void;\n\treadonly sessionExpiryTimerStarted?: number | undefined;\n}\n\n/**\n * @legacy\n * @alpha\n */\nexport interface IGCRuntimeOptions {\n\t/**\n\t * Flag that if true, will enable the full Sweep Phase of garbage collection for this session,\n\t * where Tombstoned objects are permanently deleted from the container.\n\t *\n\t * IMPORTANT: This only applies if this document is allowed to run Sweep Phase.\n\t *\n\t * Current default behavior is for Sweep Phase not to delete Tombstoned objects,\n\t * but merely to prevent them from being loaded.\n\t */\n\tenableGCSweep?: true;\n\n\t/**\n\t * Flag that will bypass optimizations and generate GC data for all nodes irrespective of whether a node\n\t * changed or not.\n\t */\n\trunFullGC?: boolean;\n\n\t/**\n\t * Maximum session duration for a new container. If not present, a default value will be used.\n\t *\n\t * Note: This setting is persisted in the container's summary and cannot be changed.\n\t */\n\tsessionExpiryTimeoutMs?: number;\n\n\t/**\n\t * Delay between when Tombstone should run and when the object should be deleted.\n\t * This grace period gives a chance to intervene to recover if needed, before Sweep deletes the object.\n\t * If not present, a default (non-zero) value will be used.\n\t */\n\tsweepGracePeriodMs?: number;\n\n\t/**\n\t * Allows additional GC options to be passed.\n\t */\n\t// TODO: Use unknown (breaking change)\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[key: string]: any;\n}\n\n/**\n * The configurations for Garbage Collector that determines what runs and how.\n */\nexport interface IGarbageCollectorConfigs {\n\t/**\n\t * Tracks if GC is allowed for this document. GC may not be allowed for old documents created pre-GC.\n\t * If GC is allowed for a document, it will always be enabled. It cannot be disabled per session.\n\t */\n\treadonly gcAllowed: boolean;\n\t/**\n\t * Tracks whether sweep phase is allowed for this document. Sweep can be disabled per session via the sweepEnabled\n\t * flag defined below.\n\t */\n\treadonly sweepAllowed: boolean;\n\t/**\n\t * Tracks if sweep phase is enabled to run in this session or not\n\t */\n\treadonly sweepEnabled: boolean;\n\t/**\n\t * If true, bypass optimizations and generate GC data for all nodes irrespective of whether a node changed or not.\n\t */\n\treadonly runFullGC: boolean | undefined;\n\t/**\n\t * The time in ms to expire a session for a client for gc.\n\t */\n\treadonly sessionExpiryTimeoutMs: number | undefined;\n\t/**\n\t * The time after which an unreferenced node can be Tombstoned - i.e. GC knows it can't be referenced again (revived).\n\t */\n\treadonly tombstoneTimeoutMs: number | undefined;\n\t/**\n\t * The delay between tombstone and sweep. Not persisted, so concurrent sessions may use different values.\n\t * Sweep is implemented in an eventually-consistent way so this is acceptable.\n\t */\n\treadonly sweepGracePeriodMs: number;\n\t/**\n\t * The time after which an unreferenced node is inactive.\n\t */\n\treadonly inactiveTimeoutMs: number;\n\t/**\n\t * Tracks whether GC should run in test mode. In this mode, unreferenced objects are deleted immediately.\n\t */\n\treadonly testMode: boolean;\n\t/**\n\t * @see GCFeatureMatrix.\n\t */\n\treadonly persistedGcFeatureMatrix: GCFeatureMatrix | undefined;\n\t/**\n\t * The version of GC in the base snapshot.\n\t */\n\treadonly gcVersionInBaseSnapshot: GCVersion | undefined;\n\t/**\n\t * The current version of GC data in the running code\n\t */\n\treadonly gcVersionInEffect: GCVersion;\n\t/**\n\t * If true, throw an error when a tombstone data store is retrieved\n\t */\n\treadonly throwOnTombstoneLoad: boolean;\n}\n\n/**\n * The state of node that is unreferenced.\n */\nexport const UnreferencedState = {\n\t/**\n\t * The node is active, i.e., it can become referenced again.\n\t */\n\tActive: \"Active\",\n\t/**\n\t * The node is inactive, i.e., it should not become referenced.\n\t */\n\tInactive: \"Inactive\",\n\t/**\n\t * The node is ready to be tombstoned\n\t */\n\tTombstoneReady: \"TombstoneReady\",\n\t/**\n\t * The node is ready to be deleted by the sweep phase.\n\t */\n\tSweepReady: \"SweepReady\",\n} as const;\nexport type UnreferencedState = (typeof UnreferencedState)[keyof typeof UnreferencedState];\n\n/**\n * Represents the result of a GC run.\n */\nexport interface IGCResult {\n\t/**\n\t * The ids of nodes that are referenced in the referenced graph\n\t */\n\treferencedNodeIds: string[];\n\t/**\n\t * The ids of nodes that are not-referenced or deleted in the referenced graph\n\t */\n\tdeletedNodeIds: string[];\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -2,12 +2,14 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { ISummaryRuntimeOptions, IContainerRuntimeOptions, IContainerRuntimeOptionsInternal, loadContainerRuntime, LoadContainerRuntimeParams, agentSchedulerId, ContainerRuntime, DeletedResponseHeaderKey, TombstoneResponseHeaderKey, InactiveResponseHeaderKey, ICompressionRuntimeOptions, CompressionAlgorithms, RuntimeHeaderData, disabledCompressionConfig, } from "./containerRuntime.js";
5
+ export { ContainerRuntimeOptions, ContainerRuntimeOptionsInternal, ISummaryRuntimeOptions, IContainerRuntimeOptions, IContainerRuntimeOptionsInternal, loadContainerRuntime, LoadContainerRuntimeParams, agentSchedulerId, ContainerRuntime, DeletedResponseHeaderKey, TombstoneResponseHeaderKey, InactiveResponseHeaderKey, RuntimeHeaderData, } from "./containerRuntime.js";
6
+ export type { ICompressionRuntimeOptions } from "./compressionDefinitions.js";
7
+ export { CompressionAlgorithms, disabledCompressionConfig } from "./compressionDefinitions.js";
6
8
  export { ContainerMessageType, UnknownContainerRuntimeMessage, } from "./messageTypes.js";
7
9
  export { IBlobManagerLoadInfo } from "./blobManager/index.js";
8
10
  export { FluidDataStoreRegistry } from "./dataStoreRegistry.js";
9
11
  export { detectOutboundReferences, ChannelCollectionFactory, AllowTombstoneRequestHeaderKey, } from "./channelCollection.js";
10
- export { GCNodeType, IGCMetadata, GCFeatureMatrix, GCVersion, IGCRuntimeOptions, IMarkPhaseStats, ISweepPhaseStats, IGCNodeUpdatedProps, IGCStats, } from "./gc/index.js";
12
+ export { GCNodeType, IGCMetadata, GCFeatureMatrix, GCVersion, IGarbageCollectionRuntime, IGCRuntimeOptions, IMarkPhaseStats, ISweepPhaseStats, IGCNodeUpdatedProps, IGCStats, } from "./gc/index.js";
11
13
  export { IAckedSummary, ISummarizer, ISummarizeResults, ISummaryCancellationToken, neverCancelledSummaryToken, Summarizer, SummaryCollection, EnqueueSummarizeResult, IAckSummaryResult, IBaseSummarizeResult, IBroadcastSummaryResult, ICancellationToken, IConnectableRuntime, IContainerRuntimeMetadata, ICreateContainerMetadata, IEnqueueSummarizeOptions, IGenerateSummaryTreeResult, IGeneratedSummaryStats, INackSummaryResult, IOnDemandSummarizeOptions, IRefreshSummaryAckOptions, ISubmitSummaryOpResult, ISubmitSummaryOptions, ISerializedElection, ISummarizeOptions, ISummarizerInternalsProvider, ISummarizerRuntime, ISummarizingWarning, IUploadSummaryResult, SubmitSummaryResult, SummarizeResultPart, IClientSummaryWatcher, ISummary, ISummaryCollectionOpEvents, ISummaryAckMessage, ISummaryMetadataMessage, ISummaryNackMessage, ISummaryOpMessage, OpActionEventListener, OpActionEventName, ICancellableSummarizerController, SubmitSummaryFailureData, SummaryStage, IRetriableFailureError, IdCompressorMode, IDocumentSchema, DocumentSchemaValueType, IDocumentSchemaCurrent, currentDocumentVersionSchema, DocumentsSchemaController, IDocumentSchemaChangeMessage, IDocumentSchemaFeatures, ReadFluidDataStoreAttributes, IFluidDataStoreAttributes0, IFluidDataStoreAttributes1, IFluidDataStoreAttributes2, OmitAttributesVersions, ISummaryBaseConfiguration, ISummaryConfigurationHeuristics, ISummaryConfigurationDisableSummarizer, ISummaryConfigurationDisableHeuristics, ISummaryConfiguration, DefaultSummaryConfiguration, } from "./summary/index.js";
12
14
  export { IChunkedOp, unpackRuntimeMessage } from "./opLifecycle/index.js";
13
15
  export { ChannelCollection } from "./channelCollection.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,sBAAsB,EACtB,wBAAwB,EACxB,gCAAgC,EAChC,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,oBAAoB,EACpB,8BAA8B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACN,wBAAwB,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ime", { enumerable: true, get: func
12
12
  Object.defineProperty(exports, "DeletedResponseHeaderKey", { enumerable: true, get: function () { return containerRuntime_js_1.DeletedResponseHeaderKey; } });
13
13
  Object.defineProperty(exports, "TombstoneResponseHeaderKey", { enumerable: true, get: function () { return containerRuntime_js_1.TombstoneResponseHeaderKey; } });
14
14
  Object.defineProperty(exports, "InactiveResponseHeaderKey", { enumerable: true, get: function () { return containerRuntime_js_1.InactiveResponseHeaderKey; } });
15
- Object.defineProperty(exports, "CompressionAlgorithms", { enumerable: true, get: function () { return containerRuntime_js_1.CompressionAlgorithms; } });
16
- Object.defineProperty(exports, "disabledCompressionConfig", { enumerable: true, get: function () { return containerRuntime_js_1.disabledCompressionConfig; } });
15
+ var compressionDefinitions_js_1 = require("./compressionDefinitions.js");
16
+ Object.defineProperty(exports, "CompressionAlgorithms", { enumerable: true, get: function () { return compressionDefinitions_js_1.CompressionAlgorithms; } });
17
+ Object.defineProperty(exports, "disabledCompressionConfig", { enumerable: true, get: function () { return compressionDefinitions_js_1.disabledCompressionConfig; } });
17
18
  var messageTypes_js_1 = require("./messageTypes.js");
18
19
  Object.defineProperty(exports, "ContainerMessageType", { enumerable: true, get: function () { return messageTypes_js_1.ContainerMessageType; } });
19
20
  var dataStoreRegistry_js_1 = require("./dataStoreRegistry.js");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAe+B;AAX9B,2HAAA,oBAAoB,OAAA;AAEpB,uHAAA,gBAAgB,OAAA;AAChB,uHAAA,gBAAgB,OAAA;AAChB,+HAAA,wBAAwB,OAAA;AACxB,iIAAA,0BAA0B,OAAA;AAC1B,gIAAA,yBAAyB,OAAA;AAEzB,4HAAA,qBAAqB,OAAA;AAErB,gIAAA,yBAAyB,OAAA;AAE1B,qDAG2B;AAF1B,uHAAA,oBAAoB,OAAA;AAIrB,+DAAgE;AAAvD,8HAAA,sBAAsB,OAAA;AAC/B,+DAIgC;AAH/B,gIAAA,wBAAwB,OAAA;AACxB,gIAAA,wBAAwB,OAAA;AACxB,sIAAA,8BAA8B,OAAA;AAE/B,0CAUuB;AATtB,sGAAA,UAAU,OAAA;AAUX,+CAgE4B;AA3D3B,sHAAA,0BAA0B,OAAA;AAC1B,sGAAA,UAAU,OAAA;AACV,6GAAA,iBAAiB,OAAA;AA0CjB,wHAAA,4BAA4B,OAAA;AAC5B,qHAAA,yBAAyB,OAAA;AAazB,uHAAA,2BAA2B,OAAA;AAE5B,mDAA0E;AAArD,gHAAA,oBAAoB,OAAA;AACzC,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,6DAU+B;AAP9B,iIAAA,0BAA0B,OAAA;AAC1B,qIAAA,8BAA8B,OAAA;AAC9B,4HAAA,qBAAqB,OAAA;AAMtB,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tISummaryRuntimeOptions,\n\tIContainerRuntimeOptions,\n\tIContainerRuntimeOptionsInternal,\n\tloadContainerRuntime,\n\tLoadContainerRuntimeParams,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tDeletedResponseHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tICompressionRuntimeOptions,\n\tCompressionAlgorithms,\n\tRuntimeHeaderData,\n\tdisabledCompressionConfig,\n} from \"./containerRuntime.js\";\nexport {\n\tContainerMessageType,\n\tUnknownContainerRuntimeMessage,\n} from \"./messageTypes.js\";\nexport { IBlobManagerLoadInfo } from \"./blobManager/index.js\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport {\n\tdetectOutboundReferences,\n\tChannelCollectionFactory,\n\tAllowTombstoneRequestHeaderKey,\n} from \"./channelCollection.js\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCNodeUpdatedProps,\n\tIGCStats,\n} from \"./gc/index.js\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\n\tSummaryCollection,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tIBaseSummarizeResult,\n\tIBroadcastSummaryResult,\n\tICancellationToken,\n\tIConnectableRuntime,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIGeneratedSummaryStats,\n\tINackSummaryResult,\n\tIOnDemandSummarizeOptions,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOpResult,\n\tISubmitSummaryOptions,\n\tISerializedElection,\n\tISummarizeOptions,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSubmitSummaryResult,\n\tSummarizeResultPart,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryCollectionOpEvents,\n\tISummaryAckMessage,\n\tISummaryMetadataMessage,\n\tISummaryNackMessage,\n\tISummaryOpMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n\tICancellableSummarizerController,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureError,\n\tIdCompressorMode,\n\tIDocumentSchema,\n\tDocumentSchemaValueType,\n\tIDocumentSchemaCurrent,\n\tcurrentDocumentVersionSchema,\n\tDocumentsSchemaController,\n\tIDocumentSchemaChangeMessage,\n\tIDocumentSchemaFeatures,\n\tReadFluidDataStoreAttributes,\n\tIFluidDataStoreAttributes0,\n\tIFluidDataStoreAttributes1,\n\tIFluidDataStoreAttributes2,\n\tOmitAttributesVersions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n} from \"./summary/index.js\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle/index.js\";\nexport { ChannelCollection } from \"./channelCollection.js\";\nexport {\n\tIFluidDataStoreContextInternal,\n\tISnapshotDetails,\n\tLocalFluidDataStoreContext,\n\tLocalFluidDataStoreContextBase,\n\tFluidDataStoreContext,\n\tIFluidDataStoreContextProps,\n\tILocalFluidDataStoreContextProps,\n\tILocalDetachedFluidDataStoreContextProps,\n\tIFluidDataStoreContextEvents,\n} from \"./dataStoreContext.js\";\nexport { DataStoreContexts } from \"./dataStoreContexts.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6DAc+B;AAR9B,2HAAA,oBAAoB,OAAA;AAEpB,uHAAA,gBAAgB,OAAA;AAChB,uHAAA,gBAAgB,OAAA;AAChB,+HAAA,wBAAwB,OAAA;AACxB,iIAAA,0BAA0B,OAAA;AAC1B,gIAAA,yBAAyB,OAAA;AAI1B,yEAA+F;AAAtF,kIAAA,qBAAqB,OAAA;AAAE,sIAAA,yBAAyB,OAAA;AACzD,qDAG2B;AAF1B,uHAAA,oBAAoB,OAAA;AAIrB,+DAAgE;AAAvD,8HAAA,sBAAsB,OAAA;AAC/B,+DAIgC;AAH/B,gIAAA,wBAAwB,OAAA;AACxB,gIAAA,wBAAwB,OAAA;AACxB,sIAAA,8BAA8B,OAAA;AAE/B,0CAWuB;AAVtB,sGAAA,UAAU,OAAA;AAWX,+CAgE4B;AA3D3B,sHAAA,0BAA0B,OAAA;AAC1B,sGAAA,UAAU,OAAA;AACV,6GAAA,iBAAiB,OAAA;AA0CjB,wHAAA,4BAA4B,OAAA;AAC5B,qHAAA,yBAAyB,OAAA;AAazB,uHAAA,2BAA2B,OAAA;AAE5B,mDAA0E;AAArD,gHAAA,oBAAoB,OAAA;AACzC,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA;AAC1B,6DAU+B;AAP9B,iIAAA,0BAA0B,OAAA;AAC1B,qIAAA,8BAA8B,OAAA;AAC9B,4HAAA,qBAAqB,OAAA;AAMtB,+DAA2D;AAAlD,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tContainerRuntimeOptions,\n\tContainerRuntimeOptionsInternal,\n\tISummaryRuntimeOptions,\n\tIContainerRuntimeOptions,\n\tIContainerRuntimeOptionsInternal,\n\tloadContainerRuntime,\n\tLoadContainerRuntimeParams,\n\tagentSchedulerId,\n\tContainerRuntime,\n\tDeletedResponseHeaderKey,\n\tTombstoneResponseHeaderKey,\n\tInactiveResponseHeaderKey,\n\tRuntimeHeaderData,\n} from \"./containerRuntime.js\";\nexport type { ICompressionRuntimeOptions } from \"./compressionDefinitions.js\";\nexport { CompressionAlgorithms, disabledCompressionConfig } from \"./compressionDefinitions.js\";\nexport {\n\tContainerMessageType,\n\tUnknownContainerRuntimeMessage,\n} from \"./messageTypes.js\";\nexport { IBlobManagerLoadInfo } from \"./blobManager/index.js\";\nexport { FluidDataStoreRegistry } from \"./dataStoreRegistry.js\";\nexport {\n\tdetectOutboundReferences,\n\tChannelCollectionFactory,\n\tAllowTombstoneRequestHeaderKey,\n} from \"./channelCollection.js\";\nexport {\n\tGCNodeType,\n\tIGCMetadata,\n\tGCFeatureMatrix,\n\tGCVersion,\n\tIGarbageCollectionRuntime,\n\tIGCRuntimeOptions,\n\tIMarkPhaseStats,\n\tISweepPhaseStats,\n\tIGCNodeUpdatedProps,\n\tIGCStats,\n} from \"./gc/index.js\";\nexport {\n\tIAckedSummary,\n\tISummarizer,\n\tISummarizeResults,\n\tISummaryCancellationToken,\n\tneverCancelledSummaryToken,\n\tSummarizer,\n\tSummaryCollection,\n\tEnqueueSummarizeResult,\n\tIAckSummaryResult,\n\tIBaseSummarizeResult,\n\tIBroadcastSummaryResult,\n\tICancellationToken,\n\tIConnectableRuntime,\n\tIContainerRuntimeMetadata,\n\tICreateContainerMetadata,\n\tIEnqueueSummarizeOptions,\n\tIGenerateSummaryTreeResult,\n\tIGeneratedSummaryStats,\n\tINackSummaryResult,\n\tIOnDemandSummarizeOptions,\n\tIRefreshSummaryAckOptions,\n\tISubmitSummaryOpResult,\n\tISubmitSummaryOptions,\n\tISerializedElection,\n\tISummarizeOptions,\n\tISummarizerInternalsProvider,\n\tISummarizerRuntime,\n\tISummarizingWarning,\n\tIUploadSummaryResult,\n\tSubmitSummaryResult,\n\tSummarizeResultPart,\n\tIClientSummaryWatcher,\n\tISummary,\n\tISummaryCollectionOpEvents,\n\tISummaryAckMessage,\n\tISummaryMetadataMessage,\n\tISummaryNackMessage,\n\tISummaryOpMessage,\n\tOpActionEventListener,\n\tOpActionEventName,\n\tICancellableSummarizerController,\n\tSubmitSummaryFailureData,\n\tSummaryStage,\n\tIRetriableFailureError,\n\tIdCompressorMode,\n\tIDocumentSchema,\n\tDocumentSchemaValueType,\n\tIDocumentSchemaCurrent,\n\tcurrentDocumentVersionSchema,\n\tDocumentsSchemaController,\n\tIDocumentSchemaChangeMessage,\n\tIDocumentSchemaFeatures,\n\tReadFluidDataStoreAttributes,\n\tIFluidDataStoreAttributes0,\n\tIFluidDataStoreAttributes1,\n\tIFluidDataStoreAttributes2,\n\tOmitAttributesVersions,\n\tISummaryBaseConfiguration,\n\tISummaryConfigurationHeuristics,\n\tISummaryConfigurationDisableSummarizer,\n\tISummaryConfigurationDisableHeuristics,\n\tISummaryConfiguration,\n\tDefaultSummaryConfiguration,\n} from \"./summary/index.js\";\nexport { IChunkedOp, unpackRuntimeMessage } from \"./opLifecycle/index.js\";\nexport { ChannelCollection } from \"./channelCollection.js\";\nexport {\n\tIFluidDataStoreContextInternal,\n\tISnapshotDetails,\n\tLocalFluidDataStoreContext,\n\tLocalFluidDataStoreContextBase,\n\tFluidDataStoreContext,\n\tIFluidDataStoreContextProps,\n\tILocalFluidDataStoreContextProps,\n\tILocalDetachedFluidDataStoreContextProps,\n\tIFluidDataStoreContextEvents,\n} from \"./dataStoreContext.js\";\nexport { DataStoreContexts } from \"./dataStoreContexts.js\";\n"]}
package/dist/legacy.d.ts CHANGED
@@ -13,6 +13,7 @@ export {
13
13
  AllowTombstoneRequestHeaderKey,
14
14
  CompressionAlgorithms,
15
15
  ContainerMessageType,
16
+ ContainerRuntimeOptions,
16
17
  DefaultSummaryConfiguration,
17
18
  EnqueueSummarizeResult,
18
19
  IAckSummaryResult,
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { ICompressionRuntimeOptions } from "../containerRuntime.js";
5
+ import { ICompressionRuntimeOptions } from "../compressionDefinitions.js";
6
6
  import type { IPendingMessage } from "../pendingStateManager.js";
7
7
  import { LocalBatchMessage, IBatchCheckpoint, type LocalBatch } from "./definitions.js";
8
8
  import type { BatchStartInfo } from "./remoteMessageProcessor.js";
@@ -1 +1 @@
1
- {"version":3,"file":"batchManager.d.ts","sourceRoot":"","sources":["../../src/opLifecycle/batchManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;IAEzD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;C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AI,gBAAgB;CAsBrC;AAgCD,eAAO,MAAM,oBAAoB,YACvB,oBAAoB,gBACf,oBAAoB,KAChC,OASF,CAAC"}
@@ -8,6 +8,7 @@ exports.sequenceNumbersMatch = exports.BatchManager = exports.getEffectiveBatchI
8
8
  const internal_1 = require("@fluidframework/core-utils/internal");
9
9
  const internal_2 = require("@fluidframework/telemetry-utils/internal");
10
10
  const metadata_js_1 = require("../metadata.js");
11
+ const opSerialization_js_1 = require("./opSerialization.js");
11
12
  /**
12
13
  * Compose original client ID and client sequence number into BatchId to stamp on the message during reconnect
13
14
  */
@@ -69,10 +70,12 @@ class BatchManager {
69
70
  * Gets the pending batch and clears state for the next batch.
70
71
  */
71
72
  popBatch(batchId) {
73
+ (0, internal_1.assert)(this.pendingBatch[0] !== undefined, 0xb8a /* expected non-empty batch */);
72
74
  const batch = {
73
75
  messages: this.pendingBatch,
74
76
  referenceSequenceNumber: this.referenceSequenceNumber,
75
77
  hasReentrantOps: this.hasReentrantOps,
78
+ staged: this.pendingBatch[0].staged,
76
79
  };
77
80
  this.pendingBatch = [];
78
81
  this.clientSequenceNumber = undefined;
@@ -97,7 +100,7 @@ class BatchManager {
97
100
  throw new internal_2.LoggingError("Ops generated during rollback", {
98
101
  count,
99
102
  ...(0, internal_2.tagData)(internal_2.TelemetryDataTag.UserData, {
100
- ops: JSON.stringify(this.pendingBatch.slice(startPoint).map((b) => b.serializedOp)),
103
+ ops: (0, opSerialization_js_1.serializeOp)(this.pendingBatch.slice(startPoint).map((b) => b.runtimeOp)),
101
104
  }),
102
105
  });
103
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"batchManager.js","sourceRoot":"","sources":["../../src/opLifecycle/batchManager.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,kEAA6D;AAC7D,uEAIkD;AAGlD,gDAAsE;AA8BtE;;GAEG;AACH,SAAgB,eAAe,CAAC,gBAAwB,EAAE,aAAqB;IAC9E,OAAO,GAAG,gBAAgB,KAAK,aAAa,G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SAAS,EAAE,CAAC;QAC3B,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;QAChC,QAAQ,CAAC,QAAQ,GAAG,aAAa,CAAC;IACnC,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEK,MAAM,oBAAoB,GAAG,CACnC,OAA6B,EAC7B,YAAkC,EACxB,EAAE;IACZ,OAAO,CACN,CAAC,OAAO,CAAC,uBAAuB,KAAK,SAAS;QAC7C,YAAY,CAAC,uBAAuB,KAAK,SAAS;QAClD,OAAO,CAAC,uBAAuB,KAAK,YAAY,CAAC,uBAAuB,CAAC;QAC1E,CAAC,OAAO,CAAC,oBAAoB,KAAK,SAAS;YAC1C,YAAY,CAAC,oBAAoB,KAAK,SAAS;YAC/C,OAAO,CAAC,oBAAoB,KAAK,YAAY,CAAC,oBAAoB,CAAC,CACpE,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tLoggingError,\n\ttagData,\n\tTelemetryDataTag,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ICompressionRuntimeOptions } from \"../containerRuntime.js\";\nimport { asBatchMetadata, type IBatchMetadata } from \"../metadata.js\";\nimport type { IPendingMessage } from \"../pendingStateManager.js\";\n\nimport { LocalBatchMessage, IBatchCheckpoint, type LocalBatch } from \"./definitions.js\";\nimport type { BatchStartInfo } from \"./remoteMessageProcessor.js\";\n\nexport interface IBatchManagerOptions {\n\treadonly compressionOptions?: ICompressionRuntimeOptions;\n\n\t/**\n\t * If true, the outbox is allowed to rebase the batch during flushing.\n\t */\n\treadonly canRebase: boolean;\n\n\t/**\n\t * If true, don't compare batchID of incoming batches to this. e.g. ID Allocation Batch IDs should be ignored\n\t */\n\treadonly ignoreBatchId?: boolean;\n}\n\nexport interface BatchSequenceNumbers {\n\treferenceSequenceNumber?: number;\n\tclientSequenceNumber?: number;\n}\n\n/**\n * Type alias for the batchId stored in batch metadata\n */\nexport type BatchId = string;\n\n/**\n * Compose original client ID and client sequence number into BatchId to stamp on the message during reconnect\n */\nexport function generateBatchId(originalClientId: string, batchStartCsn: number): BatchId {\n\treturn `${originalClientId}_[${batchStartCsn}]`;\n}\n\n/**\n * Get the effective batch ID for the input argument.\n * Supports either an IPendingMessage or BatchStartInfo.\n * If the batch ID is explicitly present, return it.\n * Otherwise, generate a new batch ID using the client ID and batch start CSN.\n */\nexport function getEffectiveBatchId(\n\tpendingMessageOrBatchStartInfo: IPendingMessage | BatchStartInfo,\n): string {\n\tif (\"localOpMetadata\" in pendingMessageOrBatchStartInfo) {\n\t\tconst pendingMessage: IPendingMessage = pendingMessageOrBatchStartInfo;\n\t\treturn (\n\t\t\tasBatchMetadata(pendingMessage.opMetadata)?.batchId ??\n\t\t\tgenerateBatchId(\n\t\t\t\tpendingMessage.batchInfo.clientId,\n\t\t\t\tpendingMessage.batchInfo.batchStartCsn,\n\t\t\t)\n\t\t);\n\t}\n\n\tconst batchStart: BatchStartInfo = pendingMessageOrBatchStartInfo;\n\treturn batchStart.batchId ?? generateBatchId(batchStart.clientId, batchStart.batchStartCsn);\n}\n\n/**\n * Helper class that manages partial batch & rollback.\n */\nexport class BatchManager {\n\tprivate pendingBatch: LocalBatchMessage[] = [];\n\tprivate hasReentrantOps = false;\n\n\tpublic get length(): number {\n\t\treturn this.pendingBatch.length;\n\t}\n\n\tpublic get sequenceNumbers(): BatchSequenceNumbers {\n\t\treturn {\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tclientSequenceNumber: this.clientSequenceNumber,\n\t\t};\n\t}\n\n\tprivate get referenceSequenceNumber(): number | undefined {\n\t\treturn this.pendingBatch.length === 0\n\t\t\t? undefined\n\t\t\t: // NOTE: In case of reentrant ops, there could be multiple reference sequence numbers, but we will rebase before submitting.\n\t\t\t\tthis.pendingBatch[this.pendingBatch.length - 1].referenceSequenceNumber;\n\t}\n\n\t/**\n\t * The last-processed CSN when this batch started.\n\t * This is used to ensure that while the batch is open, no incoming ops are processed.\n\t */\n\tprivate clientSequenceNumber: number | undefined;\n\n\tconstructor(public readonly options: IBatchManagerOptions) {}\n\n\tpublic push(\n\t\tmessage: LocalBatchMessage,\n\t\treentrant: boolean,\n\t\tcurrentClientSequenceNumber?: number,\n\t): void {\n\t\tthis.hasReentrantOps = this.hasReentrantOps || reentrant;\n\n\t\tif (this.pendingBatch.length === 0) {\n\t\t\tthis.clientSequenceNumber = currentClientSequenceNumber;\n\t\t}\n\n\t\tthis.pendingBatch.push(message);\n\t}\n\n\tpublic get empty(): boolean {\n\t\treturn this.pendingBatch.length === 0;\n\t}\n\n\t/**\n\t * Gets the pending batch and clears state for the next batch.\n\t */\n\tpublic popBatch(batchId?: BatchId): LocalBatch {\n\t\tconst batch: LocalBatch = {\n\t\t\tmessages: this.pendingBatch,\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\thasReentrantOps: this.hasReentrantOps,\n\t\t};\n\n\t\tthis.pendingBatch = [];\n\t\tthis.clientSequenceNumber = undefined;\n\t\tthis.hasReentrantOps = false;\n\n\t\treturn addBatchMetadata(batch, batchId);\n\t}\n\n\t/**\n\t * Capture the pending state at this point\n\t */\n\tpublic checkpoint(): IBatchCheckpoint {\n\t\tconst startSequenceNumber = this.clientSequenceNumber;\n\t\tconst startPoint = this.pendingBatch.length;\n\t\treturn {\n\t\t\trollback: (process: (message: LocalBatchMessage) => void) => {\n\t\t\t\tthis.clientSequenceNumber = startSequenceNumber;\n\t\t\t\tconst rollbackOpsLifo = this.pendingBatch.splice(startPoint).reverse();\n\t\t\t\tfor (const message of rollbackOpsLifo) {\n\t\t\t\t\tprocess(message);\n\t\t\t\t}\n\t\t\t\tconst count = this.pendingBatch.length - startPoint;\n\t\t\t\tif (count !== 0) {\n\t\t\t\t\tthrow new LoggingError(\"Ops generated during rollback\", {\n\t\t\t\t\t\tcount,\n\t\t\t\t\t\t...tagData(TelemetryDataTag.UserData, {\n\t\t\t\t\t\t\tops: JSON.stringify(\n\t\t\t\t\t\t\t\tthis.pendingBatch.slice(startPoint).map((b) => b.serializedOp),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n}\n\nconst addBatchMetadata = (batch: LocalBatch, batchId?: BatchId): LocalBatch => {\n\tconst batchEnd = batch.messages.length - 1;\n\n\tconst firstMsg = batch.messages[0];\n\tconst lastMsg = batch.messages[batchEnd];\n\tassert(\n\t\tfirstMsg !== undefined && lastMsg !== undefined,\n\t\t0x9d1 /* expected non-empty batch */,\n\t);\n\n\tconst firstMetadata: Partial<IBatchMetadata> = firstMsg.metadata ?? {};\n\tconst lastMetadata: Partial<IBatchMetadata> = lastMsg.metadata ?? {};\n\n\t// Multi-message batches: mark the first and last messages with the \"batch\" flag indicating batch start/end\n\tif (batch.messages.length > 1) {\n\t\tfirstMetadata.batch = true;\n\t\tlastMetadata.batch = false;\n\t\tfirstMsg.metadata = firstMetadata;\n\t\tlastMsg.metadata = lastMetadata;\n\t}\n\n\t// If batchId is provided (e.g. in case of resubmit): stamp it on the first message\n\tif (batchId !== undefined) {\n\t\tfirstMetadata.batchId = batchId;\n\t\tfirstMsg.metadata = firstMetadata;\n\t}\n\n\treturn batch;\n};\n\nexport const sequenceNumbersMatch = (\n\tseqNums: BatchSequenceNumbers,\n\totherSeqNums: BatchSequenceNumbers,\n): boolean => {\n\treturn (\n\t\t(seqNums.referenceSequenceNumber === undefined ||\n\t\t\totherSeqNums.referenceSequenceNumber === undefined ||\n\t\t\tseqNums.referenceSequenceNumber === otherSeqNums.referenceSequenceNumber) &&\n\t\t(seqNums.clientSequenceNumber === undefined ||\n\t\t\totherSeqNums.clientSequenceNumber === undefined ||\n\t\t\tseqNums.clientSequenceNumber === otherSeqNums.clientSequenceNumber)\n\t);\n};\n"]}
1
+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AAM,aAAa,GAA4B,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;IACvE,MAAM,YAAY,GAA4B,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;IAErE,2GAA2G;IAC3G,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,aAAa,CAAC,KAAK,GAAG,IAAI,CAAC;QAC3B,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;QAC3B,QAAQ,CAAC,QAAQ,GAAG,aAAa,CAAC;QAClC,OAAO,CAAC,QAAQ,GAAG,YAAY,CAAC;IACjC,CAAC;IAED,mFAAmF;IACnF,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3B,aAAa,CAAC,OAAO,GAAG,OAAO,CAAC;QAChC,QAAQ,CAAC,QAAQ,GAAG,aAAa,CAAC;IACnC,CAAC;IAED,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEK,MAAM,oBAAoB,GAAG,CACnC,OAA6B,EAC7B,YAAkC,EACxB,EAAE;IACZ,OAAO,CACN,CAAC,OAAO,CAAC,uBAAuB,KAAK,SAAS;QAC7C,YAAY,CAAC,uBAAuB,KAAK,SAAS;QAClD,OAAO,CAAC,uBAAuB,KAAK,YAAY,CAAC,uBAAuB,CAAC;QAC1E,CAAC,OAAO,CAAC,oBAAoB,KAAK,SAAS;YAC1C,YAAY,CAAC,oBAAoB,KAAK,SAAS;YAC/C,OAAO,CAAC,oBAAoB,KAAK,YAAY,CAAC,oBAAoB,CAAC,CACpE,CAAC;AACH,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert } from \"@fluidframework/core-utils/internal\";\nimport {\n\tLoggingError,\n\ttagData,\n\tTelemetryDataTag,\n} from \"@fluidframework/telemetry-utils/internal\";\n\nimport { ICompressionRuntimeOptions } from \"../compressionDefinitions.js\";\nimport { asBatchMetadata, type IBatchMetadata } from \"../metadata.js\";\nimport type { IPendingMessage } from \"../pendingStateManager.js\";\n\nimport { LocalBatchMessage, IBatchCheckpoint, type LocalBatch } from \"./definitions.js\";\nimport { serializeOp } from \"./opSerialization.js\";\nimport type { BatchStartInfo } from \"./remoteMessageProcessor.js\";\n\nexport interface IBatchManagerOptions {\n\treadonly compressionOptions?: ICompressionRuntimeOptions;\n\n\t/**\n\t * If true, the outbox is allowed to rebase the batch during flushing.\n\t */\n\treadonly canRebase: boolean;\n\n\t/**\n\t * If true, don't compare batchID of incoming batches to this. e.g. ID Allocation Batch IDs should be ignored\n\t */\n\treadonly ignoreBatchId?: boolean;\n}\n\nexport interface BatchSequenceNumbers {\n\treferenceSequenceNumber?: number;\n\tclientSequenceNumber?: number;\n}\n\n/**\n * Type alias for the batchId stored in batch metadata\n */\nexport type BatchId = string;\n\n/**\n * Compose original client ID and client sequence number into BatchId to stamp on the message during reconnect\n */\nexport function generateBatchId(originalClientId: string, batchStartCsn: number): BatchId {\n\treturn `${originalClientId}_[${batchStartCsn}]`;\n}\n\n/**\n * Get the effective batch ID for the input argument.\n * Supports either an IPendingMessage or BatchStartInfo.\n * If the batch ID is explicitly present, return it.\n * Otherwise, generate a new batch ID using the client ID and batch start CSN.\n */\nexport function getEffectiveBatchId(\n\tpendingMessageOrBatchStartInfo: IPendingMessage | BatchStartInfo,\n): string {\n\tif (\"localOpMetadata\" in pendingMessageOrBatchStartInfo) {\n\t\tconst pendingMessage: IPendingMessage = pendingMessageOrBatchStartInfo;\n\t\treturn (\n\t\t\tasBatchMetadata(pendingMessage.opMetadata)?.batchId ??\n\t\t\tgenerateBatchId(\n\t\t\t\tpendingMessage.batchInfo.clientId,\n\t\t\t\tpendingMessage.batchInfo.batchStartCsn,\n\t\t\t)\n\t\t);\n\t}\n\n\tconst batchStart: BatchStartInfo = pendingMessageOrBatchStartInfo;\n\treturn batchStart.batchId ?? generateBatchId(batchStart.clientId, batchStart.batchStartCsn);\n}\n\n/**\n * Helper class that manages partial batch & rollback.\n */\nexport class BatchManager {\n\tprivate pendingBatch: LocalBatchMessage[] = [];\n\tprivate hasReentrantOps = false;\n\n\tpublic get length(): number {\n\t\treturn this.pendingBatch.length;\n\t}\n\n\tpublic get sequenceNumbers(): BatchSequenceNumbers {\n\t\treturn {\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\tclientSequenceNumber: this.clientSequenceNumber,\n\t\t};\n\t}\n\n\tprivate get referenceSequenceNumber(): number | undefined {\n\t\treturn this.pendingBatch.length === 0\n\t\t\t? undefined\n\t\t\t: // NOTE: In case of reentrant ops, there could be multiple reference sequence numbers, but we will rebase before submitting.\n\t\t\t\tthis.pendingBatch[this.pendingBatch.length - 1].referenceSequenceNumber;\n\t}\n\n\t/**\n\t * The last-processed CSN when this batch started.\n\t * This is used to ensure that while the batch is open, no incoming ops are processed.\n\t */\n\tprivate clientSequenceNumber: number | undefined;\n\n\tconstructor(public readonly options: IBatchManagerOptions) {}\n\n\tpublic push(\n\t\tmessage: LocalBatchMessage,\n\t\treentrant: boolean,\n\t\tcurrentClientSequenceNumber?: number,\n\t): void {\n\t\tthis.hasReentrantOps = this.hasReentrantOps || reentrant;\n\n\t\tif (this.pendingBatch.length === 0) {\n\t\t\tthis.clientSequenceNumber = currentClientSequenceNumber;\n\t\t}\n\n\t\tthis.pendingBatch.push(message);\n\t}\n\n\tpublic get empty(): boolean {\n\t\treturn this.pendingBatch.length === 0;\n\t}\n\n\t/**\n\t * Gets the pending batch and clears state for the next batch.\n\t */\n\tpublic popBatch(batchId?: BatchId): LocalBatch {\n\t\tassert(this.pendingBatch[0] !== undefined, 0xb8a /* expected non-empty batch */);\n\t\tconst batch: LocalBatch = {\n\t\t\tmessages: this.pendingBatch,\n\t\t\treferenceSequenceNumber: this.referenceSequenceNumber,\n\t\t\thasReentrantOps: this.hasReentrantOps,\n\t\t\tstaged: this.pendingBatch[0].staged,\n\t\t};\n\n\t\tthis.pendingBatch = [];\n\t\tthis.clientSequenceNumber = undefined;\n\t\tthis.hasReentrantOps = false;\n\n\t\treturn addBatchMetadata(batch, batchId);\n\t}\n\n\t/**\n\t * Capture the pending state at this point\n\t */\n\tpublic checkpoint(): IBatchCheckpoint {\n\t\tconst startSequenceNumber = this.clientSequenceNumber;\n\t\tconst startPoint = this.pendingBatch.length;\n\t\treturn {\n\t\t\trollback: (process: (message: LocalBatchMessage) => void) => {\n\t\t\t\tthis.clientSequenceNumber = startSequenceNumber;\n\t\t\t\tconst rollbackOpsLifo = this.pendingBatch.splice(startPoint).reverse();\n\t\t\t\tfor (const message of rollbackOpsLifo) {\n\t\t\t\t\tprocess(message);\n\t\t\t\t}\n\t\t\t\tconst count = this.pendingBatch.length - startPoint;\n\t\t\t\tif (count !== 0) {\n\t\t\t\t\tthrow new LoggingError(\"Ops generated during rollback\", {\n\t\t\t\t\t\tcount,\n\t\t\t\t\t\t...tagData(TelemetryDataTag.UserData, {\n\t\t\t\t\t\t\tops: serializeOp(this.pendingBatch.slice(startPoint).map((b) => b.runtimeOp)),\n\t\t\t\t\t\t}),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t};\n\t}\n}\n\nconst addBatchMetadata = (batch: LocalBatch, batchId?: BatchId): LocalBatch => {\n\tconst batchEnd = batch.messages.length - 1;\n\n\tconst firstMsg = batch.messages[0];\n\tconst lastMsg = batch.messages[batchEnd];\n\tassert(\n\t\tfirstMsg !== undefined && lastMsg !== undefined,\n\t\t0x9d1 /* expected non-empty batch */,\n\t);\n\n\tconst firstMetadata: Partial<IBatchMetadata> = firstMsg.metadata ?? {};\n\tconst lastMetadata: Partial<IBatchMetadata> = lastMsg.metadata ?? {};\n\n\t// Multi-message batches: mark the first and last messages with the \"batch\" flag indicating batch start/end\n\tif (batch.messages.length > 1) {\n\t\tfirstMetadata.batch = true;\n\t\tlastMetadata.batch = false;\n\t\tfirstMsg.metadata = firstMetadata;\n\t\tlastMsg.metadata = lastMetadata;\n\t}\n\n\t// If batchId is provided (e.g. in case of resubmit): stamp it on the first message\n\tif (batchId !== undefined) {\n\t\tfirstMetadata.batchId = batchId;\n\t\tfirstMsg.metadata = firstMetadata;\n\t}\n\n\treturn batch;\n};\n\nexport const sequenceNumbersMatch = (\n\tseqNums: BatchSequenceNumbers,\n\totherSeqNums: BatchSequenceNumbers,\n): boolean => {\n\treturn (\n\t\t(seqNums.referenceSequenceNumber === undefined ||\n\t\t\totherSeqNums.referenceSequenceNumber === undefined ||\n\t\t\tseqNums.referenceSequenceNumber === otherSeqNums.referenceSequenceNumber) &&\n\t\t(seqNums.clientSequenceNumber === undefined ||\n\t\t\totherSeqNums.clientSequenceNumber === undefined ||\n\t\t\tseqNums.clientSequenceNumber === otherSeqNums.clientSequenceNumber)\n\t);\n};\n"]}