Skip to content 

FluidDataStoreRuntime Class

Packages > @fluidframework/datastore > FluidDataStoreRuntime

Base data store class

Signature:

export declare class FluidDataStoreRuntime extends EventEmitter implements IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext 

Extends: EventEmitter

Implements: IFluidDataStoreChannel, IFluidDataStoreRuntime, IFluidHandleContext

Properties

List of properties for this class
Property Modifiers Type Description
absolutePath string
attachState AttachState
clientDetails IClientDetails
clientId string | undefined
connected boolean
deltaManager IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>
disposed boolean
documentId string
existing boolean
id string
IFluidHandleContext this
IFluidRouter this
IFluidSerializer import("@fluidframework/core-interfaces").IFluidSerializer
isAttached boolean
leader boolean
loader ILoader
logger ITelemetryLogger
options any
parentBranch string | null
path string
routeContext IFluidHandleContext

Methods

List of methods on this class
Method Modifiers Description
attachGraph()
bind(handle)
bindChannel(channel) Binds a channel with the runtime. If the runtime is attached we will attach the channel right away. If the runtime is not attached we will defer the attach until the runtime attaches.
bindToContext() Binds this runtime to the container This includes the following: 1. Sending an Attach op that includes all existing state 2. Attaching the graph if the data store becomes attached.
createChannel(id, type)
dispose()
getAttachSnapshot()
getAudience()
getBlob(blobId)
getBlobMetadata()
getChannel(id)
getQuorum()
load(context, sharedObjectRegistry) static Loads the data store runtime
process(message, local, localOpMetadata)
processSignal(message, local)
raiseContainerWarning(warning)
registerRequestHandler(handler)
request(request)
resolveHandle(request)
reSubmit(type, content, localOpMetadata) For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message. For all other messages, just submit it again. This typically happens when we reconnect and there are unacked messages.
setConnectionState(connected, clientId)
snapshot(message)
snapshotInternal(fullTree)
submitMessage(type, content, localOpMetadata)
submitSignal(type, content)
summarize(fullTree)
uploadBlob(file)
waitAttached() Will return when the data store is attached.

Properties

absolutePath

Signature:

get absolutePath(): string;

attachState

Signature:

get attachState(): AttachState;

clientDetails

Signature:

get clientDetails(): IClientDetails;

clientId

Signature:

get clientId(): string | undefined;

connected

Signature:

get connected(): boolean;

deltaManager

Signature:

readonly deltaManager: IDeltaManager<ISequencedDocumentMessage, IDocumentMessage>;

disposed

Signature:

get disposed(): boolean;

documentId

Signature:

readonly documentId: string;

existing

Signature:

existing: boolean;

id

Signature:

readonly id: string;

IFluidHandleContext

Signature:

get IFluidHandleContext(): this;

IFluidRouter

Signature:

get IFluidRouter(): this;

IFluidSerializer

Signature:

get IFluidSerializer(): import("@fluidframework/core-interfaces").IFluidSerializer;

isAttached

Signature:

get isAttached(): boolean;

leader

Signature:

get leader(): boolean;

loader

Signature:

get loader(): ILoader;

logger

Signature:

readonly logger: ITelemetryLogger;

options

Signature:

readonly options: any;

parentBranch

Signature:

readonly parentBranch: string | null;

path

Warning: This API is now obsolete.

  • 0.21 back-compat

Signature:

get path(): string;

routeContext

Signature:

get routeContext(): IFluidHandleContext;

Methods

attachGraph

Signature:

attachGraph(): void;

Returns:

void

bind

Signature:

bind(handle: IFluidHandle): void;

Parameters

List of parameters
Parameter Type Description
handle IFluidHandle

Returns:

void

bindChannel

Binds a channel with the runtime. If the runtime is attached we will attach the channel right away. If the runtime is not attached we will defer the attach until the runtime attaches.

Signature:

bindChannel(channel: IChannel): void;

Parameters

List of parameters
Parameter Type Description
channel IChannel channel to be registered.

Returns:

void

bindToContext

Binds this runtime to the container This includes the following: 1. Sending an Attach op that includes all existing state 2. Attaching the graph if the data store becomes attached.

Signature:

bindToContext(): void;

Returns:

void

createChannel

Signature:

createChannel(id: string | undefined, type: string): IChannel;

Parameters

List of parameters
Parameter Type Description
id string | undefined
type string

Returns:

IChannel

dispose

Signature:

dispose(): void;

Returns:

void

getAttachSnapshot

Signature:

getAttachSnapshot(): ITreeEntry[];

Returns:

ITreeEntry[]

getAudience

Signature:

getAudience(): IAudience;

Returns:

IAudience

getBlob

Signature:

getBlob(blobId: string): Promise<IGenericBlob | undefined>;

Parameters

List of parameters
Parameter Type Description
blobId string

Returns:

Promise<IGenericBlob | undefined>

getBlobMetadata

Signature:

getBlobMetadata(): Promise<IGenericBlob[]>;

Returns:

Promise<IGenericBlob[]>

getChannel

Signature:

getChannel(id: string): Promise<IChannel>;

Parameters

List of parameters
Parameter Type Description
id string

Returns:

Promise<IChannel>

getQuorum

Signature:

getQuorum(): IQuorum;

Returns:

IQuorum

load

Loads the data store runtime

Signature:

static load(context: IFluidDataStoreContext, sharedObjectRegistry: ISharedObjectRegistry): FluidDataStoreRuntime;

Parameters

List of parameters
Parameter Type Description
context IFluidDataStoreContext The data store context
sharedObjectRegistry ISharedObjectRegistry The registry of shared objects used by this data store

Returns:

FluidDataStoreRuntime

process

Signature:

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

Parameters

List of parameters
Parameter Type Description
message ISequencedDocumentMessage
local boolean
localOpMetadata unknown

Returns:

void

processSignal

Signature:

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

Parameters

List of parameters
Parameter Type Description
message IInboundSignalMessage
local boolean

Returns:

void

raiseContainerWarning

Signature:

raiseContainerWarning(warning: ContainerWarning): void;

Parameters

List of parameters
Parameter Type Description
warning ContainerWarning

Returns:

void

registerRequestHandler

Signature:

registerRequestHandler(handler: (request: IRequest) => Promise<IResponse>): void;

Parameters

List of parameters
Parameter Type Description
handler (request: IRequest) => Promise<IResponse>

Returns:

void

request

Signature:

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

Parameters

List of parameters
Parameter Type Description
request IRequest

Returns:

Promise<IResponse>

resolveHandle

Signature:

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

Parameters

List of parameters
Parameter Type Description
request IRequest

Returns:

Promise<IResponse>

reSubmit

For messages of type MessageType.Operation, finds the right channel and asks it to resubmit the message. For all other messages, just submit it again. This typically happens when we reconnect and there are unacked messages.

Signature:

reSubmit(type: DataStoreMessageType, content: any, localOpMetadata: unknown): void;

Parameters

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

Returns:

void

setConnectionState

Signature:

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

Parameters

List of parameters
Parameter Type Description
connected boolean
clientId string

Returns:

void

snapshot

Signature:

snapshot(message: string): Promise<void>;

Parameters

List of parameters
Parameter Type Description
message string

Returns:

Promise<void>

snapshotInternal

Signature:

snapshotInternal(fullTree?: boolean): Promise<ITreeEntry[]>;

Parameters

List of parameters
Parameter Type Description
fullTree boolean

Returns:

Promise<ITreeEntry[]>

submitMessage

Signature:

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

Parameters

List of parameters
Parameter Type Description
type DataStoreMessageType
content any
localOpMetadata unknown

Returns:

void

submitSignal

Signature:

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

Parameters

List of parameters
Parameter Type Description
type string
content any

Returns:

void

summarize

Signature:

summarize(fullTree?: boolean): Promise<ISummaryTreeWithStats>;

Parameters

List of parameters
Parameter Type Description
fullTree boolean

Returns:

Promise<ISummaryTreeWithStats>

uploadBlob

Signature:

uploadBlob(file: IGenericBlob): Promise<IGenericBlob>;

Parameters

List of parameters
Parameter Type Description
file IGenericBlob

Returns:

Promise<IGenericBlob>

waitAttached

Will return when the data store is attached.

Signature:

waitAttached(): Promise<void>;

Returns:

Promise<void>