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

Method Alerts Modifiers Return Type Description
createChild(summarizeInternalFn, id, createParam, config, getGCDataFn, getInitialGCSummaryDetailsFn) ISummarizerNodeWithGC
deleteChild(id) void Delete the child with the given id..
getBaseGCDetails() optional IGarbageCollectionDetailsBase Returns 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() Deprecated IGarbageCollectionSummaryDetails
isReferenced() boolean Tells whether this node is being referenced in this document or not. Unreferenced node will get GC'd
updateUsedRoutes(usedRoutes, gcTimestamp) 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

Signature

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

Parameters

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

Returns

Return type: ISummarizerNodeWithGC

deleteChild

Delete the child with the given id..

Signature

deleteChild(id: string): void;

Parameters

Parameter Type Description
id string

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

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.

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>

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

Parameter Modifiers Type Description
usedRoutes string[] The routes that are used in this node.
gcTimestamp optional number The 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.