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

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

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.
process(message, local, localOpMetadata) Deprecated, Alpha void Processes the op.
processMessages(messageCollection) Alpha optional 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) Alpha any Ask the DDS to resubmit a message. This could be because we reconnected and this message was not acked.
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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

Signature

readonly entryPoint: IFluidHandleInternal<FluidObject>;

Type: IFluidHandleInternal<FluidObject>

Method Details

applyStashedOp

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

Signature

makeVisibleAndAttachGraph(): void;

process

Processes the op.

WARNING: This API is deprecated and will be removed in a future release.

processMessages should be used instead to process messages for a channel.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

Signature

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

Parameters

Parameter Type Description
message ISequencedDocumentMessage
local boolean
localOpMetadata unknown

processMessages

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

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

Signature

processMessages?(messageCollection: IRuntimeMessageCollection): void;

Parameters

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

processSignal

Processes the signal.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

Signature

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

Parameters

Parameter Type Description
message IInboundSignalMessage
local boolean

request

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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 could be because we reconnected and this message was not acked.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

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.

WARNING: This API is provided as an alpha preview and may change without notice. Use at your own risk.

Signature

updateUsedRoutes(usedRoutes: string[]): void;

Parameters

Parameter Type Description
usedRoutes string[] The routes that are used in this channel.