Giter VIP home page Giter VIP logo

Comments (6)

ksperis avatar ksperis commented on September 3, 2024

Yes it's true, if the size is not specified, the async is only partial because of use of rados_stat() is synchronous. However, it permit to read a full object (Anyway asynchronously) without knowing its size. Another possibility would be to make an asynchronous call to rados_stat().
Meanwhile, it would be wise to make this clear in the documentation or examples.

from node-rados.

siboulet avatar siboulet commented on September 3, 2024

I looked at doing an asynchronous stat call, but that is not provided by librados so we would need to have our own NanAsyncWorker to do this (which requires a bit more work).

I think if someone wanted to do a full async read in a single call they should manually do a (blocking) ioctx.stat call first to get the length they want to read.

But another problem in the way full read are currently implemented (sync or async) is that it assumes the size of the object doesn't change between the stat call and the read call. I think it would be better to read until EOF is reached, instead of using a stat.

from node-rados.

ksperis avatar ksperis commented on September 3, 2024

Yes I understand what you mean. But I'm not sure that there is the notion of EOF in librados for a complete reading.
Otherwise, we can also specify a default size for reading, per example python has default length set to 4096 for sync read : http://ceph.com/docs/master/rados/api/python/#rados.Ioctx.read
That would be the simple way.

from node-rados.

siboulet avatar siboulet commented on September 3, 2024

I think you ask to read say 4096 and know its EOF when librados returns less than 4096.

from node-rados.

ksperis avatar ksperis commented on September 3, 2024

I will do tests like this.

from node-rados.

ksperis avatar ksperis commented on September 3, 2024

Default read size is now 8192.

from node-rados.

Related Issues (12)

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.