C# Class FoundationDB.Client.Native.FdbNativeTransaction

Inheritance: IFdbTransactionHandler
显示文件 Open project: BedeGaming/foundationdb-dotnet-client

Public Methods

Method Description
AddConflictRange ( Slice beginKeyInclusive, Slice endKeyExclusive, FdbConflictRangeType type ) : void
Atomic ( Slice key, Slice param, FdbMutationType type ) : void
Cancel ( ) : void
Clear ( Slice key ) : void
ClearRange ( Slice beginKeyInclusive, Slice endKeyExclusive ) : void
CommitAsync ( CancellationToken cancellationToken ) : Task

Attempts to commit the sets and clears previously applied to the database snapshot represented by this transaction to the actual database. The commit may or may not succeed – in particular, if a conflicting transaction previously committed, then the commit must fail in order to preserve transactional isolation. If the commit does succeed, the transaction is durably committed to the database and all subsequently started transactions will observe its effects.

As with other client/server databases, in some failure scenarios a client may be unable to determine whether a transaction succeeded. In these cases, CommitAsync() will throw CommitUnknownResult error. The OnErrorAsync() function treats this error as retryable, so retry loops that don’t check for CommitUnknownResult could execute the transaction twice. In these cases, you must consider the idempotence of the transaction.

Dispose ( ) : void
FdbNativeTransaction ( FdbNativeDatabase db, TransactionHandle handle ) : FoundationDB.Client.Core
GetAddressesForKeyAsync ( Slice key, CancellationToken cancellationToken ) : Task
GetAsync ( Slice key, bool snapshot, CancellationToken cancellationToken ) : Task
GetCommittedVersion ( ) : long
GetKeyAsync ( FdbKeySelector selector, bool snapshot, CancellationToken cancellationToken ) : Task
GetKeysAsync ( FdbKeySelector selectors, bool snapshot, CancellationToken cancellationToken ) : Task
GetRangeAsync ( FdbKeySelector begin, FdbKeySelector end, FdbRangeOptions options, int iteration, bool snapshot, CancellationToken cancellationToken ) : Task

Asynchronously fetch a new page of results

GetReadVersionAsync ( CancellationToken cancellationToken ) : Task
GetValuesAsync ( Slice keys, bool snapshot, CancellationToken cancellationToken ) : Task
OnErrorAsync ( FdbError code, CancellationToken cancellationToken ) : Task
Reset ( ) : void
Set ( Slice key, Slice value ) : void
SetOption ( FdbTransactionOption option, Slice data ) : void
SetReadVersion ( long version ) : void
Watch ( Slice key, CancellationToken cancellationToken ) : FdbWatch

Private Methods

Method Description
Dispose ( bool disposing ) : void
GetKeyResult ( FutureHandle h ) : Slice
GetKeyValueArrayResult ( FutureHandle h, bool &more ) : Slice>[].KeyValuePair
GetStringArrayResult ( FutureHandle h ) : string[]
GetValueResultBytes ( FutureHandle h ) : Slice
ResetInternal ( ) : void
TryGetValueResult ( FutureHandle h, Slice &result ) : bool

Method Details

AddConflictRange() public method

public AddConflictRange ( Slice beginKeyInclusive, Slice endKeyExclusive, FdbConflictRangeType type ) : void
beginKeyInclusive Slice
endKeyExclusive Slice
type FdbConflictRangeType
return void

Atomic() public method

public Atomic ( Slice key, Slice param, FdbMutationType type ) : void
key Slice
param Slice
type FdbMutationType
return void

Cancel() public method

public Cancel ( ) : void
return void

Clear() public method

public Clear ( Slice key ) : void
key Slice
return void

ClearRange() public method

public ClearRange ( Slice beginKeyInclusive, Slice endKeyExclusive ) : void
beginKeyInclusive Slice
endKeyExclusive Slice
return void

CommitAsync() public method

Attempts to commit the sets and clears previously applied to the database snapshot represented by this transaction to the actual database. The commit may or may not succeed – in particular, if a conflicting transaction previously committed, then the commit must fail in order to preserve transactional isolation. If the commit does succeed, the transaction is durably committed to the database and all subsequently started transactions will observe its effects.
As with other client/server databases, in some failure scenarios a client may be unable to determine whether a transaction succeeded. In these cases, CommitAsync() will throw CommitUnknownResult error. The OnErrorAsync() function treats this error as retryable, so retry loops that don’t check for CommitUnknownResult could execute the transaction twice. In these cases, you must consider the idempotence of the transaction.
public CommitAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task

Dispose() public method

public Dispose ( ) : void
return void

FdbNativeTransaction() public method

public FdbNativeTransaction ( FdbNativeDatabase db, TransactionHandle handle ) : FoundationDB.Client.Core
db FdbNativeDatabase
handle TransactionHandle
return FoundationDB.Client.Core

GetAddressesForKeyAsync() public method

public GetAddressesForKeyAsync ( Slice key, CancellationToken cancellationToken ) : Task
key Slice
cancellationToken System.Threading.CancellationToken
return Task

GetAsync() public method

public GetAsync ( Slice key, bool snapshot, CancellationToken cancellationToken ) : Task
key Slice
snapshot bool
cancellationToken System.Threading.CancellationToken
return Task

GetCommittedVersion() public method

public GetCommittedVersion ( ) : long
return long

GetKeyAsync() public method

public GetKeyAsync ( FdbKeySelector selector, bool snapshot, CancellationToken cancellationToken ) : Task
selector FdbKeySelector
snapshot bool
cancellationToken System.Threading.CancellationToken
return Task

GetKeysAsync() public method

public GetKeysAsync ( FdbKeySelector selectors, bool snapshot, CancellationToken cancellationToken ) : Task
selectors FdbKeySelector
snapshot bool
cancellationToken System.Threading.CancellationToken
return Task

GetRangeAsync() public method

Asynchronously fetch a new page of results
public GetRangeAsync ( FdbKeySelector begin, FdbKeySelector end, FdbRangeOptions options, int iteration, bool snapshot, CancellationToken cancellationToken ) : Task
begin FdbKeySelector
end FdbKeySelector
options FdbRangeOptions
iteration int
snapshot bool
cancellationToken System.Threading.CancellationToken
return Task

GetReadVersionAsync() public method

public GetReadVersionAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
return Task

GetValuesAsync() public method

public GetValuesAsync ( Slice keys, bool snapshot, CancellationToken cancellationToken ) : Task
keys Slice
snapshot bool
cancellationToken System.Threading.CancellationToken
return Task

OnErrorAsync() public method

public OnErrorAsync ( FdbError code, CancellationToken cancellationToken ) : Task
code FdbError
cancellationToken System.Threading.CancellationToken
return Task

Reset() public method

public Reset ( ) : void
return void

Set() public method

public Set ( Slice key, Slice value ) : void
key Slice
value Slice
return void

SetOption() public method

public SetOption ( FdbTransactionOption option, Slice data ) : void
option FdbTransactionOption
data Slice
return void

SetReadVersion() public method

public SetReadVersion ( long version ) : void
version long
return void

Watch() public method

public Watch ( Slice key, CancellationToken cancellationToken ) : FdbWatch
key Slice
cancellationToken System.Threading.CancellationToken
return FdbWatch