2014-12-09 17:45:33 +01:00
|
|
|
#pragma once
|
|
|
|
#ifndef BLOBSTORE_IMPLEMENTATIONS_BLOCKED_BLOBSTOREONBLOCKS_H_
|
|
|
|
#define BLOBSTORE_IMPLEMENTATIONS_BLOCKED_BLOBSTOREONBLOCKS_H_
|
|
|
|
|
2015-02-17 00:40:34 +01:00
|
|
|
#include "../../interface/BlobStore.h"
|
|
|
|
#include "messmer/blockstore/interface/BlockStore.h"
|
2014-12-09 17:56:48 +01:00
|
|
|
|
2014-12-09 17:45:33 +01:00
|
|
|
namespace blobstore {
|
|
|
|
namespace onblocks {
|
2015-04-16 15:01:49 +02:00
|
|
|
namespace parallelaccessdatatreestore {
|
|
|
|
class ParallelAccessDataTreeStore;
|
2014-12-13 19:17:08 +01:00
|
|
|
}
|
2014-12-09 17:45:33 +01:00
|
|
|
|
2015-05-08 01:57:44 +02:00
|
|
|
//TODO Make blobstore able to cope with incomplete data (some blocks missing, because they're not synchronized yet) and write test cases for that
|
|
|
|
|
2014-12-09 17:56:48 +01:00
|
|
|
class BlobStoreOnBlocks: public BlobStore {
|
2014-12-09 17:45:33 +01:00
|
|
|
public:
|
2015-06-26 15:59:18 +02:00
|
|
|
BlobStoreOnBlocks(cpputils::unique_ref<blockstore::BlockStore> blockStore, uint32_t blocksizeBytes);
|
2014-12-09 17:45:33 +01:00
|
|
|
virtual ~BlobStoreOnBlocks();
|
2014-12-09 17:56:48 +01:00
|
|
|
|
2015-06-18 12:45:37 +02:00
|
|
|
cpputils::unique_ref<Blob> create() override;
|
|
|
|
boost::optional<cpputils::unique_ref<Blob>> load(const blockstore::Key &key) override;
|
2014-12-09 17:56:48 +01:00
|
|
|
|
2015-06-18 12:45:37 +02:00
|
|
|
void remove(cpputils::unique_ref<Blob> blob) override;
|
2015-03-06 02:21:20 +01:00
|
|
|
|
2014-12-09 17:56:48 +01:00
|
|
|
private:
|
2015-06-26 15:59:18 +02:00
|
|
|
cpputils::unique_ref<parallelaccessdatatreestore::ParallelAccessDataTreeStore> _dataTreeStore;
|
2014-12-09 17:45:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|