C# Class FoundationDB.Layers.Counters.FdbHighContentionCounter

Represents an integer value which can be incremented without conflict. Uses a sharded representation (which scales with contention) along with background coalescing...
This is obsoleted for most practical purposes by the addition of atomic to FoundationDB v2.x, which do the same thing more efficiently.
Afficher le fichier Open project: BedeGaming/foundationdb-dotnet-client

Méthodes publiques

Méthode Description
Add ( IFdbTransaction trans, long x ) : void

Add the value x to the counter.

AddAsync ( long x, CancellationToken cancellationToken ) : Task

Add the value x to the counter.

FdbHighContentionCounter ( IFdbDatabase db, FdbSubspace subspace ) : FoundationDB.Client

Create a new High Contention counter.

FdbHighContentionCounter ( IFdbDatabase db, FdbSubspace subspace, IValueEncoder encoder ) : FoundationDB.Client

Create a new High Contention counter, using a specific value encoder.

GetSnapshot ( IFdbReadOnlyTransaction trans ) : Task

Get the value of the counter with snapshot isolation (no transaction conflicts).

GetSnapshotAsync ( CancellationToken cancellationToken ) : Task

Get the value of the counter with snapshot isolation (no transaction conflicts).

GetTransactional ( IFdbReadOnlyTransaction trans ) : Task

Get the value of the counter. Not recommended for use with read/write transactions when the counter is being frequently updated (conflicts will be very likely).

GetTransactionalAsync ( CancellationToken cancellationToken ) : Task

Get the value of the counter. Not recommended for use with read/write transactions when the counter is being frequently updated (conflicts will be very likely).

SetTotal ( IFdbTransaction trans, long x ) : Task

Set the counter to value x.

SetTotalAsync ( long x, CancellationToken cancellationToken ) : Task

Set the counter to value x.

Méthodes protégées

Méthode Description
RandomId ( ) : Slice

Generate a new random slice

Private Methods

Méthode Description
BackgroundCoalesce ( int n, CancellationToken ct ) : void
Coalesce ( int N, CancellationToken ct ) : Task

Method Details

Add() public méthode

Add the value x to the counter.
public Add ( IFdbTransaction trans, long x ) : void
trans IFdbTransaction
x long
Résultat void

AddAsync() public méthode

Add the value x to the counter.
public AddAsync ( long x, CancellationToken cancellationToken ) : Task
x long
cancellationToken System.Threading.CancellationToken
Résultat Task

FdbHighContentionCounter() public méthode

Create a new High Contention counter.
public FdbHighContentionCounter ( IFdbDatabase db, FdbSubspace subspace ) : FoundationDB.Client
db IFdbDatabase Database used by this layer
subspace FdbSubspace Subspace to be used for storing the counter
Résultat FoundationDB.Client

FdbHighContentionCounter() public méthode

Create a new High Contention counter, using a specific value encoder.
public FdbHighContentionCounter ( IFdbDatabase db, FdbSubspace subspace, IValueEncoder encoder ) : FoundationDB.Client
db IFdbDatabase Database used by this layer
subspace FdbSubspace Subspace to be used for storing the counter
encoder IValueEncoder Encoder for the counter values
Résultat FoundationDB.Client

GetSnapshot() public méthode

Get the value of the counter with snapshot isolation (no transaction conflicts).
public GetSnapshot ( IFdbReadOnlyTransaction trans ) : Task
trans IFdbReadOnlyTransaction
Résultat Task

GetSnapshotAsync() public méthode

Get the value of the counter with snapshot isolation (no transaction conflicts).
public GetSnapshotAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Résultat Task

GetTransactional() public méthode

Get the value of the counter. Not recommended for use with read/write transactions when the counter is being frequently updated (conflicts will be very likely).
public GetTransactional ( IFdbReadOnlyTransaction trans ) : Task
trans IFdbReadOnlyTransaction
Résultat Task

GetTransactionalAsync() public méthode

Get the value of the counter. Not recommended for use with read/write transactions when the counter is being frequently updated (conflicts will be very likely).
public GetTransactionalAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Résultat Task

RandomId() protected méthode

Generate a new random slice
protected RandomId ( ) : Slice
Résultat Slice

SetTotal() public méthode

Set the counter to value x.
public SetTotal ( IFdbTransaction trans, long x ) : Task
trans IFdbTransaction
x long
Résultat Task

SetTotalAsync() public méthode

Set the counter to value x.
public SetTotalAsync ( long x, CancellationToken cancellationToken ) : Task
x long
cancellationToken System.Threading.CancellationToken
Résultat Task