sodonnel commented on PR #3764:
URL: https://github.com/apache/ozone/pull/3764#issuecomment-1254265893

   I grepped the code, and there are a couple of EC input classes that have the 
same check logic:
   
   ```
   grep -R "pos < 0 || pos >= " * 
   
hadoop-hdds/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockInputStream.java:
    if (pos < 0 || pos >= getLength()) {
   
hadoop-hdds/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedInputStream.java:
    if (pos < 0 || pos >= getLength()) {
   
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/ChunkInputStream.java:
    if (pos < 0 || pos >= length) {
   
hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockInputStream.java:
    if (pos < 0 || pos >= length) {
   
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/node_modules/.pnpm/[email protected]/node_modules/es5-ext/string/#/code-point-at/shim.js:
  if (pos < 0 || pos >= length) return undefined;
   
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/node_modules/es5-ext/string/#/code-point-at/shim.js:
     if (pos < 0 || pos >= length) return undefined;
   sodonnell@sodonnell-MBP16 ozone2 % vi 
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/node_modules/es5-ext/string/#/code-point-at/shim.js
   ```
   
   Interestingly, some imported JS modules also the same logic.
   
   I am trying to think if its valid or not to throw EOF when you seek to 
`length`. If you have a file of length 1, and are at position zero, if you read 
1 byte, you are at position 1. If you read again you will get EOF. So based on 
that logic, seeking to position 1 should probably not throw EOF.
   
   It would be good to fix the EC classes as part of this PR too.


-- 
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]

Reply via email to