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.
파일 보기 프로젝트 열기: BedeGaming/foundationdb-dotnet-client

공개 메소드들

메소드 설명
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