C# Class Akka.Persistence.Sql.Common.Journal.JournalDbEngine

Class used to abstract SQL persistence capabilities for concrete implementation of actor journal.
Inheritance: IDisposable
Afficher le fichier Open project: rogeralsing/akka.net Class Usage Examples

Méthodes publiques

Свойство Type Description
Settings JournalSettings

Protected Properties

Свойство Type Description
TimestampProvider ITimestampProvider

Méthodes publiques

Méthode Description
Close ( ) : void

Closes database connection if exists.

CreateDbConnection ( ) : DbConnection
DeleteMessagesToAsync ( string persistenceId, long toSequenceNr ) : Task

Asynchronously deletes all persisted messages identified by provided persistenceId up to provided message sequence number (inclusive).

ReadEvents ( object queryId, IEnumerable hints, IActorRef sender, Action replayCallback ) : Task

Performs

ReadHighestSequenceNrAsync ( string persistenceId, long fromSequenceNr ) : Task

Asynchronously reads a highest sequence number of the event stream related with provided persistenceId.

ReplayMessagesAsync ( string persistenceId, long fromSequenceNr, long toSequenceNr, long max, IActorRef sender, Action recoveryCallback ) : Task

Asynchronously replays all requested messages related to provided persistenceId, using provided sequence ranges (inclusive) with max number of messages replayed (counting from the beginning). Replay callback is invoked for each replayed message.

WriteMessagesAsync ( IEnumerable messages ) : Task>

Asynchronously writes all persistent messages inside SQL Server database. Specific table used for message persistence may be defined through configuration within 'akka.persistence.journal.sql-server' scope with 'schema-name' and 'table-name' keys.

Méthodes protégées

Méthode Description
CopyParamsToCommand ( DbCommand sqlCommand, JournalEntry entry ) : void

Copies values from entities to database command.

CreateDbConnection ( string connectionString ) : DbConnection

Initializes a database connection.

GetConnectionString ( ) : string

Returns connection string from either HOCON configuration or <connectionStrings> section of app.config.

JournalDbEngine ( ActorSystem system ) : System

Private Methods

Méthode Description
CompleteCommand ( DbCommand sqlCommand, DbConnection connection ) : void
CreateTimestampProvider ( ) : ITimestampProvider
IDisposable ( ) : void
InsertInTransactionAsync ( DbCommand sqlCommand, IEnumerable journalEntries ) : Task
ToJournalEntry ( IPersistentRepresentation message ) : JournalEntry
TryUnwrapException ( Exception e ) : Exception

Method Details

Close() public méthode

Closes database connection if exists.
public Close ( ) : void
Résultat void

CopyParamsToCommand() protected abstract méthode

Copies values from entities to database command.
protected abstract CopyParamsToCommand ( DbCommand sqlCommand, JournalEntry entry ) : void
sqlCommand System.Data.Common.DbCommand
entry JournalEntry
Résultat void

CreateDbConnection() public méthode

public CreateDbConnection ( ) : DbConnection
Résultat System.Data.Common.DbConnection

CreateDbConnection() protected abstract méthode

Initializes a database connection.
protected abstract CreateDbConnection ( string connectionString ) : DbConnection
connectionString string
Résultat System.Data.Common.DbConnection

DeleteMessagesToAsync() public méthode

Asynchronously deletes all persisted messages identified by provided persistenceId up to provided message sequence number (inclusive).
public DeleteMessagesToAsync ( string persistenceId, long toSequenceNr ) : Task
persistenceId string
toSequenceNr long
Résultat Task

GetConnectionString() protected méthode

Returns connection string from either HOCON configuration or <connectionStrings> section of app.config.
protected GetConnectionString ( ) : string
Résultat string

JournalDbEngine() protected méthode

protected JournalDbEngine ( ActorSystem system ) : System
system ActorSystem
Résultat System

ReadEvents() public méthode

Performs
public ReadEvents ( object queryId, IEnumerable hints, IActorRef sender, Action replayCallback ) : Task
queryId object
hints IEnumerable
sender IActorRef
replayCallback Action
Résultat Task

ReadHighestSequenceNrAsync() public méthode

Asynchronously reads a highest sequence number of the event stream related with provided persistenceId.
public ReadHighestSequenceNrAsync ( string persistenceId, long fromSequenceNr ) : Task
persistenceId string
fromSequenceNr long
Résultat Task

ReplayMessagesAsync() public méthode

Asynchronously replays all requested messages related to provided persistenceId, using provided sequence ranges (inclusive) with max number of messages replayed (counting from the beginning). Replay callback is invoked for each replayed message.
public ReplayMessagesAsync ( string persistenceId, long fromSequenceNr, long toSequenceNr, long max, IActorRef sender, Action recoveryCallback ) : Task
persistenceId string Identifier of persistent messages stream to be replayed.
fromSequenceNr long Lower inclusive sequence number bound. Unbound by default.
toSequenceNr long Upper inclusive sequence number bound. Unbound by default.
max long Maximum number of messages to be replayed. Unbound by default.
sender IActorRef
recoveryCallback Action Action invoked for each replayed message.
Résultat Task

WriteMessagesAsync() public méthode

Asynchronously writes all persistent messages inside SQL Server database. Specific table used for message persistence may be defined through configuration within 'akka.persistence.journal.sql-server' scope with 'schema-name' and 'table-name' keys.
public WriteMessagesAsync ( IEnumerable messages ) : Task>
messages IEnumerable
Résultat Task>

Property Details

Settings public_oe property

Settings applied to journal mapped from HOCON config file.
public JournalSettings Settings
Résultat JournalSettings

TimestampProvider protected_oe property

Timestamp provider used for generation of timestamps for incoming persistent messages.
protected ITimestampProvider TimestampProvider
Résultat ITimestampProvider