PMEMKV
1.5.0-git3.g5c9f963
This is the C++ documentation for PMEMKV.
|
Pmemkv transaction handle. More...
#include <libpmemkv.hpp>
Public Member Functions | |
tx (pmemkv_tx *tx_) noexcept | |
Constructs C++ tx object from a C pmemkv_tx pointer. More... | |
status | put (string_view key, string_view value) noexcept |
Inserts a key-value pair into pmemkv database. More... | |
status | remove (string_view key) noexcept |
Removes from database record with given key. More... | |
status | commit () noexcept |
Commits the transaction. More... | |
void | abort () noexcept |
Aborts the transaction. More... | |
Private Attributes | |
std::unique_ptr< pmemkv_tx, decltype(&pmemkv_tx_end)> | tx_ |
Pmemkv transaction handle.
This API is EXPERIMENTAL and might change.
The tx class allows grouping put and remove operations into a single atomic action (with respect to persistence and concurrency). Concurrent engines provide transactions with ACID (atomicity, consistency, isolation, durability) properties. Transactions for single threaded engines provide atomicity, consistency and durability. Actions in a transaction are executed in the order in which they were called.
Example usage:
|
inlinenoexcept |
Constructs C++ tx object from a C pmemkv_tx pointer.
|
inlinenoexcept |
Aborts the transaction.
The tx object can be safely used after abort.
|
inlinenoexcept |
Commits the transaction.
All operations of this transaction are applied as a single power fail-safe atomic action. The tx object can be safely used after commit.
|
inlinenoexcept |
Inserts a key-value pair into pmemkv database.
The inserted elements are not visible (not even in the same thread) until commit.
[in] | key | record's key; record will be put into database under its name |
[in] | value | data to be inserted into this new database record |
|
inlinenoexcept |
Removes from database record with given key.
The removed element is still visible until commit. This function will succeed even if there is no element in the database.
[in] | key | record's key to query for, to be removed |
|
private |