eBay/GZinga

read calls are slow for SeekableInputStream impl backed by remote storage.

Opened this issue · 3 comments

Calls to read() are slow (network letancy), when the implementation of SeekableInputStream is backed by a remote storage.
IMHO ,Ideally we should be making more of block calls (read(buf,off,len)) whenever possible.

Method void storeMetadata() : reconstructs the offset map from header information in the stream.
It is reading already available bytes using read() calls , which is extremely slow for our case (remote storage). These bytes are already available while reading the initial readSize (= 32 * 1024) length of data.
We can resort to read() , if the already available bytes doesn't have the trailing 0 byte marker.

Please advise.

@r4ruchir Did you get a chance to look into my request ?
If you want , I can provide a PR for the fix. We are using Gzinga against a remote streaming source for data and this fix is real helpful.

Sure. submitted a PR. thanks,Rahul