Skip to main content

IFluidDataStoreChannel Interface

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

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

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 IFluidDataStoreChannel extends IDisposable

Extends: IDisposable

Properties

Property Alerts Modifiers Type Description
entryPoint Alpha readonly IFluidHandleInternal<FluidObject> Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting with the component.
policies Alpha optional, readonly IFluidDataStorePolicies Optional policies that the data store channel may adhere to that the data store context should know about. These policies influence the behavior of the data store, such as its readonly state in specific modes.

Methods

Method Alerts Modifiers Return Type Description
applyStashedOp(content) Alpha Promise<unknown>
getAttachGCData(telemetryContext) Alpha IGarbageCollectionData Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore
getAttachSummary(telemetryContext) Alpha ISummaryTreeWithStats Synchronously retrieves the summary used as part of the initial summary message
getGCData(fullGC) Alpha 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() Alpha 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.
notifyReadOnlyState(readonly) Alpha optional void Notifies this object about changes in the readonly state
processMessages(messageCollection) Alpha void Process messages for this channel. The messages here are contiguous messages in a batch.
processSignal(message, local) Alpha void Processes the signal.
request(request) Alpha Promise<IResponse>
reSubmit(type, content, localOpMetadata, squash) Alpha any

Ask the DDS to resubmit a message. This can happen for several reasons, such as:

- We reconnected and discovered the original message was never acked. - The original message was submitted from a reentrant state that is impossible for other clients to interpret correctly - The original message was never sent on the wire and subsequent ops have been inbounded

rollback(type, content, localOpMetadata) Alpha optional void Revert a local message.
setAttachState(attachState) Alpha void
setConnectionState(connected, clientId) Alpha any Notifies this object about changes in the connection state.
summarize(fullTree, trackState, telemetryContext) Alpha Promise<ISummaryTreeWithStats> Generates a summary for the channel. Introduced with summarizerNode - will be required in a future release.
updateUsedRoutes(usedRoutes) Alpha void After GC has run, called to notify this channel of routes that are used in it.

Property Details

entryPoint

Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting with the component.

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

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

Signature
readonly entryPoint: IFluidHandleInternal<FluidObject>;

Type: IFluidHandleInternal<FluidObject>

policies

Optional policies that the data store channel may adhere to that the data store context should know about. These policies influence the behavior of the data store, such as its readonly state in specific modes.

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

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

Signature
readonly policies?: IFluidDataStorePolicies;

Type: IFluidDataStorePolicies

Method Details

applyStashedOp

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

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

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

Parameters

Parameter Type Description
content any

Returns

Return type: Promise<unknown>

getAttachGCData

Synchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore

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

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

Signature
getAttachGCData(telemetryContext?: ITelemetryContext): IGarbageCollectionData;

Parameters

Parameter Modifiers Type Description
telemetryContext optional ITelemetryContext

Returns

Return type: IGarbageCollectionData

getAttachSummary

Synchronously retrieves the summary used as part of the initial summary message

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

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

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.

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

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>

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.

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

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

Signature
makeVisibleAndAttachGraph(): void;

notifyReadOnlyState

Notifies this object about changes in the readonly state

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

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

Signature
notifyReadOnlyState?(readonly: boolean): void;

Parameters

Parameter Type Description
readonly boolean

processMessages

Process messages for this channel. The messages here are contiguous messages in a batch.

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

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

Signature
processMessages(messageCollection: IRuntimeMessageCollection): void;

Parameters

Parameter Type Description
messageCollection IRuntimeMessageCollection The collection of messages to process.

processSignal

Processes the signal.

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

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

Signature
processSignal(message: IInboundSignalMessage, local: boolean): void;

Parameters

Parameter Type Description
message IInboundSignalMessage
local boolean

request

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

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

Signature
request(request: IRequest): Promise<IResponse>;

Parameters

Parameter Type Description
request IRequest

Returns

Return type: Promise<IResponse>

reSubmit

Ask the DDS to resubmit a message. This can happen for several reasons, such as:

  • We reconnected and discovered the original message was never acked. - The original message was submitted from a reentrant state that is impossible for other clients to interpret correctly - The original message was never sent on the wire and subsequent ops have been inbounded
This API is provided for existing users, but is not recommended for new users.

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

Signature
reSubmit(type: string, content: any, localOpMetadata: unknown, squash?: boolean): any;

Parameters

Parameter Modifiers 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.
squash optional boolean If true, the DDS should avoid resubmitting any "unnecessary intermediate state" created by this message. This includes any content which this message created but has since been changed or removed by subsequent messages. For example, if this message (call it A) inserts content into a DDS that a subsequent op (call it B) removes, resubmission of this message (call it A') should avoid inserting that content, and resubmission of the subsequent op that removed it (B') would account for the fact that A' never inserted content.

Returns

Return type: any

rollback

Revert a local message.

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

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

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.

setAttachState

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

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

Signature
setAttachState(attachState: AttachState.Attaching | AttachState.Attached): void;

Parameters

Parameter Type Description
attachState AttachState.Attaching | AttachState.Attached

setConnectionState

Notifies this object about changes in the connection state.

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

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

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.

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

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

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.

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

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 channel.