C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
RandomId ( ) : Slice

Generate a new random slice

Приватные методы

Метод Описание
BackgroundCoalesce ( int n, CancellationToken ct ) : void
Coalesce ( int N, CancellationToken ct ) : Task

Описание методов

Add() публичный Метод

Add the value x to the counter.
public Add ( IFdbTransaction trans, long x ) : void
trans IFdbTransaction
x long
Результат void

AddAsync() публичный Метод

Add the value x to the counter.
public AddAsync ( long x, CancellationToken cancellationToken ) : Task
x long
cancellationToken System.Threading.CancellationToken
Результат Task

FdbHighContentionCounter() публичный Метод

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
Результат FoundationDB.Client

FdbHighContentionCounter() публичный Метод

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
Результат FoundationDB.Client

GetSnapshot() публичный Метод

Get the value of the counter with snapshot isolation (no transaction conflicts).
public GetSnapshot ( IFdbReadOnlyTransaction trans ) : Task
trans IFdbReadOnlyTransaction
Результат Task

GetSnapshotAsync() публичный Метод

Get the value of the counter with snapshot isolation (no transaction conflicts).
public GetSnapshotAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Результат Task

GetTransactional() публичный Метод

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
Результат Task

GetTransactionalAsync() публичный Метод

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
Результат Task

RandomId() защищенный Метод

Generate a new random slice
protected RandomId ( ) : Slice
Результат Slice

SetTotal() публичный Метод

Set the counter to value x.
public SetTotal ( IFdbTransaction trans, long x ) : Task
trans IFdbTransaction
x long
Результат Task

SetTotalAsync() публичный Метод

Set the counter to value x.
public SetTotalAsync ( long x, CancellationToken cancellationToken ) : Task
x long
cancellationToken System.Threading.CancellationToken
Результат Task