Kimahriman / hdfs-native

Apache License 2.0
33 stars 12 forks source link

Stream reading support #34

Closed Kimahriman closed 1 year ago

Kimahriman commented 1 year ago

Resolves #33

Exposes a new FileReader method read_range_stream that returns a Stream<Result<Bytes>>. This lets you load large chunks (or all) of a file in chunks without having to load the whole thing into memory at once.

Existing read functions were updated to just work of this new method as a base, and are simply helper methods to get a full single buffer of data.

The object store get and copy methods were updated to use this new streaming method.