Joedb 10.0.1
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Member Functions | List of all members
joedb::Readonly_Client Class Reference

Specialized client for read-only files. More...

#include <joedb/concurrency/Readonly_Client.h>

Inheritance diagram for joedb::Readonly_Client:
Inheritance graph
[legend]
Collaboration diagram for joedb::Readonly_Client:
Collaboration graph
[legend]

Public Member Functions

 Readonly_Client (Buffered_File &file, Connection &connection, Content_Check content_check=Content_Check::fast, Recovery recovery=Recovery::none)
 
int64_t pull (std::chrono::milliseconds wait=std::chrono::milliseconds(0)) override
 
int64_t push_if_ahead () override
 
 ~Readonly_Client () override
 
- Public Member Functions inherited from joedb::Client
 Client (Readonly_Journal &journal, Connection &connection, Content_Check content_check)
 
const Readonly_Journalget_journal () const
 
bool is_shared () const
 
bool is_pullonly () const
 
int64_t get_journal_checkpoint () const
 
std::string read_blob (Blob blob) const
 
int64_t get_connection_checkpoint () const
 
int64_t get_checkpoint_difference () const
 
virtual ~Client ()
 

Additional Inherited Members

- Protected Types inherited from joedb::Readonly_Journal
enum class  operation_t : uint8_t {
  create_table = 0x01 , drop_table = 0x02 , add_field = 0x03 , drop_field = 0x04 ,
  insert_into = 0x05 , delete_from = 0x06 , update = 0x07 , append = 0x08 ,
  update_last = 0x09 , comment = 0x0a , timestamp = 0x0b , rename_table = 0x0c ,
  rename_field = 0x0d , valid_data = 0x0e , insert_vector = 0x0f , custom = 0x10 ,
  update_vector = 0x11 , update_next = 0x12 , blob = 0x13 , delete_vector = 0x14 ,
  updates = 0x80 , TYPE_MACRO
}
 
- Protected Member Functions inherited from joedb::Readonly_Journal
void reset_context ()
 
Type read_type ()
 
std::string safe_read_string ()
 
 Readonly_Journal (Journal_Construction_Lock &lock)
 
 Readonly_Journal (Journal_Construction_Lock &&lock)
 
 Readonly_Journal (Buffered_File &file)
 
int64_t get_position () const
 
int64_t get_checkpoint () const
 
int64_t get_hard_checkpoint () const
 
bool is_empty () const
 
bool is_shared () const
 
int64_t pull ()
 
const Buffered_Fileget_file () const
 
void replay_log (Writable &writable)
 
void replay_with_checkpoint_comments (Writable &writable)
 
void rewind ()
 
void one_step (Writable &writable)
 
void play_until (Writable &writable, int64_t end)
 
void raw_play_until (Writable &writable, int64_t end)
 
void play_until_checkpoint (Writable &writable)
 
void raw_play_until_checkpoint (Writable &writable)
 
void skip_directly_to (int64_t position)
 
bool equal_to (Readonly_Journal &journal, int64_t from, int64_t until) const
 
Async_Reader get_async_tail_reader (int64_t start_position) const
 
Async_Reader get_async_reader (int64_t start_position, int64_t until_position) const
 
- Protected Member Functions inherited from joedb::Client
virtual void read_journal ()
 
int64_t push (Unlock_Action unlock_action)
 
 Client (Readonly_Journal &journal, Connection &connection, Content_Check content_check)
 
const Readonly_Journalget_journal () const
 
bool is_shared () const
 
bool is_pullonly () const
 
int64_t get_journal_checkpoint () const
 
std::string read_blob (Blob blob) const
 
int64_t get_connection_checkpoint () const
 
int64_t get_checkpoint_difference () const
 
virtual ~Client ()
 
- Protected Attributes inherited from joedb::Readonly_Journal
Buffered_Filefile
 
int hard_index
 
int soft_index
 
int64_t checkpoint_position
 
int64_t hard_checkpoint_position
 
Table_Id table_of_last_operation
 
Record_Id record_of_last_operation
 
Field_Id field_of_last_update
 
- Protected Attributes inherited from joedb::Client
Readonly_Journaljournal
 
Connectionconnection
 
int64_t connection_checkpoint
 
- Static Protected Attributes inherited from joedb::Readonly_Journal
static constexpr uint32_t format_version = 5
 

Detailed Description

This Client has no support for transactions: the connection is locked in the constructor and unlocked in the destructor. Only allowed operations are pulling from the journal, and pushing to the connection.

Definition at line 15 of file Readonly_Client.h.

Constructor & Destructor Documentation

◆ Readonly_Client()

joedb::Readonly_Client::Readonly_Client ( Buffered_File file,
Connection connection,
Content_Check  content_check = Content_Check::fast,
Recovery  recovery = Recovery::none 
)
inline

Definition at line 18 of file Readonly_Client.h.

◆ ~Readonly_Client()

joedb::Readonly_Client::~Readonly_Client ( )
inlineoverride

Definition at line 52 of file Readonly_Client.h.

Member Function Documentation

◆ pull()

int64_t joedb::Readonly_Client::pull ( std::chrono::milliseconds  wait = std::chrono::milliseconds(0))
inlineoverridevirtual

Implements joedb::Client.

Definition at line 32 of file Readonly_Client.h.

◆ push_if_ahead()

int64_t joedb::Readonly_Client::push_if_ahead ( )
inlineoverridevirtual

Implements joedb::Client.

Definition at line 43 of file Readonly_Client.h.


The documentation for this class was generated from the following file: