mirror of
https://github.com/XRPLF/rippled.git
synced 2026-01-11 18:25:23 +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:
@@ -29,6 +29,8 @@
|
||||
|
||||
namespace rocksdb {
|
||||
|
||||
extern uint64_t kBlockedBasedTableMagicNumber;
|
||||
|
||||
// The longest the prefix of the cache key used to identify blocks can be.
|
||||
// We are using the fact that we know for Posix files the unique ID is three
|
||||
// varints.
|
||||
@@ -242,7 +244,7 @@ Status BlockBasedTable::Open(const Options& options,
|
||||
return Status::InvalidArgument("file is too short to be an sstable");
|
||||
}
|
||||
|
||||
Footer footer;
|
||||
Footer footer(kBlockedBasedTableMagicNumber);
|
||||
s = footer.DecodeFrom(&footer_input);
|
||||
if (!s.ok()) return s;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user