Skip to main content
Version: v1

IFluidDataStoreChannel Interface

Minimal interface a data store runtime need to provide for IFluidDataStoreContext to bind to control

Functionality include attach, snapshot, op/signal processing, request routes, and connection state notifications

Signature

export interface IFluidDataStoreChannel extends IFluidRouter, IDisposable

Extends: IFluidRouter, IDisposable

Properties

Property Modifiers Type Description
attachState AttachState Indicates the attachment state of the channel to a host service.
id string
visibilityState optional VisibilityState

Methods

Method Alerts Modifiers Return Type Description
applyStashedOp(content) Promise<unknown>
attachGraph() Deprecated void
bindToContext() Deprecated void
getAttachSummary(telemetryContext) ISummaryTreeWithStats Retrieves the summary used as part of the initial summary message
getGCData(fullGC) Promise<IGarbageCollectionData> Returns the data used for garbage collection. This includes a list of GC nodes that represent this context including any of its children. Each node has a list of outbound routes to other GC nodes in the document.
makeVisibleAndAttachGraph() optional void Makes the data store channel visible in the container. Also, runs through its graph and attaches all bound handles that represent its dependencies in the container's graph.
process(message, local, localOpMetadata) void Processes the op.
processSignal(message, local) void Processes the signal.
reSubmit(type, content, localOpMetadata) any Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.
rollback(type, content, localOpMetadata) optional void Revert a local message.
setConnectionState(connected, clientId) any Notifies this object about changes in the connection state.
summarize(fullTree, trackState, telemetryContext) Promise<ISummaryTreeWithStats> Generates a summary for the channel. Introduced with summarizerNode - will be required in a future release.
updateUsedRoutes(usedRoutes, gcTimestamp) void After GC has run, called to notify this channel of routes that are used in it.

Property Details

attachState

Indicates the attachment state of the channel to a host service.

Signature

readonly attachState: AttachState;

Type: AttachState

id

Signature

readonly id: string;

Type: string

visibilityState

Signature

readonly visibilityState?: VisibilityState;

Type: VisibilityState

Method Details

applyStashedOp

Signature

applyStashedOp(content: any): Promise<unknown>;

Parameters

Parameter Type Description
content any

Returns

Return type: Promise<unknown>

attachGraph

This API is deprecated and will be removed in a future release.
  • This will be removed in favor of makeVisibleAndAttachGraph. Runs through the graph and attaches the bound handles. Then binds this runtime to the container.

Signature

attachGraph(): void;

bindToContext

This API is deprecated and will be removed in a future release.
  • This is an internal method that should not be exposed. Called to bind the runtime to the container. If the container is not attached to storage, then this would also be unknown to other clients.

Signature

bindToContext(): void;

getAttachSummary

Retrieves the summary used as part of the initial summary message

Signature

getAttachSummary(telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;

Parameters

Parameter Modifiers Type Description
telemetryContext optional ITelemetryContext

Returns

Return type: ISummaryTreeWithStats

getGCData

Returns the data used for garbage collection. This includes a list of GC nodes that represent this context including any of its children. Each node has a list 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>

makeVisibleAndAttachGraph

Makes the data store channel visible in the container. Also, runs through its graph and attaches all bound handles that represent its dependencies in the container's graph.

Signature

makeVisibleAndAttachGraph?(): void;

process

Processes the op.

Signature

process(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;

Parameters

Parameter Type Description
message ISequencedDocumentMessage
local boolean
localOpMetadata unknown

processSignal

Processes the signal.

Signature

processSignal(message: any, local: boolean): void;

Parameters

Parameter Type Description
message any
local boolean

reSubmit

Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.

Signature

reSubmit(type: string, content: any, localOpMetadata: unknown): any;

Parameters

Parameter Type Description
type string The type of the original message.
content any The content of the original message.
localOpMetadata unknown The local metadata associated with the original message.

Returns

Return type: any

rollback

Revert a local message.

Signature

rollback?(type: string, content: any, localOpMetadata: unknown): void;

Parameters

Parameter Type Description
type string The type of the original message.
content any The content of the original message.
localOpMetadata unknown The local metadata associated with the original message.

setConnectionState

Notifies this object about changes in the connection state.

Signature

setConnectionState(connected: boolean, clientId?: string): any;

Parameters

Parameter Modifiers Type Description
connected boolean
clientId optional string ID of the client. It's old ID when in disconnected state and it's new client ID when we are connecting or connected.

Returns

Return type: any

summarize

Generates a summary for the channel. Introduced with summarizerNode - will be required in a future release.

Signature

summarize(fullTree?: boolean, trackState?: boolean, telemetryContext?: ITelemetryContext): Promise<ISummaryTreeWithStats>;

Parameters

Parameter Modifiers Type Description
fullTree optional boolean true to bypass optimizations and force a full summary tree.
trackState optional boolean This tells whether we should track state from this summary.
telemetryContext optional ITelemetryContext summary data passed through the layers for telemetry purposes

Returns

Return type: Promise<ISummaryTreeWithStats>

updateUsedRoutes

After GC has run, called to notify this channel of routes that are used in it.

Signature

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

Parameters

Parameter Modifiers Type Description
usedRoutes string[] The routes that are used in this channel.
gcTimestamp optional number The time when GC was run that generated these used routes. If any node becomes unreferenced as part of this GC run, this should be used to update the time when it happens.