From 2b8824853be05f2aea9f9bcc1a8a2dba52871b65 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Wed, 28 Nov 2012 01:38:31 +0000 Subject: [PATCH] HDFS-4214. OfflineEditsViewer should print out the offset at which it encountered an error. Contributed by Colin Patrick McCabe. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1414500 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../tools/offlineEditsViewer/OfflineEditsBinaryLoader.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 850925889d..4dbdd649f3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -484,6 +484,9 @@ Release 2.0.3-alpha - Unreleased HDFS-4038. Override toString() for BookKeeperEditLogInputStream. (Vinay via umamahesh) + HDFS-4214. OfflineEditsViewer should print out the offset at which it + encountered an error. (Colin Patrick McCabe via atm) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsBinaryLoader.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsBinaryLoader.java index 9d75bab38e..3f96992108 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsBinaryLoader.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/offlineEditsViewer/OfflineEditsBinaryLoader.java @@ -79,6 +79,7 @@ class OfflineEditsBinaryLoader implements OfflineEditsLoader { } catch (IOException e) { if (!recoveryMode) { // Tell the visitor to clean up, then re-throw the exception + LOG.error("Got IOException at position " + inputStream.getPosition()); visitor.close(e); throw e; } @@ -87,6 +88,7 @@ class OfflineEditsBinaryLoader implements OfflineEditsLoader { } catch (RuntimeException e) { if (!recoveryMode) { // Tell the visitor to clean up, then re-throw the exception + LOG.error("Got RuntimeException at position " + inputStream.getPosition()); visitor.close(e); throw e; }