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

PropertyAlertsModifiersTypeDescription
entryPointBetareadonlyIFluidHandleInternal<FluidObject>Exposes a handle to the root object / entryPoint of the component. Use this as the primary way of interacting with the component.
policiesBetaoptional, readonlyIFluidDataStorePoliciesOptional 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

MethodAlertsModifiersReturn TypeDescription
applyStashedOp(content)BetaPromise<unknown>
getAttachGCData(telemetryContext)BetaIGarbageCollectionDataSynchronously retrieves GC Data (representing the outbound routes present) for the initial state of the DataStore
getAttachSummary(telemetryContext)BetaISummaryTreeWithStatsSynchronously retrieves the summary used as part of the initial summary message
getGCData(fullGC)BetaPromise<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()BetavoidMakes 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)BetaoptionalvoidNotifies this object about changes in the readonly state
processMessages(messageCollection)BetavoidProcess messages for this channel. The messages here are contiguous messages in a batch.
processSignal(message, local)BetavoidProcesses the signal.
request(request)BetaPromise<IResponse>
reSubmit(type, content, localOpMetadata, squash)Betavoid

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)BetaoptionalvoidRevert a local message.
setAttachState(attachState)Betavoid
setConnectionState(connected, clientId)BetavoidNotifies this object about changes in the connection state.
summarize(fullTree, trackState, telemetryContext)BetaPromise<ISummaryTreeWithStats>Generates a summary for the channel. Introduced with summarizerNode - will be required in a future release.
updateUsedRoutes(usedRoutes)BetavoidAfter 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

ParameterTypeDescription
contentany

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

ParameterModifiersTypeDescription
telemetryContextoptionalITelemetryContext

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

ParameterModifiersTypeDescription
telemetryContextoptionalITelemetryContext

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

ParameterModifiersTypeDescription
fullGCoptionalbooleantrue 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

ParameterTypeDescription
readonlyboolean

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

ParameterTypeDescription
messageCollectionIRuntimeMessageCollectionThe 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

ParameterTypeDescription
messageIInboundSignalMessage
localboolean

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

ParameterTypeDescription
requestIRequest

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): void;

Parameters

ParameterModifiersTypeDescription
typestringThe type of the original message.
contentanyThe content of the original message.
localOpMetadataunknownThe local metadata associated with the original message.
squashoptionalbooleanIf 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.

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

ParameterTypeDescription
typestringThe type of the original message.
contentanyThe content of the original message.
localOpMetadataunknownThe 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

ParameterTypeDescription
attachStateAttachState.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): void;

Parameters

ParameterModifiersTypeDescription
connectedboolean
clientIdoptionalstringID of the client. It's old ID when in disconnected state and it's new client ID when we are connecting or connected.

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

ParameterModifiersTypeDescription
fullTreeoptionalbooleantrue to bypass optimizations and force a full summary tree.
trackStateoptionalbooleanThis tells whether we should track state from this summary.
telemetryContextoptionalITelemetryContextsummary 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

ParameterTypeDescription
usedRoutesstring[]The routes that are used in this channel.