write create snap shot
This commit is contained in:
@ -78,5 +78,9 @@ class DiskMap : public DataDriverBase {
|
||||
indexer->Put(key, data_id);
|
||||
return true;
|
||||
}
|
||||
void Flush() {
|
||||
indexer->Flush();
|
||||
data_storage->Flush();
|
||||
}
|
||||
};
|
||||
#endif // DISK_MAP_H
|
@ -13,5 +13,6 @@ class DataDriverBase {
|
||||
DataDriverBase() = default;
|
||||
virtual ~DataDriverBase() = default;
|
||||
virtual sjtu::vector<FileEntry> ListFiles() = 0;
|
||||
virtual void Flush() = 0;
|
||||
};
|
||||
#endif // DRIVER_H
|
@ -47,7 +47,10 @@ class SingleValueStorage {
|
||||
~SingleValueStorage() {
|
||||
if (bpm != nullptr) CloseFile();
|
||||
}
|
||||
|
||||
void Flush() {
|
||||
memcpy(raw_mem, &first_blank_element_pair_id, sizeof(size_t));
|
||||
bpm->FlushAllPages();
|
||||
}
|
||||
void get_info(int &tmp, int n) {
|
||||
if (n > info_len) return;
|
||||
n += 2;
|
||||
|
Reference in New Issue
Block a user