hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Purtell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-10597) IOEngine#read() should return the number of bytes transferred
Date Mon, 24 Feb 2014 17:58:19 GMT

    [ https://issues.apache.org/jira/browse/HBASE-10597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13910580#comment-13910580
] 

Andrew Purtell commented on HBASE-10597:
----------------------------------------

Checking return values is good.

Why only a log message here? Is this an error? How should it be handled? 

{code}
Index: hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java
===================================================================
--- hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java	(revision
1571351)
+++ hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/BucketCache.java	(working
copy)
@@ -367,7 +367,10 @@
         if (bucketEntry.equals(backingMap.get(key))) {
           int len = bucketEntry.getLength();
           ByteBuffer bb = ByteBuffer.allocate(len);
-          ioEngine.read(bb, bucketEntry.offset());
+          int lenRead = ioEngine.read(bb, bucketEntry.offset());
+          if (lenRead != len) {
+            LOG.warn("Only " + lenRead + " bytes read, " + len + " expected");
+          }
           Cacheable cachedBlock = bucketEntry.deserializerReference(
               deserialiserMap).deserialize(bb, true);
           long timeTaken = System.nanoTime() - start;
{code}


> IOEngine#read() should return the number of bytes transferred
> -------------------------------------------------------------
>
>                 Key: HBASE-10597
>                 URL: https://issues.apache.org/jira/browse/HBASE-10597
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>         Attachments: 10597-v1.txt, 10597-v2.txt
>
>
> IOEngine#read() is called by BucketCache#getBlock().
> IOEngine#read() should return the number of bytes transferred so that BucketCache#getBlock()
can check this return value against the length obtained from bucketEntry.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message