2014-12-09 17:19:59 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef BLOCKSTORE_IMPLEMENTATIONS_ONDISK_ONDISKBLOCKSTORE_H_
|
|
|
|
#define BLOCKSTORE_IMPLEMENTATIONS_ONDISK_ONDISKBLOCKSTORE_H_
|
|
|
|
|
|
|
|
#include <boost/filesystem.hpp>
|
2015-02-17 00:23:33 +01:00
|
|
|
#include <messmer/blockstore/interface/helpers/BlockStoreWithRandomKeys.h>
|
2014-12-09 17:19:59 +01:00
|
|
|
|
2015-02-17 00:23:33 +01:00
|
|
|
#include "messmer/cpp-utils/macros.h"
|
2014-12-09 17:19:59 +01:00
|
|
|
|
|
|
|
#include <mutex>
|
|
|
|
|
|
|
|
namespace blockstore {
|
|
|
|
namespace ondisk {
|
|
|
|
|
|
|
|
class OnDiskBlockStore: public BlockStoreWithRandomKeys {
|
|
|
|
public:
|
|
|
|
OnDiskBlockStore(const boost::filesystem::path &rootdir);
|
|
|
|
|
2014-12-09 20:36:32 +01:00
|
|
|
std::unique_ptr<Block> create(const Key &key, size_t size) override;
|
|
|
|
std::unique_ptr<Block> load(const Key &key) override;
|
2014-12-09 17:19:59 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
const boost::filesystem::path _rootdir;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(OnDiskBlockStore);
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|