Class StatefulOperator<TParam, TResult>
Base class for stateful query operator implementations, providing support to load and save operator state during checkpointing and recovery.
Inheritance
Inherited Members
Namespace: Reaqtive
Assembly: Reaqtive.Core.dll
Syntax
public abstract class StatefulOperator<TParam, TResult> : VersionedOperator<TParam, TResult>, ISubscription, IStatefulOperator, IOperator, IDisposable, IVersioned
Type Parameters
Name | Description |
---|---|
TParam | Type of the parameters passed to the observer. |
TResult | Element type of the result sequence produced by the operator. |
Constructors
StatefulOperator(TParam, IObserver<TResult>)
Creates a new stateful operator instance using the given parameters and the observer to report downstream notifications to.
Declaration
protected StatefulOperator(TParam parent, IObserver<TResult> observer)
Parameters
Type | Name | Description |
---|---|---|
TParam | parent | Parameters used by the operator. |
System.IObserver<TResult> | observer | Observer receiving the operator's output. |
Properties
StateChanged
Gets a flag indicating whether state has changed since the last time the operator state got saved.
Declaration
public virtual bool StateChanged { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
LoadState(IOperatorStateReader, Version)
Loads the state of the operator.
Declaration
public void LoadState(IOperatorStateReader reader, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateReader | reader | Reader to read operator state from. |
System.Version | version | Version of the state being loaded. |
LoadStateCore(IOperatorStateReader)
Loads the state of the operator.
Declaration
protected virtual void LoadStateCore(IOperatorStateReader reader)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateReader | reader | Reader to read operator state from. |
LoadStateCore(IOperatorStateReader, Version)
Loads the state of the operator using the specified state version.
Declaration
protected virtual void LoadStateCore(IOperatorStateReader reader, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateReader | reader | Reader to read operator state from. |
System.Version | version | Version of the state being read. |
OnDispose()
Called when the subscription is disposed.
Declaration
protected override void OnDispose()
Overrides
OnStateSaved()
Called when subscription state was successfully saved.
Declaration
public virtual void OnStateSaved()
SaveState(IOperatorStateWriter, Version)
Saves the state of the operator.
Declaration
public void SaveState(IOperatorStateWriter writer, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateWriter | writer | Writer to write operator state to. |
System.Version | version | Version of the state being saved. |
SaveStateCore(IOperatorStateWriter)
Saves the state of the operator.
Declaration
protected virtual void SaveStateCore(IOperatorStateWriter writer)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateWriter | writer | Writer to write operator state to. |
SaveStateCore(IOperatorStateWriter, Version)
Saves the state of the operator using the specified state version.
Declaration
protected virtual void SaveStateCore(IOperatorStateWriter writer, Version version)
Parameters
Type | Name | Description |
---|---|---|
IOperatorStateWriter | writer | Writer to write operator state to. |
System.Version | version | Version of the state being written. |