Joedb 10.4.6
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
joedb::Readonly_Client Class Reference

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

#include <joedb/concurrency/Readonly_Client.h>

Inheritance diagram for joedb::Readonly_Client:
Collaboration diagram for joedb::Readonly_Client:

Public Member Functions

 Readonly_Client (Abstract_File &file, Connection &connection=Connection::dummy, 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 (int64_t until) override
 ~Readonly_Client () override
Public Member Functions inherited from joedb::Client
 Client (Readonly_Journal &journal, Connection &connection, Content_Check content_check)
const Readonly_Journal & get_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
int64_t push_if_ahead ()
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 , update_string , update_last_string , update_next_string ,
  update_vector_string , update_int32 , update_last_int32 , update_next_int32 ,
  update_vector_int32 , update_int64 , update_last_int64 , update_next_int64 ,
  update_vector_int64 , update_reference , update_last_reference , update_next_reference ,
  update_vector_reference , update_boolean , update_last_boolean , update_next_boolean ,
  update_vector_boolean , update_float32 , update_last_float32 , update_next_float32 ,
  update_vector_float32 , update_float64 , update_last_float64 , update_next_float64 ,
  update_vector_float64 , update_int8 , update_last_int8 , update_next_int8 ,
  update_vector_int8 , update_int16 , update_last_int16 , update_next_int16 ,
  update_vector_int16 , update_blob , update_last_blob , update_next_blob ,
  update_vector_blob
}
Protected Member Functions inherited from joedb::Readonly_Journal
void reset_context ()
Type read_type ()
std::string safe_read_string ()
void read_vector_of_string (std::string *data, size_t size)
void read_vector_of_int32 (int32_t *data, size_t size)
void read_vector_of_int64 (int64_t *data, size_t size)
void read_vector_of_reference (joedb::Record_Id *data, size_t size)
void read_vector_of_boolean (char *data, size_t size)
void read_vector_of_float32 (float *data, size_t size)
void read_vector_of_float64 (double *data, size_t size)
void read_vector_of_int8 (int8_t *data, size_t size)
void read_vector_of_int16 (int16_t *data, size_t size)
void read_vector_of_blob (joedb::Blob *data, size_t size)
 Readonly_Journal (Journal_Construction_Lock &lock)
 Readonly_Journal (Journal_Construction_Lock &&lock)
 Readonly_Journal (Abstract_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 Abstract_File & get_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 (int64_t until, Unlock_Action unlock_action)
int64_t push (Unlock_Action unlock_action)
 Client (Readonly_Journal &journal, Connection &connection, Content_Check content_check)
const Readonly_Journal & get_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
int64_t push_if_ahead ()
virtual ~Client ()
Protected Attributes inherited from joedb::Readonly_Journal
Abstract_File & file
File_Buffer file_buffer
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_Journal & journal
Connection & connection
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 ( Abstract_File & file,
Connection & connection = Connection::dummy,
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

◆ push_if_ahead()

int64_t joedb::Readonly_Client::push_if_ahead ( int64_t until)
inlineoverridevirtual

Implements joedb::Client.

Definition at line 43 of file Readonly_Client.h.


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