Skip to main content
Version: v1

ISummarizerNodeWithGC Interface

Extends the functionality of ISummarizerNode to support garbage collection. It adds / udpates 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.

Signature​

export interface ISummarizerNodeWithGC extends ISummarizerNode

Extends: ISummarizerNode

Methods​

MethodAlertsModifiersReturn TypeDescription
createChild(summarizeInternalFn, id, createParam, config, getGCDataFn, getInitialGCSummaryDetailsFn)ISummarizerNodeWithGC
deleteChild(id)voidDelete the child with the given id..
getBaseGCDetails()optionalIGarbageCollectionDetailsBaseReturns the GC details to be added to this node's summary and is used to initialize new nodes' GC state.
getChild(id)ISummarizerNodeWithGC | undefined
getGCData(fullGC)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.
getGCSummaryDetails()DeprecatedIGarbageCollectionSummaryDetails
isReferenced()booleanTells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
updateUsedRoutes(usedRoutes, gcTimestamp)voidAfter 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​

Signature​

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

Parameters​

ParameterModifiersTypeDescription
summarizeInternalFnSummarizeInternalFn
idstring
createParamCreateChildSummarizerNodeParam
configoptionalISummarizerNodeConfigWithGC
getGCDataFnoptional(fullGC?: boolean) => Promise<IGarbageCollectionData>
getInitialGCSummaryDetailsFnoptional() => Promise<IGarbageCollectionSummaryDetails>

Returns​

Return type: ISummarizerNodeWithGC

deleteChild​

Delete the child with the given id..

Signature​

deleteChild(id: string): void;

Parameters​

ParameterTypeDescription
idstring

getBaseGCDetails​

Returns the GC details to be added to this node's summary and is used to initialize new nodes' GC state.

Signature​

getBaseGCDetails?(): IGarbageCollectionDetailsBase;

Returns​

Return type: IGarbageCollectionDetailsBase

getChild​

Signature​

getChild(id: string): ISummarizerNodeWithGC | undefined;

Parameters​

ParameterTypeDescription
idstring

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.

Signature​

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

Parameters​

ParameterModifiersTypeDescription
fullGCoptionalbooleantrue to bypass optimizations and force full generation of GC data.

Returns​

Return type: Promise<IGarbageCollectionData>

getGCSummaryDetails​

This API is deprecated and will be removed in a future release.
  • Renamed to getBaseGCDetails. Returns the GC details that may be added to this node's summary.

Signature​

getGCSummaryDetails(): IGarbageCollectionSummaryDetails;

Returns​

Return type: IGarbageCollectionSummaryDetails

isReferenced​

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

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.

Signature​

updateUsedRoutes(usedRoutes: string[], gcTimestamp?: number): void;

Parameters​

ParameterModifiersTypeDescription
usedRoutesstring[]The routes that are used in this node.
gcTimestampoptionalnumberThe time when GC was run that generated these used routes. If a node becomes unreferenced as part of this GC run, this timestamp is used to update the time when it happens.