Allow Blob::flush
This commit is contained in:
parent
628f4edec0
commit
e3f7b47440
@ -68,6 +68,10 @@ void BlobOnBlocks::write(const void *source, uint64_t offset, uint64_t size) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BlobOnBlocks::flush() {
|
||||||
|
_datatree->flush();
|
||||||
|
}
|
||||||
|
|
||||||
void BlobOnBlocks::resizeIfSmallerThan(uint64_t neededSize) {
|
void BlobOnBlocks::resizeIfSmallerThan(uint64_t neededSize) {
|
||||||
//TODO This is inefficient, because size() and resizeNumBytes() both traverse the tree. Better: _datatree->ensureMinSize(x)
|
//TODO This is inefficient, because size() and resizeNumBytes() both traverse the tree. Better: _datatree->ensureMinSize(x)
|
||||||
if (neededSize > size()) {
|
if (neededSize > size()) {
|
||||||
|
@ -29,6 +29,8 @@ public:
|
|||||||
uint64_t tryRead(void *target, uint64_t offset, uint64_t size) const override;
|
uint64_t tryRead(void *target, uint64_t offset, uint64_t size) const override;
|
||||||
void write(const void *source, uint64_t offset, uint64_t size) override;
|
void write(const void *source, uint64_t offset, uint64_t size) override;
|
||||||
|
|
||||||
|
void flush() override;
|
||||||
|
|
||||||
std::unique_ptr<cachingdatatreestore::CachedDataTreeRef> releaseTree();
|
std::unique_ptr<cachingdatatreestore::CachedDataTreeRef> releaseTree();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -36,6 +36,10 @@ public:
|
|||||||
uint64_t numStoredBytes() const {
|
uint64_t numStoredBytes() const {
|
||||||
return _baseTree->numStoredBytes();
|
return _baseTree->numStoredBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void flush() {
|
||||||
|
return _baseTree->flush();
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
datatreestore::DataTree *_baseTree;
|
datatreestore::DataTree *_baseTree;
|
||||||
};
|
};
|
||||||
|
@ -22,6 +22,8 @@ public:
|
|||||||
virtual uint64_t tryRead(void *target, uint64_t offset, uint64_t size) const = 0;
|
virtual uint64_t tryRead(void *target, uint64_t offset, uint64_t size) const = 0;
|
||||||
virtual void write(const void *source, uint64_t offset, uint64_t size) = 0;
|
virtual void write(const void *source, uint64_t offset, uint64_t size) = 0;
|
||||||
|
|
||||||
|
virtual void flush() = 0;
|
||||||
|
|
||||||
//TODO Test tryRead
|
//TODO Test tryRead
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user