This commit is contained in:
Sebastian Messmer 2015-03-04 02:55:26 +01:00
parent 3b06dec1f2
commit f89db143d9
2 changed files with 2 additions and 2 deletions

View File

@ -177,6 +177,7 @@ void DataTree::resizeNumBytes(uint64_t newNumBytes) {
}
uint32_t newLastLeafSize = newNumBytes - (newNumLeaves-1)*_nodeStore->layout().maxBytesPerLeaf();
LastLeaf(_rootNode.get())->resize(newLastLeafSize);
assert(newNumBytes == numStoredBytes());
}

View File

@ -26,6 +26,7 @@ public:
DataTree(datanodestore::DataNodeStore *nodeStore, std::unique_ptr<datanodestore::DataNode> rootNode);
virtual ~DataTree();
//TODO Might be that we don't need addDataLeaf()/removeDataLeaf() to be public anymore
std::unique_ptr<datanodestore::DataLeafNode> addDataLeaf();
void removeLastDataLeaf();
@ -39,8 +40,6 @@ public:
uint64_t numStoredBytes() const;
void resizeNumBytes(uint64_t newNumBytes);
//TODO Test resizeNumBytes()
private:
datanodestore::DataNodeStore *_nodeStore;
std::unique_ptr<datanodestore::DataNode> _rootNode;