2015-02-17 00:40:34 +01:00
|
|
|
#include "datanodestore/DataLeafNode.h"
|
|
|
|
#include "datanodestore/DataNodeStore.h"
|
2015-02-25 22:48:39 +01:00
|
|
|
#include "datatreestore/DataTreeStore.h"
|
|
|
|
#include "datatreestore/DataTree.h"
|
2014-12-09 17:56:48 +01:00
|
|
|
#include "BlobStoreOnBlocks.h"
|
|
|
|
|
|
|
|
#include "BlobOnBlocks.h"
|
|
|
|
|
|
|
|
using std::unique_ptr;
|
|
|
|
using std::make_unique;
|
|
|
|
|
|
|
|
using blockstore::BlockStore;
|
2014-12-13 19:17:08 +01:00
|
|
|
using blockstore::Key;
|
2014-12-09 17:45:33 +01:00
|
|
|
|
|
|
|
namespace blobstore {
|
|
|
|
namespace onblocks {
|
|
|
|
|
2014-12-13 19:17:08 +01:00
|
|
|
using datanodestore::DataNodeStore;
|
2015-02-25 22:48:39 +01:00
|
|
|
using datatreestore::DataTreeStore;
|
2014-12-13 19:17:08 +01:00
|
|
|
|
2015-02-25 22:30:48 +01:00
|
|
|
constexpr size_t BlobStoreOnBlocks::BLOCKSIZE_BYTES;
|
|
|
|
|
2014-12-09 17:56:48 +01:00
|
|
|
BlobStoreOnBlocks::BlobStoreOnBlocks(unique_ptr<BlockStore> blockStore)
|
2015-02-25 22:48:39 +01:00
|
|
|
: _dataTreeStore(make_unique<DataTreeStore>(make_unique<DataNodeStore>(std::move(blockStore), BLOCKSIZE_BYTES))) {
|
2014-12-09 17:45:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
BlobStoreOnBlocks::~BlobStoreOnBlocks() {
|
|
|
|
}
|
|
|
|
|
2014-12-13 19:17:08 +01:00
|
|
|
unique_ptr<Blob> BlobStoreOnBlocks::create() {
|
2015-02-25 22:48:39 +01:00
|
|
|
return make_unique<BlobOnBlocks>(_dataTreeStore->createNewTree());
|
2014-12-09 17:56:48 +01:00
|
|
|
}
|
|
|
|
|
2014-12-09 20:36:32 +01:00
|
|
|
unique_ptr<Blob> BlobStoreOnBlocks::load(const Key &key) {
|
2015-02-25 22:48:39 +01:00
|
|
|
return make_unique<BlobOnBlocks>(_dataTreeStore->load(key));
|
2014-12-09 17:56:48 +01:00
|
|
|
}
|
|
|
|
|
2014-12-09 17:45:33 +01:00
|
|
|
}
|
|
|
|
}
|