szetszwo commented on code in PR #11245:
URL: https://github.com/apache/ozone/pull/11245#discussion_r4053734967
##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/OzoneFSInputStream.java:
##########
@@ -37,7 +37,9 @@
* The input stream for Ozone file system.
*
* TODO: Make inputStream generic for both rest and rpc clients
- * This class is not thread safe.
+ * Sequential reads are not thread safe. Positioned reads delegate to the
+ * underlying {@link ExtendedInputStream} when it supports them; otherwise they
+ * fall back to a synchronized seek-read-restore sequence.
*/
Review Comment:
Let's remove the TODO and see the suggestions below:
```java
/**
* The input stream for Ozone file system.
* <p>
* Sequential reads are NOT thread safe.
* <p>
* Positioned reads are thread safe.
* When the underlying stream is an {@link ExtendedInputStream} and
* when it supports {@link ExtendedInputStream#readFully(long, ByteBuffer)},
* they delegate to it.
* Otherwise, they fall back to the default synchronized seek-read-restore
implementation.
* <p>
* Applications must use either sequential reads or position reads at any
given time,
* but not concurrent sequential/position reads
*/
```
--
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]