template <typename Op>
class OperationTree
Defined at line 126 of file ../../src/storage/lib/operation/operation_tree.h
An interval tree which collects and coalesces storage operations targeting device offsets.
On insertion, the tree ensures that the latest operation touching a particular destination block
overwrites any prior operations. If possible, contiguous operations with the same source are
merged. If an operation partially overlaps or overwrites with a different source, overlapping
ranges are split and updated, guaranteeing there are no duplicate destination offsets.
Public Methods
void OperationTree<Op> ()
Defined at line 133 of file ../../src/storage/lib/operation/operation_tree.h
void insert (Op operation)
Inserts an operation into the tree.
First, removes all overlapping prior operations which target the same device offset, and then
inserts |operation|. This ensures that the "latest operation touching block B" will be the only
operation targeting that block.
Defined at line 140 of file ../../src/storage/lib/operation/operation_tree.h
uint64_t BlockCount ()
Returns the total number of blocks in all requests.
Defined at line 154 of file ../../src/storage/lib/operation/operation_tree.h
std::vector<Op> TakeOperations ()
Removes the operations from the tree, and returns them to the caller sorted by dev_offset.
Defined at line 165 of file ../../src/storage/lib/operation/operation_tree.h
void clear ()
Defined at line 175 of file ../../src/storage/lib/operation/operation_tree.h
bool empty ()
Defined at line 177 of file ../../src/storage/lib/operation/operation_tree.h
size_t size ()
Defined at line 179 of file ../../src/storage/lib/operation/operation_tree.h
IterType begin ()
Defined at line 181 of file ../../src/storage/lib/operation/operation_tree.h
ConstIterType begin ()
Defined at line 183 of file ../../src/storage/lib/operation/operation_tree.h
IterType end ()
Defined at line 185 of file ../../src/storage/lib/operation/operation_tree.h
ConstIterType end ()
Defined at line 187 of file ../../src/storage/lib/operation/operation_tree.h