![]() |
mutable
A Database System for Research and Fast Prototyping
|
The Scheduler handles the execution of all incoming queries. More...
#include <Scheduler.hpp>
Data Structures | |
struct | Transaction |
Public Member Functions | |
Scheduler ()=default | |
virtual | ~Scheduler () |
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 . | |
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. | |
bool | autocommit (std::unique_ptr< ast::Command > command, Diagnostic &diag) |
Schedule a ast::Command for execution and automatically commits its changes. | |
Protected Types | |
using | queued_command = std::tuple< Transaction &, std::unique_ptr< ast::Command >, Diagnostic &, std::promise< bool > > |
The Scheduler handles the execution of all incoming queries.
The implementation stored in the catalog determines when and how queries are executed.
Definition at line 14 of file Scheduler.hpp.
|
protected |
Definition at line 38 of file Scheduler.hpp.
|
default |
|
inlinevirtual |
Definition at line 42 of file Scheduler.hpp.
|
pure virtual |
Closes the given Scheduler::Transaction
and discards its changes.
Returns true if the changes were undone successfully.
Implemented in m::SerialScheduler.
Referenced by autocommit().
bool Scheduler::autocommit | ( | std::unique_ptr< ast::Command > | command, |
Diagnostic & | diag | ||
) |
Schedule a ast::Command
for execution and automatically commits its changes.
Returns true if the ast::Command
was executed and its changes were committed successfully.
Definition at line 9 of file Scheduler.cpp.
References abort(), begin_transaction(), commit(), M_insist, and schedule_command().
Referenced by m::process_stream().
|
pure virtual |
Returns a new Scheduler::Transaction
object that is passed along when scheduling commands.
Implemented in m::SerialScheduler.
Referenced by autocommit().
|
pure virtual |
Closes the given Scheduler::Transaction
and commits its changes.
Returns true if the changes were committed successfully.
Implemented in m::SerialScheduler.
Referenced by autocommit().
|
pure virtual |
Schedule a ast::Command
for execution within the given Scheduler::Transaction
.
Returns a std:future<bool>
that is set to true if the ast::Command
was successfully executed, false otherwise.
Implemented in m::SerialScheduler.
Referenced by autocommit().