You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/05/12 13:02:35 UTC

[GitHub] [hbase] Apache9 commented on a change in pull request #3251: HBASE-25876 Add retry if we fail to read all bytes of the protobuf ma…

Apache9 commented on a change in pull request #3251:
URL: https://github.com/apache/hbase/pull/3251#discussion_r631019650



##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
##########
@@ -964,8 +965,7 @@ public static HRegionInfo parseFrom(final DataInputStream in) throws IOException
     }
 
     //assumption: if Writable serialization, it should be longer than pblen.
-    int read = in.read(pbuf);
-    if (read != pblen) throw new IOException("read=" + read + ", wanted=" + pblen);
+    IOUtils.readFully(in, pbuf, 0, pblen);

Review comment:
       DataInputStream has a readFully method, so I think here we could just use that one?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org