pub type ExtentKey = ExtentKeyV32;
Expand description
ExtentKey is a child of ObjectKey for Object attributes that have attached extents (at time of writing this was only the used for file contents).
Aliased Type§
struct ExtentKey {
pub range: Range<u64>,
}
Fields§
§range: Range<u64>
Implementations§
Source§impl ExtentKey
impl ExtentKey
Sourcepub fn overlap(&self, other: &ExtentKey) -> Option<Range<u64>>
pub fn overlap(&self, other: &ExtentKey) -> Option<Range<u64>>
Returns the range of bytes common between this extent and |other|.
Sourcepub fn search_key(&self) -> Self
pub fn search_key(&self) -> Self
Returns the search key for this extent; that is, a key which is <= this key under Ord and OrdLowerBound. This would be used when searching for an extent with |find| (when we want to find any overlapping extent, which could include extents that start earlier). For example, if the tree has extents 50..150 and 150..200 and we wish to read 100..200, we’d search for 0..101 which would set the iterator to 50..150.
Sourcepub fn search_key_from_offset(offset: u64) -> Self
pub fn search_key_from_offset(offset: u64) -> Self
Similar to previous, but from an offset. Returns a search key that will find the first extent that touches offset..
Sourcepub fn key_for_merge_into(&self) -> Self
pub fn key_for_merge_into(&self) -> Self
Returns the merge key for this extent; that is, a key which is <= this extent and any other possibly overlapping extent, under Ord. This would be used to set the hint for |merge_into|.
For example, if the tree has extents 0..50, 50..150 and 150..200 and we wish to insert 100..150, we’d use a merge hint of 0..100 which would set the iterator to 50..150 (the first element > 100..150 under Ord).
Sourcepub fn fuzzy_hash_partition(&self) -> ExtentKeyPartitionIterator
pub fn fuzzy_hash_partition(&self) -> ExtentKeyPartitionIterator
Returns an iterator over the ExtentKey partitions which overlap this key (see FuzzyHash
).