15 const int64_t min = std::min
18 client_journal.get_checkpoint()
21 const int64_t fast_size = 1 << 11;
51 std::chrono::milliseconds wait
54 if (
bool(lock_action))
55 throw Exception(
"Connected to a read-only journal: can't lock");
59 if (
bool(data_transfer))
75 throw Exception(
"Connected to a read-only journal: can't push");
93 std::chrono::milliseconds wait
96 if (
bool(lock_action))
97 get_journal().lock_pull();
101 if (
bool(data_transfer))
119 get_journal().pull_from(client_journal, until);
127 get_journal().unlock();
134 get_journal().unlock();
static void content_mismatch()
Called by handshake when the file and the connection do not match.
void unlock() override
Unlock the connection.
Journal_Connection(Writable_Journal &server_journal)
int64_t push(const Readonly_Journal &client_journal, const int64_t from, const int64_t until, Unlock_Action unlock_action) override
Push new data to the connection.
int64_t pull(Lock_Action lock_action, Data_Transfer data_transfer, Writable_Journal &client_journal, std::chrono::milliseconds wait) override
Pull from the connection.
int64_t pull(Lock_Action lock_action, Data_Transfer data_transfer, Writable_Journal &client_journal, std::chrono::milliseconds wait) override
Pull from the connection.
int64_t handshake(const Readonly_Journal &client_journal, Content_Check content_check) override
Called during Client construction.
int64_t push(const Readonly_Journal &client_journal, const int64_t from, const int64_t until, Unlock_Action unlock_action) override
Push new data to the connection.
Readonly_Journal & server_journal
Pullonly_Journal_Connection(Readonly_Journal &server_journal)
#define JOEDB_RELEASE_ASSERT(x)
always-tested assertion (release and debug mode)