[
https://issues.apache.org/jira/browse/HBASE-5878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14614013#comment-14614013
]
Ashish Singhi commented on HBASE-5878:
--------------------------------------
-1's not related to patch.
Build was successful
{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] HBase ............................................. SUCCESS [ 1.480 s]
[INFO] HBase - Checkstyle ................................ SUCCESS [ 0.052 s]
[INFO] HBase - Annotations ............................... SUCCESS [ 0.076 s]
[INFO] HBase - Protocol .................................. SUCCESS [ 0.121 s]
[INFO] HBase - Common .................................... SUCCESS [ 0.219 s]
[INFO] HBase - Procedure ................................. SUCCESS [ 0.072 s]
[INFO] HBase - Client .................................... SUCCESS [ 0.296 s]
[INFO] HBase - Hadoop Compatibility ...................... SUCCESS [ 0.075 s]
[INFO] HBase - Hadoop Two Compatibility .................. SUCCESS [ 0.126 s]
[INFO] HBase - Prefix Tree ............................... SUCCESS [ 0.097 s]
[INFO] HBase - Server .................................... SUCCESS [ 0.964 s]
[INFO] HBase - Testing Util .............................. SUCCESS [ 0.037 s]
[INFO] HBase - Thrift .................................... SUCCESS [ 0.084 s]
[INFO] HBase - Shell ..................................... SUCCESS [ 0.099 s]
[INFO] HBase - Integration Tests ......................... SUCCESS [ 0.097 s]
[INFO] HBase - Examples .................................. SUCCESS [ 0.061 s]
[INFO] HBase - Rest ...................................... SUCCESS [ 0.104 s]
[INFO] HBase - Assembly .................................. SUCCESS [ 0.042 s]
[INFO] HBase - Shaded .................................... SUCCESS [ 0.036 s]
[INFO] HBase - Shaded - Client ........................... SUCCESS [ 0.035 s]
[INFO] HBase - Shaded - Server ........................... SUCCESS [ 0.035 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.747 s
[INFO] Finished at: 2015-07-04T08:04:56+00:00
[INFO] Final Memory: 36M/913M
[INFO] ------------------------------------------------------------------------
{noformat}
> Use getVisibleLength public api from HdfsDataInputStream from Hadoop-2.
> -----------------------------------------------------------------------
>
> Key: HBASE-5878
> URL: https://issues.apache.org/jira/browse/HBASE-5878
> Project: HBase
> Issue Type: Bug
> Components: wal
> Reporter: Uma Maheswara Rao G
> Assignee: Ashish Singhi
> Fix For: 2.0.0, 1.1.2, 1.3.0, 1.2.1, 1.0.3
>
> Attachments: HBASE-5878-v2.patch, HBASE-5878-v3.patch,
> HBASE-5878-v4.patch, HBASE-5878-v5.patch, HBASE-5878.patch
>
>
> SequencFileLogReader:
> Currently Hbase using getFileLength api from DFSInputStream class by
> reflection. DFSInputStream is not exposed as public. So, this may change in
> future. Now HDFS exposed HdfsDataInputStream as public API.
> We can make use of it, when we are not able to find the getFileLength api
> from DFSInputStream as a else condition. So, that we will not have any sudden
> surprise like we are facing today.
> Also, it is just logging one warn message and proceeding if it throws any
> exception while getting the length. I think we can re-throw the exception
> because there is no point in continuing with dataloss.
> {code}
> long adjust = 0;
> try {
> Field fIn = FilterInputStream.class.getDeclaredField("in");
> fIn.setAccessible(true);
> Object realIn = fIn.get(this.in);
> // In hadoop 0.22, DFSInputStream is a standalone class. Before
> this,
> // it was an inner class of DFSClient.
> if (realIn.getClass().getName().endsWith("DFSInputStream")) {
> Method getFileLength = realIn.getClass().
> getDeclaredMethod("getFileLength", new Class<?> []{});
> getFileLength.setAccessible(true);
> long realLength = ((Long)getFileLength.
> invoke(realIn, new Object []{})).longValue();
> assert(realLength >= this.length);
> adjust = realLength - this.length;
> } else {
> LOG.info("Input stream class: " + realIn.getClass().getName() +
> ", not adjusting length");
> }
> } catch(Exception e) {
> SequenceFileLogReader.LOG.warn(
> "Error while trying to get accurate file length. " +
> "Truncation / data loss may occur if RegionServers die.", e);
> }
> return adjust + super.getPos();
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)