Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions include/txn/base_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,7 @@ template <typename K> class DiskLockNode {
*/
bool read_disk(const K &k) {
// Key not being used right now, check if stored in disk
string fname = ebs_root + std::to_string(thread_id) + "/" + k;
// TODO: create dir if DNE
string fname = ebs_root + std::to_string(thread_id) + "-" + k;
std::fstream f(fname, std::ios::in | std::ios::binary);
if (f) {
// Key exists on disk, read it into the map
Expand Down Expand Up @@ -300,7 +299,7 @@ template <typename K> class DiskLockNode {
// Write it back to disk

// TODO: create dir if DNE
string fname = ebs_root + std::to_string(thread_id) + "/" + k;
string fname = ebs_root + std::to_string(thread_id) + "-" + k;
std::fstream f(fname, std::ios::out | std::ios::binary);
f << db.at(k).get_is_primary() << "\n" << db.at(k).reveal() << "\n";
f.close();
Expand Down Expand Up @@ -431,7 +430,7 @@ template <typename K> class DiskLockNode {

void remove(const K &k) {
db.erase(k);
std::remove((ebs_root + "/" + std::to_string(thread_id) + "/" + k).c_str());
std::remove((ebs_root + std::to_string(thread_id) + "-" + k).c_str());
}
};

Expand Down