taklwu commented on PR #11102:
URL: https://github.com/apache/ozone/pull/11102#issuecomment-5501176944
> is it possible to keep seek and read non-thread safe and optimized for
non-concurrent usage; and guarantee thread safety for positional read APIs for
concurrent usage?
I thought we're already doing that in this PR , e.g. for the positioned read
APIs aka `PositionedReadable` and `ByteBufferPositionedReadable`
**org.apache.hadoop.fs.PositionedReadable (byte-array flavour)**
- int read(long position, byte[] buffer, int offset, int length)
- void readFully(long position, byte[] buffer, int offset, int length)
- void readFully(long position, byte[] buffer)
**org.apache.hadoop.fs.ByteBufferPositionedReadable (ByteBuffer flavour)**
- int read(long position, ByteBuffer buf)
- void readFully(long position, ByteBuffer buf)
we didn't touch the seek (e.g. `MultipartInputStream#seek` ) and but mostly
make the read functions underlying implementation from non-thread-safe to
thread-safe (without adding any `synchronized` to the header, and no
performance regression) . if we only
- `public boolean readFully(long position, ByteBuffer buffer)` that uses
BlockInputStream#readPositioned as stateless positional read (and that's the
APIs), here I will need next JIRA to align with `ByteBufferPositionedReadable`
API but the implementation is more or less the same as what I have here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]