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
StorageBackend::get_into is the main way to read a file. Currently, it simply reads the entire file from the storage backend, and copies it to the Writer. But that's inefficient for sparse files. It would be better if it understood sparse files, and could synthesize zeros as needed. This would require:
Adding an lseek method to the trait
Implementing the lseek method for the FS backend
Within get_into, iterating through the file using lseek with SEEK_HOLE and SEEK_DATA
Copying data from the storage backend for every data region
Synthesizing zeros for every hole region
Alternatively, this change could be made entirely within the FS backend by returning a custom object that implements tokio::io::AsyncRead but is hole-aware, and synthesizes zeros as needed.
The text was updated successfully, but these errors were encountered:
StorageBackend::get_into
is the main way to read a file. Currently, it simply reads the entire file from the storage backend, and copies it to theWriter
. But that's inefficient for sparse files. It would be better if it understood sparse files, and could synthesize zeros as needed. This would require:lseek
method to the traitlseek
method for the FS backendget_into
, iterating through the file using lseek with SEEK_HOLE and SEEK_DATAAlternatively, this change could be made entirely within the FS backend by returning a custom object that implements
tokio::io::AsyncRead
but is hole-aware, and synthesizes zeros as needed.The text was updated successfully, but these errors were encountered: