@fluidframework/container-runtime 2.0.0-internal.7.1.1 → 2.0.0-internal.7.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/api-extractor.json +1 -13
  3. package/api-report/container-runtime.api.md +72 -9
  4. package/dist/blobManager.d.ts +3 -3
  5. package/dist/blobManager.d.ts.map +1 -1
  6. package/dist/blobManager.js +41 -49
  7. package/dist/blobManager.js.map +1 -1
  8. package/dist/containerRuntime.d.ts +65 -19
  9. package/dist/containerRuntime.d.ts.map +1 -1
  10. package/dist/containerRuntime.js +52 -29
  11. package/dist/containerRuntime.js.map +1 -1
  12. package/dist/dataStore.js +2 -2
  13. package/dist/dataStore.js.map +1 -1
  14. package/dist/dataStoreContext.d.ts +8 -2
  15. package/dist/dataStoreContext.d.ts.map +1 -1
  16. package/dist/dataStoreContext.js +14 -3
  17. package/dist/dataStoreContext.js.map +1 -1
  18. package/dist/dataStoreRegistry.d.ts +3 -0
  19. package/dist/dataStoreRegistry.d.ts.map +1 -1
  20. package/dist/dataStoreRegistry.js +3 -0
  21. package/dist/dataStoreRegistry.js.map +1 -1
  22. package/dist/deltaManagerProxyBase.d.ts +1 -1
  23. package/dist/deltaManagerProxyBase.d.ts.map +1 -1
  24. package/dist/deltaManagerProxyBase.js +2 -2
  25. package/dist/deltaManagerProxyBase.js.map +1 -1
  26. package/dist/gc/gcDefinitions.d.ts +26 -5
  27. package/dist/gc/gcDefinitions.d.ts.map +1 -1
  28. package/dist/gc/gcDefinitions.js +4 -1
  29. package/dist/gc/gcDefinitions.js.map +1 -1
  30. package/dist/gc/gcSummaryDefinitions.d.ts +1 -1
  31. package/dist/gc/gcSummaryDefinitions.js.map +1 -1
  32. package/dist/gc/gcTelemetry.d.ts.map +1 -1
  33. package/dist/gc/gcTelemetry.js +4 -4
  34. package/dist/gc/gcTelemetry.js.map +1 -1
  35. package/dist/id-compressor/utilities.d.ts +3 -0
  36. package/dist/id-compressor/utilities.d.ts.map +1 -1
  37. package/dist/id-compressor/utilities.js +3 -0
  38. package/dist/id-compressor/utilities.js.map +1 -1
  39. package/dist/index.d.ts +3 -2
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +3 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/messageTypes.d.ts +4 -1
  44. package/dist/messageTypes.d.ts.map +1 -1
  45. package/dist/messageTypes.js +3 -0
  46. package/dist/messageTypes.js.map +1 -1
  47. package/dist/opLifecycle/definitions.d.ts +3 -0
  48. package/dist/opLifecycle/definitions.d.ts.map +1 -1
  49. package/dist/opLifecycle/definitions.js.map +1 -1
  50. package/dist/packageVersion.d.ts +1 -1
  51. package/dist/packageVersion.js +1 -1
  52. package/dist/packageVersion.js.map +1 -1
  53. package/dist/summary/orderedClientElection.d.ts +4 -1
  54. package/dist/summary/orderedClientElection.d.ts.map +1 -1
  55. package/dist/summary/orderedClientElection.js.map +1 -1
  56. package/dist/summary/runWhileConnectedCoordinator.d.ts +5 -0
  57. package/dist/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  58. package/dist/summary/runWhileConnectedCoordinator.js +1 -0
  59. package/dist/summary/runWhileConnectedCoordinator.js.map +1 -1
  60. package/dist/summary/summarizer.d.ts +1 -0
  61. package/dist/summary/summarizer.d.ts.map +1 -1
  62. package/dist/summary/summarizer.js +1 -0
  63. package/dist/summary/summarizer.js.map +1 -1
  64. package/dist/summary/summarizerTypes.d.ts +94 -10
  65. package/dist/summary/summarizerTypes.d.ts.map +1 -1
  66. package/dist/summary/summarizerTypes.js.map +1 -1
  67. package/dist/summary/summaryCollection.d.ts +16 -0
  68. package/dist/summary/summaryCollection.d.ts.map +1 -1
  69. package/dist/summary/summaryCollection.js +1 -0
  70. package/dist/summary/summaryCollection.js.map +1 -1
  71. package/dist/summary/summaryFormat.d.ts +10 -1
  72. package/dist/summary/summaryFormat.d.ts.map +1 -1
  73. package/dist/summary/summaryFormat.js.map +1 -1
  74. package/lib/blobManager.d.ts +3 -3
  75. package/lib/blobManager.d.ts.map +1 -1
  76. package/lib/blobManager.js +42 -50
  77. package/lib/blobManager.js.map +1 -1
  78. package/lib/containerRuntime.d.ts +65 -19
  79. package/lib/containerRuntime.d.ts.map +1 -1
  80. package/lib/containerRuntime.js +52 -29
  81. package/lib/containerRuntime.js.map +1 -1
  82. package/lib/dataStore.js +2 -2
  83. package/lib/dataStore.js.map +1 -1
  84. package/lib/dataStoreContext.d.ts +8 -2
  85. package/lib/dataStoreContext.d.ts.map +1 -1
  86. package/lib/dataStoreContext.js +14 -3
  87. package/lib/dataStoreContext.js.map +1 -1
  88. package/lib/dataStoreRegistry.d.ts +3 -0
  89. package/lib/dataStoreRegistry.d.ts.map +1 -1
  90. package/lib/dataStoreRegistry.js +3 -0
  91. package/lib/dataStoreRegistry.js.map +1 -1
  92. package/lib/deltaManagerProxyBase.d.ts +1 -1
  93. package/lib/deltaManagerProxyBase.d.ts.map +1 -1
  94. package/lib/deltaManagerProxyBase.js +2 -2
  95. package/lib/deltaManagerProxyBase.js.map +1 -1
  96. package/lib/gc/gcDefinitions.d.ts +26 -5
  97. package/lib/gc/gcDefinitions.d.ts.map +1 -1
  98. package/lib/gc/gcDefinitions.js +4 -1
  99. package/lib/gc/gcDefinitions.js.map +1 -1
  100. package/lib/gc/gcSummaryDefinitions.d.ts +1 -1
  101. package/lib/gc/gcSummaryDefinitions.js.map +1 -1
  102. package/lib/gc/gcTelemetry.d.ts.map +1 -1
  103. package/lib/gc/gcTelemetry.js +4 -4
  104. package/lib/gc/gcTelemetry.js.map +1 -1
  105. package/lib/id-compressor/utilities.d.ts +3 -0
  106. package/lib/id-compressor/utilities.d.ts.map +1 -1
  107. package/lib/id-compressor/utilities.js +3 -0
  108. package/lib/id-compressor/utilities.js.map +1 -1
  109. package/lib/index.d.ts +3 -2
  110. package/lib/index.d.ts.map +1 -1
  111. package/lib/index.js +1 -0
  112. package/lib/index.js.map +1 -1
  113. package/lib/messageTypes.d.ts +4 -1
  114. package/lib/messageTypes.d.ts.map +1 -1
  115. package/lib/messageTypes.js +3 -0
  116. package/lib/messageTypes.js.map +1 -1
  117. package/lib/opLifecycle/definitions.d.ts +3 -0
  118. package/lib/opLifecycle/definitions.d.ts.map +1 -1
  119. package/lib/opLifecycle/definitions.js.map +1 -1
  120. package/lib/packageVersion.d.ts +1 -1
  121. package/lib/packageVersion.js +1 -1
  122. package/lib/packageVersion.js.map +1 -1
  123. package/lib/summary/orderedClientElection.d.ts +4 -1
  124. package/lib/summary/orderedClientElection.d.ts.map +1 -1
  125. package/lib/summary/orderedClientElection.js.map +1 -1
  126. package/lib/summary/runWhileConnectedCoordinator.d.ts +5 -0
  127. package/lib/summary/runWhileConnectedCoordinator.d.ts.map +1 -1
  128. package/lib/summary/runWhileConnectedCoordinator.js +1 -0
  129. package/lib/summary/runWhileConnectedCoordinator.js.map +1 -1
  130. package/lib/summary/summarizer.d.ts +1 -0
  131. package/lib/summary/summarizer.d.ts.map +1 -1
  132. package/lib/summary/summarizer.js +1 -0
  133. package/lib/summary/summarizer.js.map +1 -1
  134. package/lib/summary/summarizerTypes.d.ts +94 -10
  135. package/lib/summary/summarizerTypes.d.ts.map +1 -1
  136. package/lib/summary/summarizerTypes.js.map +1 -1
  137. package/lib/summary/summaryCollection.d.ts +16 -0
  138. package/lib/summary/summaryCollection.d.ts.map +1 -1
  139. package/lib/summary/summaryCollection.js +1 -0
  140. package/lib/summary/summaryCollection.js.map +1 -1
  141. package/lib/summary/summaryFormat.d.ts +10 -1
  142. package/lib/summary/summaryFormat.d.ts.map +1 -1
  143. package/lib/summary/summaryFormat.js.map +1 -1
  144. package/package.json +19 -20
  145. package/src/blobManager.ts +58 -59
  146. package/src/containerRuntime.ts +79 -39
  147. package/src/dataStore.ts +2 -2
  148. package/src/dataStoreContext.ts +14 -3
  149. package/src/dataStoreRegistry.ts +3 -0
  150. package/src/deltaManagerProxyBase.ts +2 -2
  151. package/src/gc/gcDefinitions.ts +27 -5
  152. package/src/gc/gcSummaryDefinitions.ts +1 -1
  153. package/src/gc/gcTelemetry.ts +5 -4
  154. package/src/id-compressor/utilities.ts +3 -0
  155. package/src/index.ts +13 -1
  156. package/src/messageTypes.ts +4 -1
  157. package/src/opLifecycle/definitions.ts +3 -0
  158. package/src/packageVersion.ts +1 -1
  159. package/src/summary/orderedClientElection.ts +4 -1
  160. package/src/summary/runWhileConnectedCoordinator.ts +5 -1
  161. package/src/summary/summarizer.ts +1 -0
  162. package/src/summary/summarizerTypes.ts +95 -11
  163. package/src/summary/summaryCollection.ts +18 -1
  164. package/src/summary/summaryFormat.ts +11 -1
  165. package/dist/container-runtime-alpha.d.ts +0 -1554
  166. package/dist/container-runtime-beta.d.ts +0 -1554
  167. package/dist/container-runtime-public.d.ts +0 -1554
  168. package/dist/container-runtime.d.ts +0 -1611
  169. package/src/gc/gcEarlyAdoption.md +0 -145
@@ -25,6 +25,7 @@ import {
25
25
  ILoaderOptions,
26
26
  ILoader,
27
27
  LoaderHeader,
28
+ IGetPendingLocalStateProps,
28
29
  } from "@fluidframework/container-definitions";
29
30
  import {
30
31
  IContainerRuntime,
@@ -221,6 +222,9 @@ function prepareLocalContainerRuntimeIdAllocationMessageForTransit(
221
222
  }
222
223
  }
223
224
 
225
+ /**
226
+ * @public
227
+ */
224
228
  export interface ISummaryBaseConfiguration {
225
229
  /**
226
230
  * Delay before first attempt to spawn summarizing container.
@@ -240,6 +244,9 @@ export interface ISummaryBaseConfiguration {
240
244
  maxOpsSinceLastSummary: number;
241
245
  }
242
246
 
247
+ /**
248
+ * @public
249
+ */
243
250
  export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfiguration {
244
251
  state: "enabled";
245
252
  /**
@@ -300,19 +307,31 @@ export interface ISummaryConfigurationHeuristics extends ISummaryBaseConfigurati
300
307
  nonRuntimeHeuristicThreshold?: number;
301
308
  }
302
309
 
310
+ /**
311
+ * @public
312
+ */
303
313
  export interface ISummaryConfigurationDisableSummarizer {
304
314
  state: "disabled";
305
315
  }
306
316
 
317
+ /**
318
+ * @public
319
+ */
307
320
  export interface ISummaryConfigurationDisableHeuristics extends ISummaryBaseConfiguration {
308
321
  state: "disableHeuristics";
309
322
  }
310
323
 
324
+ /**
325
+ * @public
326
+ */
311
327
  export type ISummaryConfiguration =
312
328
  | ISummaryConfigurationDisableSummarizer
313
329
  | ISummaryConfigurationDisableHeuristics
314
330
  | ISummaryConfigurationHeuristics;
315
331
 
332
+ /**
333
+ * @public
334
+ */
316
335
  export const DefaultSummaryConfiguration: ISummaryConfiguration = {
317
336
  state: "enabled",
318
337
 
@@ -339,6 +358,9 @@ export const DefaultSummaryConfiguration: ISummaryConfiguration = {
339
358
  nonRuntimeHeuristicThreshold: 20,
340
359
  };
341
360
 
361
+ /**
362
+ * @public
363
+ */
342
364
  export interface ISummaryRuntimeOptions {
343
365
  /** Override summary configurations set by the server. */
344
366
  summaryConfigOverrides?: ISummaryConfiguration;
@@ -354,6 +376,7 @@ export interface ISummaryRuntimeOptions {
354
376
 
355
377
  /**
356
378
  * Options for op compression.
379
+ * @public
357
380
  */
358
381
  export interface ICompressionRuntimeOptions {
359
382
  /**
@@ -371,6 +394,7 @@ export interface ICompressionRuntimeOptions {
371
394
 
372
395
  /**
373
396
  * Options for container runtime.
397
+ * @public
374
398
  */
375
399
  export interface IContainerRuntimeOptions {
376
400
  readonly summaryOptions?: ISummaryRuntimeOptions;
@@ -452,6 +476,7 @@ export interface IContainerRuntimeOptions {
452
476
 
453
477
  /**
454
478
  * Accepted header keys for requests coming to the runtime.
479
+ * @public
455
480
  */
456
481
  export enum RuntimeHeaders {
457
482
  /** True to wait for a data store to be created and loaded before returning it. */
@@ -460,14 +485,25 @@ export enum RuntimeHeaders {
460
485
  viaHandle = "viaHandle",
461
486
  }
462
487
 
463
- /** True if a tombstoned object should be returned without erroring */
488
+ /** True if a tombstoned object should be returned without erroring
489
+ * @public
490
+ */
464
491
  export const AllowTombstoneRequestHeaderKey = "allowTombstone"; // Belongs in the enum above, but avoiding the breaking change
465
- /** [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring */
492
+ /**
493
+ * [IRRELEVANT IF throwOnInactiveLoad OPTION NOT SET] True if an inactive object should be returned without erroring
494
+ * @public
495
+ */
466
496
  export const AllowInactiveRequestHeaderKey = "allowInactive"; // Belongs in the enum above, but avoiding the breaking change
467
497
 
468
- /** Tombstone error responses will have this header set to true */
498
+ /**
499
+ * Tombstone error responses will have this header set to true
500
+ * @public
501
+ */
469
502
  export const TombstoneResponseHeaderKey = "isTombstoned";
470
- /** Inactive error responses will have this header set to true */
503
+ /**
504
+ * Inactive error responses will have this header set to true
505
+ * @public
506
+ */
471
507
  export const InactiveResponseHeaderKey = "isInactive";
472
508
 
473
509
  /**
@@ -490,6 +526,7 @@ export const defaultRuntimeHeaderData: Required<RuntimeHeaderData> = {
490
526
 
491
527
  /**
492
528
  * Available compression algorithms for op compression.
529
+ * @public
493
530
  */
494
531
  export enum CompressionAlgorithms {
495
532
  lz4 = "lz4",
@@ -553,7 +590,8 @@ export const defaultPendingOpsRetryDelayMs = 1000;
553
590
  const defaultCloseSummarizerDelayMs = 5000; // 5 seconds
554
591
 
555
592
  /**
556
- * @deprecated - use ContainerRuntimeMessageType instead
593
+ * @deprecated use ContainerRuntimeMessageType instead
594
+ * @public
557
595
  */
558
596
  export enum RuntimeMessage {
559
597
  FluidDataStoreOp = "component",
@@ -566,7 +604,8 @@ export enum RuntimeMessage {
566
604
  }
567
605
 
568
606
  /**
569
- * @deprecated - please use version in driver-utils
607
+ * @deprecated please use version in driver-utils
608
+ * @public
570
609
  */
571
610
  export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
572
611
  return (Object.values(RuntimeMessage) as string[]).includes(message.type);
@@ -576,6 +615,7 @@ export function isRuntimeMessage(message: ISequencedDocumentMessage): boolean {
576
615
  * Legacy ID for the built-in AgentScheduler. To minimize disruption while removing it, retaining this as a
577
616
  * special-case for document dirty state. Ultimately we should have no special-cases from the
578
617
  * ContainerRuntime's perspective.
618
+ * @public
579
619
  */
580
620
  export const agentSchedulerId = "_scheduler";
581
621
 
@@ -675,6 +715,7 @@ async function createSummarizer(loader: ILoader, url: string): Promise<ISummariz
675
715
 
676
716
  /**
677
717
  * This function is not supported publicly and exists for e2e testing
718
+ * @internal
678
719
  */
679
720
  export async function TEST_requestSummarizer(loader: ILoader, url: string): Promise<ISummarizer> {
680
721
  return createSummarizer(loader, url);
@@ -683,6 +724,7 @@ export async function TEST_requestSummarizer(loader: ILoader, url: string): Prom
683
724
  /**
684
725
  * Represents the runtime of the container. Contains helper functions/state of the container.
685
726
  * It will define the store level mappings.
727
+ * @public
686
728
  */
687
729
  export class ContainerRuntime
688
730
  extends TypedEventEmitter<IContainerRuntimeEvents & ISummarizerEvents>
@@ -694,14 +736,14 @@ export class ContainerRuntime
694
736
  IProvideFluidHandleContext
695
737
  {
696
738
  /**
697
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
739
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
698
740
  */
699
741
  public get IFluidRouter() {
700
742
  return this;
701
743
  }
702
744
 
703
745
  /**
704
- * @deprecated - use loadRuntime instead.
746
+ * @deprecated use loadRuntime instead.
705
747
  * Load the stores from a snapshot and returns the runtime.
706
748
  * @param context - Context of the container.
707
749
  * @param registryEntries - Mapping to the stores.
@@ -949,7 +991,7 @@ export class ContainerRuntime
949
991
  summaryOp: ISummaryContent,
950
992
  referenceSequenceNumber?: number,
951
993
  ) => number;
952
- private readonly submitSignalFn: (contents: any) => void;
994
+ private readonly submitSignalFn: (content: any, targetClientId?: string) => void;
953
995
  public readonly disposeFn: (error?: ICriticalContainerError) => void;
954
996
  public readonly closeFn: (error?: ICriticalContainerError) => void;
955
997
 
@@ -1727,7 +1769,7 @@ export class ContainerRuntime
1727
1769
  /**
1728
1770
  * Notifies this object about the request made to the container.
1729
1771
  * @param request - Request made to the handler.
1730
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
1772
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
1731
1773
  */
1732
1774
  public async request(request: IRequest): Promise<IResponse> {
1733
1775
  try {
@@ -2399,7 +2441,7 @@ export class ContainerRuntime
2399
2441
  * Returns the runtime of the data store.
2400
2442
  * @param id - Id supplied during creating the data store.
2401
2443
  * @param wait - True if you want to wait for it.
2402
- * @deprecated - Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
2444
+ * @deprecated Use getAliasedDataStoreEntryPoint instead to get an aliased data store's entry point.
2403
2445
  */
2404
2446
  // eslint-disable-next-line import/no-deprecated
2405
2447
  public async getRootDataStore(id: string, wait = true): Promise<IFluidRouter> {
@@ -2632,16 +2674,28 @@ export class ContainerRuntime
2632
2674
  * Submits the signal to be sent to other clients.
2633
2675
  * @param type - Type of the signal.
2634
2676
  * @param content - Content of the signal.
2677
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
2635
2678
  */
2636
- public submitSignal(type: string, content: any) {
2679
+ public submitSignal(type: string, content: any, targetClientId?: string) {
2637
2680
  this.verifyNotClosed();
2638
2681
  const envelope = this.createNewSignalEnvelope(undefined /* address */, type, content);
2639
- return this.submitSignalFn(envelope);
2682
+ return this.submitSignalFn(envelope, targetClientId);
2640
2683
  }
2641
2684
 
2642
- public submitDataStoreSignal(address: string, type: string, content: any) {
2685
+ /**
2686
+ * Submits the signal to be sent to other clients.
2687
+ * @param type - Type of the signal.
2688
+ * @param content - Content of the signal.
2689
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
2690
+ */
2691
+ public submitDataStoreSignal(
2692
+ address: string,
2693
+ type: string,
2694
+ content: any,
2695
+ targetClientId?: string,
2696
+ ) {
2643
2697
  const envelope = this.createNewSignalEnvelope(address, type, content);
2644
- return this.submitSignalFn(envelope);
2698
+ return this.submitSignalFn(envelope, targetClientId);
2645
2699
  }
2646
2700
 
2647
2701
  public setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void {
@@ -2840,7 +2894,7 @@ export class ContainerRuntime
2840
2894
  }
2841
2895
 
2842
2896
  /**
2843
- * @deprecated - Replaced by deleteSweepReadyNodes.
2897
+ * @deprecated Replaced by deleteSweepReadyNodes.
2844
2898
  */
2845
2899
  public deleteUnusedNodes(unusedRoutes: string[]): string[] {
2846
2900
  throw new Error("deleteUnusedRoutes should not be called");
@@ -3760,7 +3814,7 @@ export class ContainerRuntime
3760
3814
  * and then close as the current main client is likely to be re-elected as the parent summarizer again.
3761
3815
  */
3762
3816
  if (!result.isSummaryTracked && result.isSummaryNewer) {
3763
- const fetchResult = await this.fetchSnapshotFromStorage(
3817
+ const fetchResult = await this.fetchLatestSnapshotFromStorage(
3764
3818
  summaryLogger,
3765
3819
  {
3766
3820
  eventName: "RefreshLatestSummaryAckFetch",
@@ -3768,7 +3822,6 @@ export class ContainerRuntime
3768
3822
  targetSequenceNumber: summaryRefSeq,
3769
3823
  },
3770
3824
  readAndParseBlob,
3771
- null,
3772
3825
  );
3773
3826
 
3774
3827
  /**
@@ -3817,13 +3870,12 @@ export class ContainerRuntime
3817
3870
 
3818
3871
  // This is a performance optimization as the same parent is likely to be elected again, and would use its
3819
3872
  // cache to fetch the snapshot instead of the network.
3820
- await this.fetchSnapshotFromStorage(
3873
+ await this.fetchLatestSnapshotFromStorage(
3821
3874
  summaryLogger,
3822
3875
  {
3823
3876
  eventName: "RefreshLatestSummaryFromServerFetch",
3824
3877
  },
3825
3878
  readAndParseBlob,
3826
- null,
3827
3879
  );
3828
3880
 
3829
3881
  await this.closeStaleSummarizer("RefreshLatestSummaryFromServerFetch");
@@ -3837,16 +3889,6 @@ export class ContainerRuntime
3837
3889
  }
3838
3890
 
3839
3891
  private async closeStaleSummarizer(codePath: string): Promise<void> {
3840
- this.mc.logger.sendTelemetryEvent(
3841
- {
3842
- eventName: "ClosingSummarizerOnSummaryStale",
3843
- codePath,
3844
- message: "Stopping fetch from storage",
3845
- closeSummarizerDelayMs: this.closeSummarizerDelayMs,
3846
- },
3847
- new GenericError("Restarting summarizer instead of refreshing"),
3848
- );
3849
-
3850
3892
  // Delay before restarting summarizer to prevent the summarizer from restarting too frequently.
3851
3893
  await delay(this.closeSummarizerDelayMs);
3852
3894
  this._summarizer?.stop("latestSummaryStateStale");
@@ -3854,15 +3896,14 @@ export class ContainerRuntime
3854
3896
  }
3855
3897
 
3856
3898
  /**
3857
- * Downloads snapshot from storage with the given versionId or latest if versionId is null.
3899
+ * Downloads the latest snapshot from storage.
3858
3900
  * By default, it also closes the container after downloading the snapshot. However, this may be
3859
3901
  * overridden via options.
3860
3902
  */
3861
- private async fetchSnapshotFromStorage(
3903
+ private async fetchLatestSnapshotFromStorage(
3862
3904
  logger: ITelemetryLoggerExt,
3863
3905
  event: ITelemetryGenericEvent,
3864
3906
  readAndParseBlob: ReadAndParseBlob,
3865
- versionId: string | null,
3866
3907
  ): Promise<{ snapshotTree: ISnapshotTree; versionId: string; latestSnapshotRefSeq: number }> {
3867
3908
  return PerformanceEvent.timedExecAsync(
3868
3909
  logger,
@@ -3884,10 +3925,10 @@ export class ContainerRuntime
3884
3925
  const trace = Trace.start();
3885
3926
 
3886
3927
  const versions = await this.storage.getVersions(
3887
- versionId,
3928
+ null,
3888
3929
  1,
3889
3930
  "prefetchLatestSummaryBeforeClose",
3890
- versionId === null ? FetchSource.noCache : undefined,
3931
+ FetchSource.noCache,
3891
3932
  );
3892
3933
  assert(
3893
3934
  !!versions && !!versions[0],
@@ -3914,9 +3955,7 @@ export class ContainerRuntime
3914
3955
 
3915
3956
  public notifyAttaching() {} // do nothing (deprecated method)
3916
3957
 
3917
- public async getPendingLocalState(props?: {
3918
- notifyImminentClosure: boolean;
3919
- }): Promise<unknown> {
3958
+ public async getPendingLocalState(props?: IGetPendingLocalStateProps): Promise<unknown> {
3920
3959
  return PerformanceEvent.timedExecAsync(
3921
3960
  this.mc.logger,
3922
3961
  {
@@ -3926,6 +3965,7 @@ export class ContainerRuntime
3926
3965
  async (event) => {
3927
3966
  this.verifyNotClosed();
3928
3967
  const waitBlobsToAttach = props?.notifyImminentClosure;
3968
+ const stopBlobAttachingSignal = props?.stopBlobAttachingSignal;
3929
3969
  if (this._orderSequentiallyCalls !== 0) {
3930
3970
  throw new UsageError("can't get state during orderSequentially");
3931
3971
  }
@@ -3934,7 +3974,7 @@ export class ContainerRuntime
3934
3974
  // to close current batch.
3935
3975
  this.flush();
3936
3976
  const pendingAttachmentBlobs = waitBlobsToAttach
3937
- ? await this.blobManager.attachAndGetPendingBlobs()
3977
+ ? await this.blobManager.attachAndGetPendingBlobs(stopBlobAttachingSignal)
3938
3978
  : undefined;
3939
3979
  const pending = this.pendingStateManager.getLocalState();
3940
3980
  if (!pendingAttachmentBlobs && !this.hasPendingMessages()) {
package/src/dataStore.ts CHANGED
@@ -161,7 +161,7 @@ class DataStore implements IDataStore {
161
161
  }
162
162
 
163
163
  /**
164
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
164
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
165
165
  */
166
166
  public async request(request: IRequest): Promise<IResponse> {
167
167
  return this.fluidDataStoreChannel.request(request);
@@ -185,7 +185,7 @@ class DataStore implements IDataStore {
185
185
  }
186
186
 
187
187
  /**
188
- * @deprecated - Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
188
+ * @deprecated Will be removed in future major release. Migrate all usage of IFluidRouter to the "entryPoint" pattern. Refer to Removing-IFluidRouter.md
189
189
  */
190
190
  public get IFluidRouter() {
191
191
  return this.fluidDataStoreChannel;
@@ -454,6 +454,11 @@ export abstract class FluidDataStoreContext
454
454
  const channel = await factory.instantiateDataStore(this, existing);
455
455
  assert(channel !== undefined, 0x140 /* "undefined channel on datastore context" */);
456
456
  this.bindRuntime(channel);
457
+ // This data store may have been disposed before the channel is created during realization. If so,
458
+ // dispose the channel now.
459
+ if (this.disposed) {
460
+ channel.dispose();
461
+ }
457
462
  }
458
463
 
459
464
  /**
@@ -725,11 +730,17 @@ export abstract class FluidDataStoreContext
725
730
  }
726
731
  }
727
732
 
728
- public submitSignal(type: string, content: any) {
733
+ /**
734
+ * Submits the signal to be sent to other clients.
735
+ * @param type - Type of the signal.
736
+ * @param content - Content of the signal.
737
+ * @param targetClientId - When specified, the signal is only sent to the provided client id.
738
+ */
739
+ public submitSignal(type: string, content: any, targetClientId?: string) {
729
740
  this.verifyNotClosed("submitSignal");
730
741
 
731
742
  assert(!!this.channel, 0x147 /* "Channel must exist on submitting signal" */);
732
- return this._containerRuntime.submitDataStoreSignal(this.id, type, content);
743
+ return this._containerRuntime.submitDataStoreSignal(this.id, type, content, targetClientId);
733
744
  }
734
745
 
735
746
  /**
@@ -820,7 +831,7 @@ export abstract class FluidDataStoreContext
820
831
  }
821
832
 
822
833
  /**
823
- * @deprecated - The functionality to get base GC details has been moved to summarizer node.
834
+ * @deprecated The functionality to get base GC details has been moved to summarizer node.
824
835
  */
825
836
  public async getBaseGCDetails(): Promise<IGarbageCollectionDetailsBase> {
826
837
  return {};
@@ -9,6 +9,9 @@ import {
9
9
  NamedFluidDataStoreRegistryEntries,
10
10
  } from "@fluidframework/runtime-definitions";
11
11
 
12
+ /**
13
+ * @public
14
+ */
12
15
  export class FluidDataStoreRegistry implements IFluidDataStoreRegistry {
13
16
  private readonly map: Map<
14
17
  string,
@@ -101,8 +101,8 @@ export class DeltaManagerProxyBase
101
101
  super.dispose();
102
102
  }
103
103
 
104
- public submitSignal(content: any): void {
105
- return this.deltaManager.submitSignal(content);
104
+ public submitSignal(content: any, targetClientId?: string): void {
105
+ return this.deltaManager.submitSignal(content, targetClientId);
106
106
  }
107
107
 
108
108
  public flush(): void {
@@ -21,6 +21,9 @@ import {
21
21
  } from "../summary";
22
22
  import { RuntimeHeaderData } from "../containerRuntime";
23
23
 
24
+ /**
25
+ * @public
26
+ */
24
27
  export type GCVersion = number;
25
28
 
26
29
  /** The stable/default version of GC Data */
@@ -81,7 +84,10 @@ export const maxSnapshotCacheExpiryMs = 5 * oneDayMs;
81
84
  export const defaultInactiveTimeoutMs = 7 * oneDayMs; // 7 days
82
85
  export const defaultSessionExpiryDurationMs = 30 * oneDayMs; // 30 days
83
86
 
84
- /** @see IGCMetadata.gcFeatureMatrix */
87
+ /**
88
+ * @see IGCMetadata.gcFeatureMatrix
89
+ * @public
90
+ */
85
91
  export interface GCFeatureMatrix {
86
92
  /**
87
93
  * The Tombstone Generation value in effect when this file was created.
@@ -97,6 +103,9 @@ export interface GCFeatureMatrix {
97
103
  sweepGeneration?: number;
98
104
  }
99
105
 
106
+ /**
107
+ * @public
108
+ */
100
109
  export interface IGCMetadata {
101
110
  /**
102
111
  * The version of the GC code that was run to generate the GC data that is written in the summary.
@@ -120,11 +129,11 @@ export interface IGCMetadata {
120
129
  */
121
130
  readonly gcFeatureMatrix?: GCFeatureMatrix;
122
131
  /**
123
- * @deprecated - @see GCFeatureMatrix.sweepGeneration
124
- *
125
132
  * Tells whether the GC sweep phase is enabled for this container.
126
133
  * - True means sweep phase is enabled.
127
134
  * - False means sweep phase is disabled. If GC is disabled as per gcFeature, sweep is also disabled.
135
+ *
136
+ * @deprecated use GCFeatureMatrix.sweepGeneration instead. @see GCFeatureMatrix.sweepGeneration
128
137
  */
129
138
  readonly sweepEnabled?: boolean;
130
139
  /** If this is present, the session for this container will expire after this time and the container will close */
@@ -133,7 +142,10 @@ export interface IGCMetadata {
133
142
  readonly sweepTimeoutMs?: number;
134
143
  }
135
144
 
136
- /** The statistics of the system state after a garbage collection run. */
145
+ /**
146
+ * The statistics of the system state after a garbage collection run.
147
+ * @public
148
+ */
137
149
  export interface IGCStats {
138
150
  /** The number of nodes in the container. */
139
151
  nodeCount: number;
@@ -155,7 +167,10 @@ export interface IGCStats {
155
167
  updatedAttachmentBlobCount: number;
156
168
  }
157
169
 
158
- /** The types of GC nodes in the GC reference graph. */
170
+ /**
171
+ * The types of GC nodes in the GC reference graph.
172
+ * @public
173
+ */
159
174
  export const GCNodeType = {
160
175
  // Nodes that are for data stores.
161
176
  DataStore: "DataStore",
@@ -166,6 +181,10 @@ export const GCNodeType = {
166
181
  // Nodes that are neither of the above. For example, root node.
167
182
  Other: "Other",
168
183
  };
184
+
185
+ /**
186
+ * @public
187
+ */
169
188
  export type GCNodeType = (typeof GCNodeType)[keyof typeof GCNodeType];
170
189
 
171
190
  /**
@@ -269,6 +288,9 @@ export interface IGarbageCollectorCreateParams {
269
288
  readonly activeConnection: () => boolean;
270
289
  }
271
290
 
291
+ /**
292
+ * @public
293
+ */
272
294
  export interface IGCRuntimeOptions {
273
295
  /**
274
296
  * Flag that if true, will enable running garbage collection (GC) for a new container.
@@ -41,7 +41,7 @@ export interface IGarbageCollectionSnapshotData {
41
41
  }
42
42
 
43
43
  /**
44
- * @deprecated - IGarbageCollectionState is written in the root of the summary now.
44
+ * @deprecated IGarbageCollectionState is written in the root of the summary now.
45
45
  * Legacy GC details from when the GC details were written at the data store's summary tree.
46
46
  */
47
47
  export interface IGarbageCollectionSummaryDetailsLegacy {
@@ -114,12 +114,13 @@ export class GCTelemetryTracker {
114
114
  return false;
115
115
  }
116
116
 
117
- // For sub data store (DDS) nodes, if they are changed or loaded, its data store will also be changed or loaded,
118
- // so skip logging to make the telemetry less noisy.
119
- if (nodeType === GCNodeType.SubDataStore && usageType !== "Revived") {
117
+ if (nodeType === GCNodeType.Other) {
120
118
  return false;
121
119
  }
122
- if (nodeType === GCNodeType.Other) {
120
+
121
+ // For sub data store (DDS) nodes, if they are changed, its data store will also be changed,
122
+ // so skip logging to make the telemetry less noisy.
123
+ if (nodeType === GCNodeType.SubDataStore && usageType === "Changed") {
123
124
  return false;
124
125
  }
125
126
 
@@ -35,6 +35,7 @@ export function createSessionId(): SessionId {
35
35
 
36
36
  /**
37
37
  * Asserts that the given string is a stable ID.
38
+ * @public
38
39
  */
39
40
  export function assertIsStableId(stableId: string): StableId {
40
41
  assert(isStableId(stableId), 0x4a3 /* Expected a StableId */);
@@ -51,6 +52,7 @@ export function assertIsSessionId(stableId: string): SessionId {
51
52
 
52
53
  /**
53
54
  * Generate a random stable ID
55
+ * @public
54
56
  */
55
57
  export function generateStableId(): StableId {
56
58
  return assertIsStableId(v4());
@@ -59,6 +61,7 @@ export function generateStableId(): StableId {
59
61
  /**
60
62
  * Returns true iff the given string is a valid Version 4, variant 2 UUID
61
63
  * 'xxxxxxxx-xxxx-4xxx-vxxx-xxxxxxxxxxxx'
64
+ * @public
62
65
  */
63
66
  export function isStableId(str: string): str is StableId {
64
67
  if (str.length !== 36) {
package/src/index.ts CHANGED
@@ -32,8 +32,16 @@ export {
32
32
  CompatModeBehavior,
33
33
  RecentlyAddedContainerRuntimeMessageDetails,
34
34
  } from "./messageTypes";
35
+ export { IBlobManagerLoadInfo } from "./blobManager";
35
36
  export { FluidDataStoreRegistry } from "./dataStoreRegistry";
36
- export { IGCRuntimeOptions, IGCStats } from "./gc";
37
+ export {
38
+ GCNodeType,
39
+ IGCMetadata,
40
+ GCFeatureMatrix,
41
+ GCVersion,
42
+ IGCRuntimeOptions,
43
+ IGCStats,
44
+ } from "./gc";
37
45
  export {
38
46
  IAckedSummary,
39
47
  ISummarizer,
@@ -49,6 +57,8 @@ export {
49
57
  IBroadcastSummaryResult,
50
58
  ICancellationToken,
51
59
  IConnectableRuntime,
60
+ IContainerRuntimeMetadata,
61
+ ICreateContainerMetadata,
52
62
  IEnqueueSummarizeOptions,
53
63
  IGenerateSummaryTreeResult,
54
64
  IGeneratedSummaryStats,
@@ -57,6 +67,7 @@ export {
57
67
  IRefreshSummaryAckOptions,
58
68
  ISubmitSummaryOpResult,
59
69
  ISubmitSummaryOptions,
70
+ ISerializedElection,
60
71
  ISummarizeOptions,
61
72
  ISummarizerEvents,
62
73
  ISummarizerInternalsProvider,
@@ -69,6 +80,7 @@ export {
69
80
  ISummary,
70
81
  ISummaryCollectionOpEvents,
71
82
  ISummaryAckMessage,
83
+ ISummaryMetadataMessage,
72
84
  ISummaryNackMessage,
73
85
  ISummaryOpMessage,
74
86
  OpActionEventListener,
@@ -14,6 +14,9 @@ import {
14
14
  import { IDataStoreAliasMessage } from "./dataStore";
15
15
  import { IChunkedOp } from "./opLifecycle";
16
16
 
17
+ /**
18
+ * @public
19
+ */
17
20
  export enum ContainerMessageType {
18
21
  // An op to be delivered to store
19
22
  FluidDataStoreOp = "component",
@@ -210,7 +213,7 @@ export type InboundSequencedRecentlyAddedContainerRuntimeMessage = ISequencedDoc
210
213
  * IMPORTANT: when creating one to be serialized, set the properties in the order they appear here.
211
214
  * This way stringified values can be compared.
212
215
  *
213
- * @deprecated - this is an internal type which should not be used outside of the package.
216
+ * @deprecated this is an internal type which should not be used outside of the package.
214
217
  * Internally, it is superseded by `TypedContainerRuntimeMessage`.
215
218
  *
216
219
  * @internal
@@ -52,6 +52,9 @@ export interface IBatchCheckpoint {
52
52
  rollback: (action: (message: BatchMessage) => void) => void;
53
53
  }
54
54
 
55
+ /**
56
+ * @public
57
+ */
55
58
  export interface IChunkedOp {
56
59
  chunkId: number;
57
60
  totalChunks: number;
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/container-runtime";
9
- export const pkgVersion = "2.0.0-internal.7.1.1";
9
+ export const pkgVersion = "2.0.0-internal.7.2.1";
@@ -225,7 +225,10 @@ export interface IOrderedClientElectionEvents extends IEvent {
225
225
  );
226
226
  }
227
227
 
228
- /** Serialized state of IOrderedClientElection. */
228
+ /**
229
+ * Serialized state of IOrderedClientElection.
230
+ * @public
231
+ */
229
232
  export interface ISerializedElection {
230
233
  /** Sequence number at the time of the latest election. */
231
234
  readonly electionSequenceNumber: number;