|
Database System 0.1.0
Advanced C++20 Database System with Multi-Backend Support
|
Distributed transaction coordination. More...
#include <async_operations.h>

Classes | |
| struct | distributed_transaction |
Public Types | |
| enum class | transaction_state { active , preparing , prepared , committing , committed , aborting , aborted } |
Public Member Functions | |
| transaction_coordinator ()=default | |
| Default constructor - used by database_context. | |
| std::string | begin_distributed_transaction (const std::vector< std::shared_ptr< core::database_backend > > &participants) |
| async_result< bool > | commit_distributed_transaction (const std::string &transaction_id) |
| async_result< bool > | rollback_distributed_transaction (const std::string &transaction_id) |
| async_result< bool > | prepare_phase (const std::string &transaction_id) |
| async_result< bool > | commit_phase (const std::string &transaction_id) |
| saga_builder | create_saga () |
| void | recover_transactions () |
| std::vector< distributed_transaction > | get_active_transactions () const |
Private Member Functions | |
| async_result< bool > | two_phase_commit (const std::string &transaction_id) |
| void | cleanup_completed_transactions () |
Private Attributes | |
| std::mutex | transactions_mutex_ |
| std::unordered_map< std::string, distributed_transaction > | active_transactions_ |
| std::shared_ptr< async_executor > | executor_ |
Distributed transaction coordination.
Definition at line 652 of file async_operations.h.
|
strong |
| Enumerator | |
|---|---|
| active | |
| preparing | |
| prepared | |
| committing | |
| committed | |
| aborting | |
| aborted | |
Definition at line 655 of file async_operations.h.
|
default |
Default constructor - used by database_context.
|
inline |
Definition at line 892 of file async_operations.h.
References active, active_transactions_, database::async::transaction_coordinator::distributed_transaction::last_activity, database::async::transaction_coordinator::distributed_transaction::participants, database::async::transaction_coordinator::distributed_transaction::start_time, database::async::transaction_coordinator::distributed_transaction::state, database::async::transaction_coordinator::distributed_transaction::transaction_id, and transactions_mutex_.
|
inlineprivate |
Definition at line 1066 of file async_operations.h.
References aborted, active_transactions_, committed, and transactions_mutex_.
Referenced by recover_transactions().

|
inline |
Definition at line 994 of file async_operations.h.
References two_phase_commit().

|
inline |
Definition at line 955 of file async_operations.h.
References aborted, active_transactions_, committed, committing, database::async::make_error_result(), database::async::make_ready_result(), prepared, and transactions_mutex_.
Referenced by two_phase_commit().


|
inline |
Definition at line 1061 of file async_operations.h.
Referenced by TEST_F().

|
inline |
Definition at line 1050 of file async_operations.h.
References active_transactions_, and transactions_mutex_.
|
inline |
Definition at line 912 of file async_operations.h.
References aborted, active_transactions_, database::async::make_error_result(), database::async::make_ready_result(), prepared, preparing, and transactions_mutex_.
Referenced by two_phase_commit().


|
inline |
Definition at line 1044 of file async_operations.h.
References cleanup_completed_transactions().

|
inline |
Definition at line 1000 of file async_operations.h.
References aborted, aborting, active_transactions_, database::async::make_error_result(), database::async::make_ready_result(), and transactions_mutex_.

|
inlineprivate |
Definition at line 1034 of file async_operations.h.
References commit_phase(), database::async::async_result< T >::get(), database::async::make_ready_result(), prepare_phase(), and prepared.
Referenced by commit_distributed_transaction().


|
private |
Definition at line 699 of file async_operations.h.
Referenced by begin_distributed_transaction(), cleanup_completed_transactions(), commit_phase(), get_active_transactions(), prepare_phase(), and rollback_distributed_transaction().
|
private |
Definition at line 700 of file async_operations.h.
|
mutableprivate |
Definition at line 698 of file async_operations.h.
Referenced by begin_distributed_transaction(), cleanup_completed_transactions(), commit_phase(), get_active_transactions(), prepare_phase(), and rollback_distributed_transaction().