mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Parameterize table magic number
Summary: As we are having different types of tables and they all might share the same structure in block-based table: [metaindex block] [index block] [Footer] To be able to identify differnt types of tables, we need to parameterize the "magic number" in the `Footer`. Test Plan: make check
This commit is contained in:
@@ -77,6 +77,14 @@ void LogPropertiesCollectionError(
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
// kBlockedBasedTableMagicNumber was picked by running
|
||||
// echo http://code.google.com/p/leveldb/ | sha1sum
|
||||
// and taking the leading 64 bits.
|
||||
// Please note that kBlockedBasedTableMagicNumber may also be accessed by
|
||||
// other .cc files so it have to be explicitly declared with "extern".
|
||||
extern const uint64_t kBlockedBasedTableMagicNumber
|
||||
= 0xdb4775248b80fb57ull;
|
||||
|
||||
struct BlockBasedTableBuilder::Rep {
|
||||
Options options;
|
||||
WritableFile* file;
|
||||
@@ -503,7 +511,7 @@ Status BlockBasedTableBuilder::Finish() {
|
||||
|
||||
// Write footer
|
||||
if (ok()) {
|
||||
Footer footer;
|
||||
Footer footer(kBlockedBasedTableMagicNumber);
|
||||
footer.set_metaindex_handle(metaindex_block_handle);
|
||||
footer.set_index_handle(index_block_handle);
|
||||
std::string footer_encoding;
|
||||
|
||||
Reference in New Issue
Block a user