1
0
mirror of https://github.com/Zygo/bees.git synced 2025-06-17 01:56:16 +02:00

hash: create beeshash.dat if it does not exist

BeesHashTable can now create a beeshash.dat if the file does not already
exist.  Currently the default size is one hash table extent (16MB) and
there's no way to change that (yet), so users should still create their
own hash tables for now.

The opening of the hash table is deferred (slightly) in preparation for
hash table resizing.

No doc as the feature is currently unfinished.
This commit is contained in:
Zygo Blaxell
2016-12-01 23:22:01 -05:00
parent d58de9b76d
commit 6fa8de660b
2 changed files with 45 additions and 13 deletions

View File

@ -411,7 +411,7 @@ public:
uint8_t p_byte[BLOCK_SIZE_HASHTAB_EXTENT];
} __attribute__((packed));
BeesHashTable(shared_ptr<BeesContext> ctx, string filename);
BeesHashTable(shared_ptr<BeesContext> ctx, string filename, off_t size = BLOCK_SIZE_HASHTAB_EXTENT);
~BeesHashTable();
vector<Cell> find_cell(HashType hash);
@ -458,6 +458,7 @@ private:
DefaultBool m_shared;
void open_file();
void writeback_loop();
void prefetch_loop();
void try_mmap_flags(int flags);