Skip to main content

ISummarizerNodeWithGC Interface

Extends the functionality of ISummarizerNode to support garbage collection. It adds / updates the following APIs:

usedRoutes: The routes in this node that are currently in use.

getGCData: A new API that can be used to get the garbage collection data for this node.

summarize: Added a trackState flag which indicates whether the summarizer node should track the state of the summary or not.

createChild: Added the following params:

  • getGCDataFn: This gets the GC data from the caller. This must be provided in order for getGCData to work.

  • getInitialGCDetailsFn: This gets the initial GC details from the caller.

deleteChild: Deletes a child node.

isReferenced: This tells whether this node is referenced in the document or not.

updateUsedRoutes: Used to notify this node of routes that are currently in use in it.

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/runtime-definitions/legacy.

For more information about our API support guarantees, see here.

Signature

export interface ISummarizerNodeWithGC extends ISummarizerNode

Extends: ISummarizerNode

Methods

Method Alerts Return Type Description
createChild(summarizeInternalFn, id, createParam, config, getGCDataFn, getBaseGCDetailsFn) Alpha ISummarizerNodeWithGC
deleteChild(id) Alpha void Delete the child with the given id..
getChild(id) Alpha ISummarizerNodeWithGC | undefined
getGCData(fullGC) Alpha Promise<IGarbageCollectionData> Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent this node. Each node has a set of outbound routes to other GC nodes in the document.
isReferenced() Alpha boolean Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
updateUsedRoutes(usedRoutes) Alpha void After GC has run, called to notify this node of routes that are used in it. These are used for the following: 1. To identify if this node is being referenced in the document or not. 2. To identify if this node or any of its children's used routes changed since last summary.

Method Details

createChild

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/runtime-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

createChild(
summarizeInternalFn: SummarizeInternalFn,
id: string,
createParam: CreateChildSummarizerNodeParam,
config?: ISummarizerNodeConfigWithGC, getGCDataFn?: (fullGC?: boolean) => Promise<IGarbageCollectionData>,
getBaseGCDetailsFn?: () => Promise<IGarbageCollectionDetailsBase>): ISummarizerNodeWithGC;

Parameters

Parameter Modifiers Type Description
summarizeInternalFn SummarizeInternalFn
id string
createParam CreateChildSummarizerNodeParam
config optional ISummarizerNodeConfigWithGC
getGCDataFn optional (fullGC?: boolean) => Promise<IGarbageCollectionData>
getBaseGCDetailsFn optional () => Promise<IGarbageCollectionDetailsBase>

Returns

Return type: ISummarizerNodeWithGC

deleteChild

Delete the child with the given id..

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/runtime-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

deleteChild(id: string): void;

Parameters

Parameter Type Description
id string

getChild

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/runtime-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

getChild(id: string): ISummarizerNodeWithGC | undefined;

Parameters

Parameter Type Description
id string

Returns

Return type: ISummarizerNodeWithGC | undefined

getGCData

Returns this node's data that is used for garbage collection. This includes a list of GC nodes that represent this node. Each node has a set of outbound routes to other GC nodes in the document.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/runtime-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

getGCData(fullGC?: boolean): Promise<IGarbageCollectionData>;

Parameters

Parameter Modifiers Type Description
fullGC optional boolean true to bypass optimizations and force full generation of GC data.

Returns

Return type: Promise<IGarbageCollectionData>

isReferenced

Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/runtime-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

isReferenced(): boolean;

Returns

Return type: boolean

updateUsedRoutes

After GC has run, called to notify this node of routes that are used in it. These are used for the following: 1. To identify if this node is being referenced in the document or not. 2. To identify if this node or any of its children's used routes changed since last summary.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/runtime-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

updateUsedRoutes(usedRoutes: string[]): void;

Parameters

Parameter Type Description
usedRoutes string[] The routes that are used in this node.