Comments (6)
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.
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.
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.
I think you ask to read say 4096 and know its EOF when librados returns less than 4096.
from node-rados.
I will do tests like this.
from node-rados.
Default read size is now 8192.
from node-rados.
Related Issues (12)
- node_object_wrap.h:71 error HOT 3
- Manage pool HOT 5
- Add list objects in a pool HOT 4
- Connect to docker/ceph HOT 4
- This package no longer installs because it picks up a newer (incompatible) version of nan.
- expose createReadStream / createWriteStream HOT 2
- Drop node-gyp dependency HOT 1
- Node 7 compatibility? HOT 3
- Fails to connect for limited access user
- Clone in new node versions.
- aio_* functions and callback error parameter HOT 2
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 node-rados.