You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been bothering me for a while that RunlistStream always requires a fully resolved runlist to function. Sometimes resolving a full runlist is expensive and slow, and you don't always need the entire runlist (e.g. you're only reading a small portion or randomly seeking through a large file).
RunlistStream (or a new class, LookupStream? TBD) should allow subclasses to define something like a _lookup(self, offset, length) -> Iterator[tuple[int, int]] method that will resolve run lookup on-demand. For example, in dissect.extfs or dissect.btrfs, this could be used to query the extent BTree to lookup the proper extent/run and return the (physical offset, size) tuple for that. Making it a generator will allow for lazy evaluation too, especially useful in continuous reads. However, if a seek happens (outside the cache boundary) then the generator should be reset/another lookup should be done.
It's been bothering me for a while that
RunlistStream
always requires a fully resolved runlist to function. Sometimes resolving a full runlist is expensive and slow, and you don't always need the entire runlist (e.g. you're only reading a small portion or randomly seeking through a large file).RunlistStream
(or a new class,LookupStream
? TBD) should allow subclasses to define something like a_lookup(self, offset, length) -> Iterator[tuple[int, int]]
method that will resolve run lookup on-demand. For example, indissect.extfs
ordissect.btrfs
, this could be used to query the extent BTree to lookup the proper extent/run and return the(physical offset, size)
tuple for that. Making it a generator will allow for lazy evaluation too, especially useful in continuous reads. However, if a seek happens (outside the cache boundary) then the generator should be reset/another lookup should be done.For
dissect.btrfs
, this would also resolve fox-it/dissect.btrfs#10.The text was updated successfully, but these errors were encountered: