3#include <mutable/mutable-config.hpp>
21 int64_t start_time_ = -1;
53 virtual bool commit(std::unique_ptr<Transaction> t) = 0;
57 virtual bool abort(std::unique_ptr<Transaction> t) = 0;
61 bool autocommit(std::unique_ptr<ast::Command> command,
Diagnostic &diag);
and(sizeof(T)==4) U64x1 reinterpret_to_U64(m
auto operator==(const Transaction &other) const
auto operator<=>(const Transaction &other) const
static std::atomic< uint64_t > next_id_
Stores the next available Transaction ID, stored atomically to prevent race conditions
void start_time(int64_t time)
sets the start time of the Transaction. Should only be set once and only to a positive number.
uint64_t id_
the Transaction ID
int64_t start_time() const
The Scheduler handles the execution of all incoming queries.
std::tuple< Transaction &, std::unique_ptr< ast::Command >, Diagnostic &, std::promise< bool > > queued_command
virtual std::unique_ptr< Transaction > begin_transaction()=0
Returns a new Scheduler::Transaction object that is passed along when scheduling commands.
virtual bool commit(std::unique_ptr< Transaction > t)=0
Closes the given Scheduler::Transaction and commits its changes.
virtual bool abort(std::unique_ptr< Transaction > t)=0
Closes the given Scheduler::Transaction and discards its changes.
virtual std::future< bool > schedule_command(Transaction &t, std::unique_ptr< ast::Command > command, Diagnostic &diag)=0
Schedule a ast::Command for execution within the given Scheduler::Transaction.