Functions | |
std::string | filepath (cid_t cid) |
void | remove (int &err, cid_t cid) |
void | write (SWC::DynamicBuffer &dst_buf, const DB::Schema::Ptr &schema) |
void | save (int &err, const DB::Schema::Ptr &schema, uint8_t replication=0) |
void | load (int &err, const std::string &filepath, DB::Schema::Ptr &schema) |
DB::Schema::Ptr | load (int &err, cid_t cid, uint8_t replication, bool recover=true) |
void | save_with_validation (int &err, const DB::Schema::Ptr &schema_save, uint8_t replication) |
Variables | |
const uint8_t | HEADER_SIZE = 13 |
const uint8_t | HEADER_OFFSET_CHKSUM = 9 |
const uint8_t | VERSION = 1 |
static const char | schema_file [] = "schema.data" |
std::string SWC::Common::Files::Schema::filepath | ( | cid_t | cid | ) |
Definition at line 34 of file Schema.h.
References SWC::DB::RangeBase::get_column_path(), and schema_file.
Referenced by SWC::Core::LogWriter::_renew_files(), SWC::Common::Files::RgrData::get_rgr(), load(), SWC::Comm::ConfigSSL::load_file(), SWC::Ranger::CommitLog::Fragment::make_read(), SWC::Ranger::CommitLog::Fragment::make_write(), SWC::client::SQL::parse_dump(), SWC::client::SQL::QuerySelect::parse_dump(), SWC::client::SQL::parse_load(), SWC::client::SQL::QueryUpdate::parse_load(), SWC::Common::Files::RgrData::read(), remove(), SWC::DB::Cells::TSV::FileWriter::roll_file(), save(), and SWC::Common::Files::RgrData::set_rgr().
DB::Schema::Ptr SWC::Common::Files::Schema::load | ( | int & | err, |
cid_t | cid, | ||
uint8_t | replication, | ||
bool | recover = true |
||
) |
Definition at line 112 of file Schema.h.
References filepath(), SWC::DB::Types::SystemColumn::get_seq_type(), SWC::DB::Types::SystemColumn::is_master(), load(), SWC::LOG_WARN, SWC::DB::Schema::make(), SWC::Error::OK, save(), SWC::DB::Types::SERIAL, SWC::Error::SERVER_SHUTTING_DOWN, SWC_FMT_LU, SWC_LOG_CURRENT_EXCEPTION, SWC_LOG_OSTREAM, SWC_LOG_OUT, SWC_LOGF, SWC::DB::Types::SystemColumn::SYS_CID_DEFINE_LEXIC, SWC::DB::Types::SystemColumn::SYS_CID_END, SWC::DB::Types::SystemColumn::SYS_CID_STATS, SWC::DB::Types::SystemColumn::SYS_RGR_DATA, SWC::DB::Types::to_string(), and SWC::Core::to_string().
void SWC::Common::Files::Schema::load | ( | int & | err, |
const std::string & | filepath, | ||
DB::Schema::Ptr & | schema | ||
) |
Definition at line 87 of file Schema.h.
References SWC::Core::Buffer< T >::base, SWC::Core::checksum_i32_chk(), SWC::Error::CHECKSUM_MISMATCH, SWC::Serialization::decode_i32(), SWC::Serialization::decode_i8(), filepath(), HEADER_OFFSET_CHKSUM, HEADER_SIZE, SWC::Env::FsInterface::interface(), and SWC::Core::Buffer< T >::size.
Referenced by SWC::Manager::MngdColumns::initialize(), SWC::Core::AtomicBase< State >::load(), load(), and save_with_validation().
void SWC::Common::Files::Schema::remove | ( | int & | err, |
cid_t | cid | ||
) |
Definition at line 44 of file Schema.h.
References filepath(), and SWC::Env::FsInterface::interface().
Referenced by SWC::FS::FileSystem::remove().
void SWC::Common::Files::Schema::save | ( | int & | err, |
const DB::Schema::Ptr & | schema, | ||
uint8_t | replication = 0 |
||
) |
Definition at line 70 of file Schema.h.
References filepath(), SWC::Env::FsInterface::interface(), SWC::FS::SmartFd::make_ptr(), SWC::FS::OPEN_FLAG_OVERWRITE, and write().
Referenced by SWC::Ranger::RangeData::load(), load(), and save_with_validation().
void SWC::Common::Files::Schema::save_with_validation | ( | int & | err, |
const DB::Schema::Ptr & | schema_save, | ||
uint8_t | replication | ||
) |
Definition at line 174 of file Schema.h.
References SWC::Error::COLUMN_SCHEMA_BAD_SAVE, load(), SWC::Error::OK, and save().
Referenced by SWC::Manager::MngdColumns::create(), and SWC::Manager::MngdColumns::update().
void SWC::Common::Files::Schema::write | ( | SWC::DynamicBuffer & | dst_buf, |
const DB::Schema::Ptr & | schema | ||
) |
Definition at line 50 of file Schema.h.
References SWC::Core::Buffer< T >::base, SWC::Core::checksum_i32(), SWC::Serialization::encode_i32(), SWC::Serialization::encode_i8(), SWC::Core::BufferDyn< BufferT >::ensure(), HEADER_SIZE, SWC::Core::BufferDyn< BufferT >::ptr, and VERSION.
Referenced by SWC::Ranger::CommitLog::Compact::Group::run(), SWC::Ranger::RangeData::save(), save(), and SWC::FS::FileSystem::write().
const uint8_t SWC::Common::Files::Schema::HEADER_OFFSET_CHKSUM = 9 |
const uint8_t SWC::Common::Files::Schema::HEADER_SIZE = 13 |
|
static |
Definition at line 26 of file Schema.h.
Referenced by filepath().
const uint8_t SWC::Common::Files::Schema::VERSION = 1 |
Definition at line 25 of file Schema.h.
Referenced by SWC::Ranger::RangeData::write(), and write().