object_store
's alignment of get_ranges
; ability to get BytesMut
#6647
Labels
question
Further information is requested
Which part is this question about
Alignment of returned
Bytes
fromobject_store.get_range()
orobject_store.get_ranges
Describe your question
Are there any alignment guarantees for
get_range
, or would that be a feature that could be added?Additional context
I want to use
object_store
as a possible io for a crate I'm working on. Now, ideally, I'd be directly using the providedBytes
from theget_range(s)
function. That needs two things:BytesMut
e.g. Doesobject_store
hold any other references to the byte struct? (to fix endianness on the Bytes directly)this seems to be the relevant code here. Bytes tests for misalignments
I know the upstream issues (tokio-rs/bytes/#437 tokio-rs/bytes/#343) and that zero-copy works for arrow-rs, which makes me think that alignment is at least somewhat worked out?
To me, a solution I'm thinking of is to get a large allocation, check the alignment of that and then hand out aligned chunks of that allocation. Since that would be upstream of the
object_store
crate (it produces theBytes
for the result), I'm asking here if there are any alignment guarantees of theget_range(s)
function. If so, I'm happy and would only need to implement alignment-ness for other types.The text was updated successfully, but these errors were encountered: