mutable
A Database System for Research and Fast Prototyping
Loading...
Searching...
No Matches
Data Structures | Public Member Functions | Protected Types
m::Scheduler Struct Referenceabstract

The Scheduler handles the execution of all incoming queries. More...

#include <Scheduler.hpp>

Inheritance diagram for m::Scheduler:
[legend]

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< Transactionbegin_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 > >
 

Detailed Description

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.

Member Typedef Documentation

◆ queued_command

using m::Scheduler::queued_command = std::tuple<Transaction &, std::unique_ptr<ast::Command>, Diagnostic &, std::promise<bool> >
protected

Definition at line 38 of file Scheduler.hpp.

Constructor & Destructor Documentation

◆ Scheduler()

m::Scheduler::Scheduler ( )
default

◆ ~Scheduler()

virtual m::Scheduler::~Scheduler ( )
inlinevirtual

Definition at line 42 of file Scheduler.hpp.

Member Function Documentation

◆ abort()

virtual bool m::Scheduler::abort ( std::unique_ptr< Transaction t)
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().

◆ 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().

◆ begin_transaction()

virtual std::unique_ptr< Transaction > m::Scheduler::begin_transaction ( )
pure virtual

Returns a new Scheduler::Transaction object that is passed along when scheduling commands.

Implemented in m::SerialScheduler.

Referenced by autocommit().

◆ commit()

virtual bool m::Scheduler::commit ( std::unique_ptr< Transaction t)
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().

◆ schedule_command()

virtual std::future< bool > m::Scheduler::schedule_command ( Transaction t,
std::unique_ptr< ast::Command command,
Diagnostic diag 
)
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().


The documentation for this struct was generated from the following files: