From a2b2f7e7498da42885653c385175e0ed9de17f42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Gra=CC=88tzer?= Date: Thu, 4 Feb 2021 15:38:56 +0100 Subject: [PATCH] Stardog Patches: WriteBatch + WriteBufferManager --- include/rocksdb/write_batch.h | 4 ++++ include/rocksdb/write_buffer_manager.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/rocksdb/write_batch.h b/include/rocksdb/write_batch.h index 51fd4d8ac..dfadeca8a 100644 --- a/include/rocksdb/write_batch.h +++ b/include/rocksdb/write_batch.h @@ -173,6 +173,10 @@ class WriteBatch : public WriteBatchBase { // Otherwise returns Status::OK(). Status PopSavePoint() override; + void setContentFlag(uint32_t theContentFlag) { + content_flags_.store(theContentFlag,std::memory_order_seq_cst); + } + // Support for iterating over the contents of a batch. class Handler { public: diff --git a/include/rocksdb/write_buffer_manager.h b/include/rocksdb/write_buffer_manager.h index ae1c98caf..22b69abb9 100644 --- a/include/rocksdb/write_buffer_manager.h +++ b/include/rocksdb/write_buffer_manager.h @@ -87,8 +87,12 @@ class WriteBufferManager { } } + void SetBufferSize(size_t new_size) { + buffer_size_ = new_size; + } + private: - const size_t buffer_size_; + std::atomic buffer_size_; const size_t mutable_limit_; std::atomic memory_used_; // Memory that hasn't been scheduled to free.