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

stack commented on HBASE-15238:
-------------------------------

[~ndimiduk] You just need this:

{code}
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
index a873280..146d733 100644
@@ -248,11 +248,15 @@ public class HFileReaderImpl implements HFile.Reader, 
Configurable {
248         if (cacheConf.shouldPrefetchOnOpen()) {     248         if 
(cacheConf.shouldPrefetchOnOpen()) {
249           PrefetchExecutor.request(path, new Runnable() {   249           
PrefetchExecutor.request(path, new Runnable() {
250             public void run() {     250             public void run() {
251               long offset = 0;
252               long end = 0;
251               try { 253               try {
252                 long offset = 0;            
253                 long end = fileSize - getTrailer().getTrailerSize();        
        
254                 end = getTrailer().getLoadOnOpenDataOffset();
254                 HFileBlock prevBlock = null;        255                 
HFileBlock prevBlock = null;
255                 while (offset < end) {              
256                 if (LOG.isTraceEnabled()) {
257                   LOG.trace("File=" + path.toString() + ", offset=" + 
offset + ", end=" + end);
258                 }
259                 while (offset < end) {
256                   if (Thread.interrupted()) {       260                   
if (Thread.interrupted()) {
257                     break;  261                     break;
258                   } 262                   }
@@ -273,11 +277,11 @@ public class HFileReaderImpl implements HFile.Reader, 
Configurable {
{code}

The rest is just debug and doc cleanup... changes in the checksumutil were so I 
could follow progress as we moved through the file...

> HFileReaderV2 prefetch overreaches; runs off the end of the data
> ----------------------------------------------------------------
>
>                 Key: HBASE-15238
>                 URL: https://issues.apache.org/jira/browse/HBASE-15238
>             Project: HBase
>          Issue Type: Sub-task
>            Reporter: stack
>            Assignee: stack
>             Fix For: 2.0.0, 1.3.0, 1.2.1, 0.98.18
>
>         Attachments: 15238.patch, 15238v2.patch, 15238v3.patch, 
> 15238v3.patch, HBASE-15238-0.98.patch
>
>
> Small bug found while investigating another issue related to prefetch



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to