![]() |
#include <aerospike/as_std.h>
#include <aerospike/as_key.h>
#include <aerospike/as_error.h>
#include <aerospike/as_status.h>
#include <pthread.h>
Go to the source code of this file.
Data Structures | |
struct | as_txn |
struct | as_txn_hash |
struct | as_txn_hash_row |
struct | as_txn_iter |
struct | as_txn_key |
Macros | |
#define | AS_TXN_READ_CAPACITY_DEFAULT 128 |
#define | AS_TXN_WRITE_CAPACITY_DEFAULT 128 |
Enumerations | |
enum | as_txn_state { AS_TXN_STATE_OPEN , AS_TXN_STATE_VERIFIED , AS_TXN_STATE_COMMITTED , AS_TXN_STATE_ABORTED } |
#define AS_TXN_READ_CAPACITY_DEFAULT 128 |
#define AS_TXN_WRITE_CAPACITY_DEFAULT 128 |
enum as_txn_state |
Clear transaction. Remove all tracked keys. For internal use only.
|
inlinestatic |
Return if the transaction monitor record should be closed/deleted. For internal use only.
Definition at line 256 of file as_txn.h.
References as_txn::deadline, and as_txn::write_in_doubt.
Create transaction on heap, assign random transaction id and initialize reads/writes hashmaps with default capacities.
The default client transaction timeout is zero. This means use the server configuration mrt-duration as the transaction timeout. The default mrt-duration is 10 seconds.
Create transaction on heap, assign random transaction id and initialize reads/writes hashmaps with given capacities.
The default client transaction timeout is zero. This means use the server configuration mrt-duration as the transaction timeout. The default mrt-duration is 10 seconds.
reads_capacity | expected number of record reads in the transaction. Minimum value is 16. |
writes_capacity | expected number of record writes in the transaction. Minimum value is 16. |
Get record version for a given key. For internal use only.
Initialize transaction, assign random transaction id and initialize reads/writes hashmaps with default capacities.
The default client transaction timeout is zero. This means use the server configuration mrt-duration as the transaction timeout. The default mrt-duration is 10 seconds.
Call this function or as_txn_init_capacity(), but not both. Do not use this function for async commands (use as_txn_create() instead).
txn | Transaction. |
AS_EXTERN void as_txn_init_capacity | ( | as_txn * | txn, |
uint32_t | reads_capacity, | ||
uint32_t | writes_capacity ) |
Initialize transaction, assign random transaction id and initialize reads/writes hashmaps with given capacities.
The default client transaction timeout is zero. This means use the server configuration mrt-duration as the transaction timeout. The default mrt-duration is 10 seconds.
Call this function or as_txn_init(), but not both. Do not use this function for async commands (use as_txn_create_capacity() instead).
txn | Transaction. |
reads_capacity | expected number of record reads in the transaction. Minimum value is 16. |
writes_capacity | expected number of record writes in the transaction. Minimum value is 16. |
AS_EXTERN as_txn_key * as_txn_iter_next | ( | as_txn_iter * | iter | ) |
Return next available hash element or NULL if no more elements are available.
|
inlinestatic |
Initialize read keys iterator.
Definition at line 280 of file as_txn.h.
References as_txn_iter::ele, as_txn_iter::idx, as_txn_iter::khash, as_txn::reads, as_txn_iter::row, and as_txn_hash::table.
|
inlinestatic |
Initialize write keys iterator.
Definition at line 292 of file as_txn.h.
References as_txn_iter::ele, as_txn_iter::idx, as_txn_iter::khash, as_txn_iter::row, as_txn_hash::table, and as_txn::writes.
|
inlinestatic |
Does transaction monitor record exist.
Definition at line 265 of file as_txn.h.
References as_txn::deadline.
AS_EXTERN void as_txn_on_read | ( | as_txn * | txn, |
const uint8_t * | digest, | ||
const char * | set, | ||
uint64_t | version ) |
Process the results of a record read. For internal use only.
AS_EXTERN void as_txn_on_write | ( | as_txn * | txn, |
const uint8_t * | digest, | ||
const char * | set, | ||
uint64_t | version, | ||
int | rc ) |
Process the results of a record write. For internal use only.
Add key to write hash when write command is in doubt (usually caused by timeout). For internal use only.
|
inlinestatic |
Return read hash size.
Definition at line 194 of file as_txn.h.
References as_txn_hash::n_eles, and as_txn::reads.
Set transaction namespace only if doesn't already exist. If namespace already exists, verify new namespace is the same. For internal use only.
|
inlinestatic |
Set transaction timeout in seconds. The timer starts when the transaction monitor record is created. This occurs when the first command in the transaction is executed. If the timeout is reached before an aerospike_commit() or aerospike_abort() is called, the server will expire and rollback the transaction.
If the transaction timeout is zero, the server configuration mrt-duration is used. The default mrt-duration is 10 seconds.
Definition at line 185 of file as_txn.h.
References as_txn::timeout.
Verify that the transaction state allows future commands.
Return if writes hashmap contains the given key.
|
inlinestatic |
Return write hash size.
Definition at line 215 of file as_txn.h.
References as_txn_hash::n_eles, and as_txn::writes.