SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Common::Files::RgrData Namespace Reference

Functions

static void read (DB::RgrData &data, int &err, const std::string &filepath)
 
static void set_rgr (const DB::RgrData &data, int &err, std::string &&filepath, uint8_t replication) noexcept
 
static void get_rgr (DB::RgrData &data, const std::string &filepath) noexcept
 

Variables

static const uint8_t HEADER_SIZE = 12
 
static const uint8_t HEADER_OFFSET_CHKSUM = 8
 

Function Documentation

◆ get_rgr()

static void SWC::Common::Files::RgrData::get_rgr ( DB::RgrData data,
const std::string &  filepath 
)
staticnoexcept

Definition at line 83 of file RgrData.h.

References data, SWC::Common::Files::Schema::filepath(), SWC::Error::OK, and read().

Referenced by SWC::Manager::Range::get_last_rgr(), and SWC::Ranger::Range::last_rgr_chk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

static void SWC::Common::Files::RgrData::read ( DB::RgrData data,
int &  err,
const std::string &  filepath 
)
static

Definition at line 27 of file RgrData.h.

References SWC::Core::Buffer< T >::base, SWC::Core::checksum_i32_chk(), SWC::Error::CHECKSUM_MISMATCH, data, SWC::Serialization::decode_i32(), SWC::Common::Files::Schema::filepath(), HEADER_OFFSET_CHKSUM, HEADER_SIZE, SWC::Env::FsInterface::interface(), and SWC::Core::Buffer< T >::size.

Referenced by SWC::FS::FileSystem::default_read(), get_rgr(), SWC::Ranger::RangeData::load(), SWC::FS::FileSystem::read(), and SWC::Comm::ConnHandler::received().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_rgr()

static void SWC::Common::Files::RgrData::set_rgr ( const DB::RgrData data,
int &  err,
std::string &&  filepath,
uint8_t  replication 
)
inlinestaticnoexcept

Definition at line 49 of file RgrData.h.

References SWC::Core::Buffer< T >::base, SWC::Core::checksum_i32(), data, SWC::Serialization::encode_i32(), SWC::Core::BufferDyn< BufferT >::ensure(), SWC::Common::Files::Schema::filepath(), HEADER_SIZE, SWC::Env::FsInterface::interface(), SWC::FS::SmartFd::make_ptr(), SWC::FS::OPEN_FLAG_OVERWRITE, SWC::Core::BufferDyn< BufferT >::ptr, and SWC_CURRENT_EXCEPTION.

Referenced by SWC::Ranger::Range::internal_take_ownership(), and SWC::Ranger::Range::set_rgr().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ HEADER_OFFSET_CHKSUM

const uint8_t SWC::Common::Files::RgrData::HEADER_OFFSET_CHKSUM = 8
static

Definition at line 24 of file RgrData.h.

Referenced by SWC::Ranger::RangeData::load(), and read().

◆ HEADER_SIZE

const uint8_t SWC::Common::Files::RgrData::HEADER_SIZE = 12
static