Giter Site home page Giter Site logo

Comments (8)

tisonkun avatar tisonkun commented on June 12, 2024 2

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.

Xuanwo avatar Xuanwo commented on June 12, 2024

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.

tisonkun avatar tisonkun commented on June 12, 2024

@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.

Xuanwo avatar Xuanwo commented on June 12, 2024

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.

tisonkun avatar tisonkun commented on June 12, 2024

Seems we can implement something like public class OperatorInputStream extends InputStream based on FuturesBytesStream.

What about the write APIs?

from opendal.

Xuanwo avatar Xuanwo commented on June 12, 2024

What about the write APIs?

write supoorts fn write(&mut self, bs) -> Result<size>

from opendal.

tisonkun avatar tisonkun commented on June 12, 2024

@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.

tisonkun avatar tisonkun commented on June 12, 2024

#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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.