Leveldb-menifest file format

Source: Internet
Author: User

The manifest file is a meta-information file for level DB, which mainly includes the following information:

void Versionedit::encodeto (std::string* DST) const {if (HAS_COMPARATOR_) {//Record comparator PutVarint32 (DST, Kcompara    TOR);  Putlengthprefixedslice (DST, comparator_);    } if (Has_log_number_) {//record log Numer PutVarint32 (DST, klognumber);  PutVarint64 (DST, log_number_);    } if (Has_prev_log_number_) {//Record prev log number, now obsolete, typically 0 PutVarint32 (DST, kprevlognumber);  PutVarint64 (DST, prev_log_number_);    } if (Has_next_file_number_) {//records the next file ordinal PutVarint32 (DST, knextfilenumber);  PutVarint64 (DST, next_file_number_);    } if (Has_last_sequence_) {//records the largest sequence num PutVarint32 (DST, klastsequence);  PutVarint64 (DST, Last_sequence_); }//Record the starting key for the next compaction of each level (size_t i = 0; i < compact_pointers_.size (); i++) {PutVarint32 (DST, Kcomp    Actpointer);  PutVarint32 (DST, Compact_pointers_[i].first); Level Putlengthprefixedslice (DST, Compact_pointers_[i].second.  Encode ()); }//record each level need to delete the file for (deletedfileset::const_iterator iter = Deleted_files_.begin ();       Iter! = Deleted_files_.end ();    ++iter) {PutVarint32 (DST, kdeletedfile);   PutVarint32 (DST, Iter->first);  Level PutVarint64 (DST, Iter->second);  File Number}//record each level requires a valid SST and its smallest and largest key for (size_t i = 0; i < new_files_.size (); i++) {const    filemetadata& f = new_files_[i].second;    PutVarint32 (DST, knewfile);  PutVarint32 (DST, New_files_[i].first);    Level PutVarint64 (DST, f.number);    PutVarint64 (DST, f.file_size);    Putlengthprefixedslice (DST, F.smallest.encode ());  Putlengthprefixedslice (DST, F.largest.encode ()); }}

  

Leveldb-menifest file format

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.