Skip to content 

ISummarizerNode Interface

Packages > @fluidframework/runtime-definitions > ISummarizerNode

Signature:

export interface ISummarizerNode 

Properties

List of properties of this interface
Property Type Description
referenceSequenceNumber number Latest successfully acked summary reference sequence number

Methods

List of methods of this class
Method Description
createChild(summarizeInternalFn, id, createParam, config)
getChild(id)
hasChanged() True if a change has been recorded with sequence number exceeding the latest successfully acked summary reference sequence number. False implies that the previous summary can be reused.
invalidate(sequenceNumber) Marks the node as having a change with the given sequence number.
loadBaseSummary(snapshot, readAndParseBlob) Checks if the base snapshot was created as a failure summary. If it has the base summary handle + outstanding ops blob, then this will return the innermost base summary, and update the state by tracking the outstanding ops.
recordChange(op) Records an op representing a change to this node/subtree.
summarize(fullTree) Calls the internal summarize function and handles internal state tracking. If unchanged and fullTree is false, it will reuse previous summary subtree. If an error is encountered and throwOnFailure is false, it will try to make a summary with a pointer to the previous summary + a blob of outstanding ops.

Events

referenceSequenceNumber

Latest successfully acked summary reference sequence number

Signature:

readonly referenceSequenceNumber: number;

Methods

createChild

Signature:

createChild(
    summarizeInternalFn: (fullTree: boolean) => Promise<ISummarizeInternalResult>, 
    id: string, 
    createParam: CreateChildSummarizerNodeParam, 
    config?: ISummarizerNodeConfig): ISummarizerNode;

Parameters

List of parameters
Parameter Type Description
summarizeInternalFn (fullTree: boolean) => Promise<ISummarizeInternalResult>
id string
createParam CreateChildSummarizerNodeParam
config ISummarizerNodeConfig

Returns:

ISummarizerNode

getChild

Signature:

getChild(id: string): ISummarizerNode | undefined;

Parameters

List of parameters
Parameter Type Description
id string

Returns:

ISummarizerNode | undefined

hasChanged

True if a change has been recorded with sequence number exceeding the latest successfully acked summary reference sequence number. False implies that the previous summary can be reused.

Signature:

hasChanged(): boolean;

Returns:

boolean

invalidate

Marks the node as having a change with the given sequence number.

Signature:

invalidate(sequenceNumber: number): void;

Parameters

List of parameters
Parameter Type Description
sequenceNumber number sequence number of change

Returns:

void

loadBaseSummary

Checks if the base snapshot was created as a failure summary. If it has the base summary handle + outstanding ops blob, then this will return the innermost base summary, and update the state by tracking the outstanding ops.

Signature:

loadBaseSummary(snapshot: ISnapshotTree, readAndParseBlob: <T>(id: string) => Promise<T>): Promise<{
        baseSummary: ISnapshotTree;
        outstandingOps: ISequencedDocumentMessage[];
    }>;

Parameters

List of parameters
Parameter Type Description
snapshot ISnapshotTree the base summary to parse
readAndParseBlob (id: string) => Promise function to read and parse blobs from storage

Returns:

Promise<{ baseSummary: ISnapshotTree; outstandingOps: ISequencedDocumentMessage[]; }>

the base summary to be used

recordChange

Records an op representing a change to this node/subtree.

Signature:

recordChange(op: ISequencedDocumentMessage): void;

Parameters

List of parameters
Parameter Type Description
op ISequencedDocumentMessage op of change to record

Returns:

void

summarize

Calls the internal summarize function and handles internal state tracking. If unchanged and fullTree is false, it will reuse previous summary subtree. If an error is encountered and throwOnFailure is false, it will try to make a summary with a pointer to the previous summary + a blob of outstanding ops.

Signature:

summarize(fullTree: boolean): Promise<ISummarizeResult>;

Parameters

List of parameters
Parameter Type Description
fullTree boolean true to skip optimizations and always generate the full tree

Returns:

Promise<ISummarizeResult>