HBASE-3038 WALReaderFSDataInputStream.getPos() fails if Filesize > MAX_INT; addendum

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1002348 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-09-28 20:38:12 +00:00
parent 1334d5187b
commit 4d25275040
1 changed files with 6 additions and 3 deletions

View File

@ -25,6 +25,7 @@ import java.io.IOException;
import java.lang.Class;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -103,9 +104,11 @@ public class SequenceFileLogReader implements HLog.Reader {
Field fIn = FilterInputStream.class.getDeclaredField("in");
fIn.setAccessible(true);
Object realIn = fIn.get(this.in);
long realLength = ((Long)realIn.getClass().
getMethod("getFileLength", new Class<?> []{}).
invoke(realIn, new Object []{})).longValue();
Method getFileLength = realIn.getClass().
getMethod("getFileLength", new Class<?> []{});
getFileLength.setAccessible(true);
long realLength = ((Long)getFileLength.
invoke(realIn, new Object []{})).longValue();
assert(realLength >= this.length);
adjust = realLength - this.length;
} catch(Exception e) {