Skip to content 

IFluidDataStoreContext Interface

Packages > @fluidframework/runtime-definitions > IFluidDataStoreContext

Represents the context for the data store. It is used by the data store runtime to get information and call functionality to the container.

Signature:

export interface IFluidDataStoreContext extends EventEmitter, Partial<IProvideFluidDataStoreRegistry> 

Extends: EventEmitter, Partial<IProvideFluidDataStoreRegistry>

Properties

List of properties of this interface
Property Type Description
attachState AttachState Indicates the attachment state of the data store to a host service.
baseSnapshot ISnapshotTree | undefined
blobManager IBlobManager
branch string
clientId string | undefined
connected boolean
containerRuntime IContainerRuntimeBase
deltaManager IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
documentId string
existing boolean TODO: should remove after detachedNew is in place
hostRuntime IContainerRuntimeBase
id string
leader boolean
loader ILoader
options any
packagePath readonly string[] The package path of the data store as per the package factory.
parentBranch string | null
scope IFluidObject Ambient services provided with the context
snapshotFn (message: string) => Promise
storage IDocumentStorageService
summaryTracker ISummaryTracker

Methods

List of methods of this class
Method Description
bindToContext(dataStoreRuntime) Register the runtime to the container
getAbsoluteUrl(relativeUrl) Get an absolute url to the containe rbased on the provided relativeUrl. Returns undefined if the container or data store isn't attached to storage.
getAudience() Returns the current audience.
getCreateChildSummarizerNodeFn(id, createParam)
getQuorum() Returns the current quorum.
on(event, listener)
raiseContainerWarning(warning) Report error in that happend in the data store runtime layer to the container runtime layer
setChannelDirty(address) Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.
submitMessage(type, content, localOpMetadata) Submits the message to be sent to other clients.
submitSignal(type, content) Submits the signal to be sent to other clients.

Events

attachState

Indicates the attachment state of the data store to a host service.

Signature:

readonly attachState: AttachState;

baseSnapshot

Signature:

readonly baseSnapshot: ISnapshotTree | undefined;

blobManager

Signature:

readonly blobManager: IBlobManager;

branch

Signature:

readonly branch: string;

clientId

Signature:

readonly clientId: string | undefined;

connected

Signature:

readonly connected: boolean;

containerRuntime

Signature:

readonly containerRuntime: IContainerRuntimeBase;

deltaManager

Signature:

readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

documentId

Signature:

readonly documentId: string;

existing

TODO: should remove after detachedNew is in place

Signature:

readonly existing: boolean;

hostRuntime

Warning: This API is now obsolete.

0.17 Issue #1888 Rename IHostRuntime to IContainerRuntime and refactor usages Use containerRuntime instead of hostRuntime

Signature:

readonly hostRuntime: IContainerRuntimeBase;

id

Signature:

readonly id: string;

leader

Signature:

readonly leader: boolean;

loader

Signature:

readonly loader: ILoader;

options

Signature:

readonly options: any;

packagePath

The package path of the data store as per the package factory.

Signature:

readonly packagePath: readonly string[];

parentBranch

Signature:

readonly parentBranch: string | null;

scope

Ambient services provided with the context

Signature:

readonly scope: IFluidObject;

snapshotFn

Signature:

readonly snapshotFn: (message: string) => Promise<void>;

storage

Signature:

readonly storage: IDocumentStorageService;

summaryTracker

Signature:

readonly summaryTracker: ISummaryTracker;

Methods

bindToContext

Register the runtime to the container

Signature:

bindToContext(dataStoreRuntime: IFluidDataStoreChannel): void;

Parameters

List of parameters
Parameter Type Description
dataStoreRuntime IFluidDataStoreChannel runtime to attach

Returns:

void

getAbsoluteUrl

Get an absolute url to the containe rbased on the provided relativeUrl. Returns undefined if the container or data store isn’t attached to storage.

Signature:

getAbsoluteUrl(relativeUrl: string): Promise<string | undefined>;

Parameters

List of parameters
Parameter Type Description
relativeUrl string A relative request within the container

Returns:

Promise<string | undefined>

getAudience

Returns the current audience.

Signature:

getAudience(): IAudience;

Returns:

IAudience

getCreateChildSummarizerNodeFn

Signature:

getCreateChildSummarizerNodeFn(
    id: string, 
    createParam: CreateChildSummarizerNodeParam): CreateChildSummarizerNodeFn;

Parameters

List of parameters
Parameter Type Description
id string
createParam CreateChildSummarizerNodeParam

Returns:

CreateChildSummarizerNodeFn

getQuorum

Returns the current quorum.

Signature:

getQuorum(): IQuorum;

Returns:

IQuorum

on

Signature:

on(event: "leader" | "notleader" | "attaching" | "attached", listener: () => void): this;

Parameters

List of parameters
Parameter Type Description
event "leader" | "notleader" | "attaching" | "attached"
listener () => void

Returns:

this

raiseContainerWarning

Report error in that happend in the data store runtime layer to the container runtime layer

Signature:

raiseContainerWarning(warning: ContainerWarning): void;

Parameters

List of parameters
Parameter Type Description
warning ContainerWarning

Returns:

void

setChannelDirty

Call by IFluidDataStoreChannel, indicates that a channel is dirty and needs to be part of the summary.

Signature:

setChannelDirty(address: string): void;

Parameters

List of parameters
Parameter Type Description
address string The address of the channe that is dirty.

Returns:

void

submitMessage

Submits the message to be sent to other clients.

Signature:

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

Parameters

List of parameters
Parameter Type Description
type string Type of the message.
content any Content of the message.
localOpMetadata unknown The local metadata associated with the message. This is kept locally and not sent to the server. This will be sent back when this message is received back from the server. This is also sent if we are asked to resubmit the message.

Returns:

void

submitSignal

Submits the signal to be sent to other clients.

Signature:

submitSignal(type: string, content: any): void;

Parameters

List of parameters
Parameter Type Description
type string Type of the signal.
content any Content of the signal.

Returns:

void