LLVM: lib/CAS/OnDiskGraphDB.cpp File Reference (original) (raw)
This file implements OnDiskGraphDB, an on-disk CAS nodes database, independent of a particular hashing algorithm. More...
Go to the source code of this file.
| Macros | |
|---|---|
| #define | DEBUG_TYPE "on-disk-cas" |
| Variables | |
|---|---|
| static constexpr StringLiteral | IndexTableName = "llvm.cas.index" |
| static constexpr StringLiteral | DataPoolTableName = "llvm.cas.data" |
| static constexpr StringLiteral | IndexFilePrefix = "index." |
| static constexpr StringLiteral | DataPoolFilePrefix = "data." |
| static constexpr StringLiteral | FilePrefixObject = "obj." |
| static constexpr StringLiteral | FilePrefixLeaf = "leaf." |
| static constexpr StringLiteral | FilePrefixLeaf0 = "leaf+0." |
This file implements OnDiskGraphDB, an on-disk CAS nodes database, independent of a particular hashing algorithm.
It only needs to be configured for the hash size and controls the schema of the storage.
OnDiskGraphDB defines:
- How the data is stored inside database, either as a standalone file, or allocated inside a datapool.
- How references to other objects inside the same database is stored. They are stored as internal references, instead of full hash value to save space.
- How to chain databases together and import objects from upstream databases.
Here's a top-level description of the current layout:
- db/index.: a file for the "index" table, named by IndexTableName and managed by TrieRawHashMap. The contents are 8B that are accessed atomically, describing the object kind and where/how it's stored (including an optional file offset). See TrieRecord for more details.
- db/data.: a file for the "data" table, named by DataPoolTableName and managed by DataStore. New objects within TrieRecord::MaxEmbeddedSize are inserted here as TrieRecord::StorageKind::DataPool.
- db/obj..: a file storing an object outside the main "data" table, named by its offset into the "index" table, with the format of TrieRecord::StorageKind::Standalone.
- db/leaf..: a file storing a leaf node outside the main "data" table, named by its offset into the "index" table, with the format of TrieRecord::StorageKind::StandaloneLeaf.
- db/leaf+0..: a file storing a null-terminated leaf object outside the main "data" table, named by its offset into the "index" table, with the format of TrieRecord::StorageKind::StandaloneLeaf0.
Definition in file OnDiskGraphDB.cpp.
◆ DEBUG_TYPE
#define DEBUG_TYPE "on-disk-cas"
◆ createCorruptObjectError()
◆ createTempFile()
◆ getContentFromHandle()
◆ getPageSize()
| size_t getPageSize ( ) | static |
|---|