Comments (8)
Perhaps we should support InputStream
and OutputStream
related APIs in BlockingOperator
.
The async version should be something like ReactiveStream but it can be over complicated here for now.
from opendal.
Are there any solutions or ideas how we can deal with big files?
We can add a stream or reader in Java, but we're unsure which abstraction to use on the Java side. Can you describe which interface you expect in java? Does java has Reader
or Stream
concepts like in rust or python?
Also cc owner of java binding: @tisonkun @G-XD for ideas.
from opendal.
@Xuanwo What does the Rust's design for streaming read/write look like?
Java has both Reader or Stream, but their API may not be mapped naturally. That is, we still need some work to bridge the API.
from opendal.
What does the Rust's design for streaming read/write look like?
OpenDAL provides three styles of API as listed:
- opendal::Reader:
fn read(&self, offset, limit) -> Result<Buffer>
- opendal::FuturesAsyncReader:
fn read(&mut self, buf: &mut [u8]) -> Result<size>
- opendal::FuturesBytesStream:
fn next(&mut self) -> Option<Result<Bytes>>
from opendal.
Seems we can implement something like public class OperatorInputStream extends InputStream
based on FuturesBytesStream
.
What about the write APIs?
from opendal.
What about the write APIs?
write supoorts fn write(&mut self, bs) -> Result<size>
from opendal.
@Xuanwo I guess what I'm looking for is FuturesBytesSink
.
But InputStream
and OutputStream
are all blocking APIs. Although they are streaming read/write bytes instead of loading everything into the memory. Let me consider a little bit about what the API should be like.
from opendal.
#4626 Here is the read part (InputStream) without any optimizations. But it should implement the streaming read feature.
@G-XD you may implement the write part following the similar structure.
@maiorBoltach Welcome to try out this version and see if it meets your requirements.
from opendal.
Related Issues (20)
- PrometheusLayer: Add a new metrics called `bytes_duration_seconds` HOT 4
- ofs: test `test_file_append` failed HOT 3
- PrometheusClientLayer: request_duration_seconds used in wrong HOT 3
- bug: unreachable!("BlockWriter must not go into State::Close during poll_abort") in 0.45.1 HOT 5
- bug: Python client can't remove dir. HOT 3
- Add test cases for remove_all with a prefix HOT 5
- docs: Add Tigris into S3 Compatible Services list
- gcs: auth options are not well documented
- gcs: not all `GcsBuilder` configureables are supported in `GcsBuilder.from_map` HOT 1
- core: Bring Streaming Read Back HOT 2
- ofs: Migrate TextContext to `libtest-mimic`
- service: add Kubernetes service support HOT 5
- cleanup: Remove MadsimLayer
- docs: Community should add a section for Contributor HOT 1
- docs: Community should add Governance page
- object_store example is outdated
- Add azure workload identity support
- docs: Explain the meaning of OneDrive access token HOT 2
- ci: Redis TLS test failed for invalid peer certificate: Expired HOT 1
- Rust Crates like dav-server-opendalfs release failed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opendal.