Class CheckpointingQueryEngine
Reactive event processing query engine that supports checkpointing.
Inheritance
Implements
Namespace: Reaqtor.QueryEngine
Assembly: Reaqtor.QueryEngine.dll
Syntax
public class CheckpointingQueryEngine : Object, ICheckpointingQueryEngine, IReliableQueryEngine, IQueryEngine, ICheckpointable, IAsyncDisposable, IDisposable
Constructors
CheckpointingQueryEngine(Uri, IReactiveServiceResolver, IScheduler, IReactiveMetadata, IKeyValueStore, ISerializationPolicy, IQuotedTypeConversionTargets, TraceSource, ICompiledDelegateCache)
Creates a new event processing engine that supports checkpointing.
Declaration
public CheckpointingQueryEngine(Uri uri, IReactiveServiceResolver serviceResolver, IScheduler scheduler, IReactiveMetadata metadataRegistry, IKeyValueStore keyValueStore, ISerializationPolicy serializationPolicy, IQuotedTypeConversionTargets quotedTypeConversionTargets, TraceSource traceSource = null, ICompiledDelegateCache delegateCache = null)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | uri | URI identifying the engine. This URI should be unique across the cluster. |
IReactiveServiceResolver | serviceResolver | Resolver used by the engine to locate artifacts in reactive services across the cluster. |
IScheduler | scheduler | Scheduler used by the engine to process events and to run maintenance operations. |
IReactiveMetadata | metadataRegistry | Metadata registry used by the engine to retrieve definitions of artifacts. |
IKeyValueStore | keyValueStore | Key value store used for persistent storage of the engine's state. |
ISerializationPolicy | serializationPolicy | Serialization policy used to manage state serialization. |
IQuotedTypeConversionTargets | quotedTypeConversionTargets | Supplies an external mapping used to unquote query operators. |
System.Diagnostics.TraceSource | traceSource | Trace source used by the engine to write diagnostic information. |
ICompiledDelegateCache | delegateCache | Compiled delegate cache used to optimize compilation of expressions. A cache may be shared across engines on the same host. |
Properties
HasUnloadStarted
Gets whether an unload operation has been initiated on the engine.
Declaration
public bool HasUnloadStarted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Options
Gets an object exposing configuration options that can be set on the engine.
Declaration
public ConfigurationOptions Options { get; }
Property Value
Type | Description |
---|---|
ConfigurationOptions |
ReactiveService
Gets the reactive service exposed by the engine.
Declaration
public IReactive ReactiveService { get; }
Property Value
Type | Description |
---|---|
IReactive |
ReliableReactiveService
Gets the reliable reactive service exposed by the engine.
Declaration
public IReliableReactive ReliableReactiveService { get; }
Property Value
Type | Description |
---|---|
IReliableReactive |
Scheduler
Gets the scheduler used by the engine to process events and run maintenance operations.
Declaration
public IScheduler Scheduler { get; }
Property Value
Type | Description |
---|---|
IScheduler |
Remarks
This scheduler may be paused and resumed by the engine at various times and should not be used to schedule work that's not related to this engine instance.
ServiceProvider
Get the reactive provider exposed by the engine.
Declaration
public IReactiveServiceProvider ServiceProvider { get; }
Property Value
Type | Description |
---|---|
IReactiveServiceProvider |
Status
Gets the current status of the engine.
Declaration
public QueryEngineStatus Status { get; }
Property Value
Type | Description |
---|---|
QueryEngineStatus |
TraceSource
Gets the trace source used by the engine to write diagnostic information.
Declaration
public TraceSource TraceSource { get; }
Property Value
Type | Description |
---|---|
System.Diagnostics.TraceSource |
Uri
Gets the URI identifying the engine.
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
Methods
CheckpointAsync(IStateWriter, CancellationToken, IProgress<Int32>)
Saves the state of the event processing engine to a store.
Declaration
public Task CheckpointAsync(IStateWriter writer, CancellationToken token = null, IProgress<int> progress = null)
Parameters
Type | Name | Description |
---|---|---|
IStateWriter | writer | Writer to save state to. |
System.Threading.CancellationToken | token | Cancellation token to observe cancellation requests. |
System.IProgress<System.Int32> | progress | Progress indicator reporting progress percentages. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task to observe the eventual completion of the operation. |
CreateOperatorContext(Uri)
Processes a request to create an operator context to thread through an initialized artifact using SetContext.
Declaration
protected virtual IHostedOperatorContext CreateOperatorContext(Uri instanceId)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | instanceId | URI identifying the artifact instance that will receive the operator context. |
Returns
Type | Description |
---|---|
IHostedOperatorContext | Operator context that will be passed to the artifact during its initialization using SetContext. |
Dispose()
Disposes resources.
Declaration
public void Dispose()
Dispose(Boolean)
Disposes resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | true if called from System.IDisposable.Dispose; otherwise, false. |
DisposeAsync()
Disposes resources asynchronously.
Declaration
public ValueTask DisposeAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A task to await the completion of the dispose operation. |
DisposeAsyncCore()
Disposes resources asynchronously.
Declaration
protected virtual ValueTask DisposeAsyncCore()
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A task to await the completion of the dispose operation. |
RecoverAsync(IStateReader, CancellationToken, IProgress<Int32>)
Recovers the state of the event processing engine from a store.
Declaration
public Task RecoverAsync(IStateReader reader, CancellationToken token = null, IProgress<int> progress = null)
Parameters
Type | Name | Description |
---|---|---|
IStateReader | reader | Reader to load state from. |
System.Threading.CancellationToken | token | Cancellation token to observe cancellation requests. |
System.IProgress<System.Int32> | progress | Progress indicator reporting progress percentages. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task to observe the eventual completion of the operation. |
UnloadAsync(IProgress<Int32>)
Unloads the event processing engine.
Declaration
public Task UnloadAsync(IProgress<int> progress = null)
Parameters
Type | Name | Description |
---|---|---|
System.IProgress<System.Int32> | progress | Progress indicator reporting progress percentages. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task to observe the eventual completion of the operation. |
Events
EntityCreated
An event triggered when a runtime entity is created.
Declaration
public event EventHandler<ReactiveEntityEventArgs> EntityCreated
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntityEventArgs> |
EntityDefined
An event triggered when a definition entity is defined.
Declaration
public event EventHandler<ReactiveEntityEventArgs> EntityDefined
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntityEventArgs> |
EntityDeleted
An event triggered when a runtime entity is deleted.
Declaration
public event EventHandler<ReactiveEntityEventArgs> EntityDeleted
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntityEventArgs> |
EntityLoadFailed
An event triggered when a runtime entity failed to load during recovery.
Declaration
public event EventHandler<ReactiveEntityLoadFailedEventArgs> EntityLoadFailed
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntityLoadFailedEventArgs> |
EntityReplayFailed
An event triggered when a runtime entity failed to save during checkpointing.
Declaration
public event EventHandler<ReactiveEntityReplayFailedEventArgs> EntityReplayFailed
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntityReplayFailedEventArgs> |
EntitySaveFailed
An event triggered when a runtime entity failed to save during checkpointing.
Declaration
public event EventHandler<ReactiveEntitySaveFailedEventArgs> EntitySaveFailed
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntitySaveFailedEventArgs> |
EntityUndefined
An event triggered when a definition entity is undefined.
Declaration
public event EventHandler<ReactiveEntityEventArgs> EntityUndefined
Event Type
Type | Description |
---|---|
System.EventHandler<ReactiveEntityEventArgs> |
SchedulerContinued
An event triggered when the scheduler for the query engine has continued.
Declaration
public event EventHandler<SchedulerContinuedEventArgs> SchedulerContinued
Event Type
Type | Description |
---|---|
System.EventHandler<SchedulerContinuedEventArgs> |
SchedulerContinuing
An event triggered when the scheduler for the query engine is continuing.
Declaration
public event EventHandler<SchedulerContinuingEventArgs> SchedulerContinuing
Event Type
Type | Description |
---|---|
System.EventHandler<SchedulerContinuingEventArgs> |
SchedulerPaused
An event triggered when the scheduler for the query engine has been paused.
Declaration
public event EventHandler<SchedulerPausedEventArgs> SchedulerPaused
Event Type
Type | Description |
---|---|
System.EventHandler<SchedulerPausedEventArgs> |
SchedulerPausing
An event triggered when the scheduler for the query engine is pausing.
Declaration
public event EventHandler<SchedulerPausingEventArgs> SchedulerPausing
Event Type
Type | Description |
---|---|
System.EventHandler<SchedulerPausingEventArgs> |