 |
SWC-DB
v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
|
Go to the documentation of this file.
7 #ifndef swcdb_common_Files_Schema_h
8 #define swcdb_common_Files_Schema_h
20 namespace Files {
namespace Schema {
36 path.reserve(path.length() + 1 + strlen(
schema_file));
52 size_t sz = schema->encoded_length();
58 uint8_t* checksum_data_ptr = dst_buf.
ptr;
60 uint8_t* checksum_header_ptr = dst_buf.
ptr;
63 const uint8_t* start_data_ptr = dst_buf.
ptr;
64 schema->encode(&dst_buf.
ptr);
94 const uint8_t *ptr = read_buf.
base;
95 size_t remain = read_buf.
size;
113 uint8_t replication,
bool recover=
true) {
131 schema->col_name.append(
"SYS_");
133 schema->col_name.append(
"STATS");
135 schema->col_seq = DB::Types::KeySeq::LEXIC;
136 schema->cell_ttl = 2419200;
139 schema->col_name.append(
"DEFINE_LEXIC");
141 schema->col_seq = DB::Types::KeySeq::LEXIC;
144 schema->col_name.append(
"RGR_DATA");
145 schema->col_type = DB::Types::Column::PLAIN;
146 schema->col_seq = DB::Types::KeySeq::VOLUME;
151 schema->col_name.append(
153 schema->col_name.append(
159 schema->col_name.append(
"noname_");
165 SWC_LOG_OSTREAM <<
"Missing Column(cid=" << cid <<
") Schema set to ");
167 save(err, schema, replication);
175 uint8_t replication) {
176 save(err, schema_save, replication);
184 if(!schema_new->equal(schema_save)) {
195 #endif // swcdb_common_Files_Schema_h
static const char schema_file[]
const uint8_t HEADER_OFFSET_CHKSUM
#define SWC_LOGF(priority, fmt,...)
static const char * get_column_path() noexcept
std::shared_ptr< Schema > Ptr
#define SWC_LOG_OUT(pr, _code_)
void load(int &err, const std::string &filepath, DB::Schema::Ptr &schema)
SWC_CAN_INLINE void encode_i32(uint8_t **bufp, uint32_t val) noexcept
static SWC_CAN_INLINE FS::Interface::Ptr & interface() noexcept
static SWC_CAN_INLINE Ptr make_ptr(const std::string &filepath, uint32_t flags, int32_t fd=-1, uint64_t pos=0)
const char *SWC_CONST_FUNC to_string(Column typ) noexcept
SWC_CAN_INLINE bool checksum_i32_chk(uint32_t checksum, const uint8_t *base, uint32_t len)
const cid_t SYS_CID_DEFINE_LEXIC
SWC_CAN_INLINE void ensure(size_t len)
const uint8_t HEADER_SIZE
constexpr SWC_CAN_INLINE void encode_i8(uint8_t **bufp, uint8_t val) noexcept
constexpr SWC_CAN_INLINE bool is_master(cid_t cid) noexcept
The SWC-DB C++ namespace 'SWC'.
static SWC_CAN_INLINE Ptr make()
void remove(int &err, cid_t cid)
KeySeq SWC_CONST_FUNC get_seq_type(cid_t cid) noexcept
void save(int &err, const DB::Schema::Ptr &schema, uint8_t replication=0)
void save_with_validation(int &err, const DB::Schema::Ptr &schema_save, uint8_t replication)
void write(SWC::DynamicBuffer &dst_buf, const DB::Schema::Ptr &schema)
SWC_CAN_INLINE void checksum_i32(const uint8_t *start, size_t len, uint8_t **ptr) noexcept
std::string filepath(cid_t cid)
SWC_CAN_INLINE std::string to_string(const BitFieldInt< T, SZ > &v)
constexpr SWC_CAN_INLINE uint8_t decode_i8(const uint8_t **bufp, size_t *remainp)
#define SWC_LOG_CURRENT_EXCEPTION(_s_)
SWC_CAN_INLINE uint32_t decode_i32(const uint8_t **bufp, size_t *remainp)
const cid_t SYS_CID_STATS