From 0800aa90dd6ef9cdff2761ab594b2b7a73205a44 Mon Sep 17 00:00:00 2001 From: Uma Maheswara Rao G Date: Wed, 14 Nov 2012 03:10:10 +0000 Subject: [PATCH] HDFS-4038. Override toString() for BookKeeperEditLogInputStream. Contributed by Vinay. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1409071 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../bkjournal/BookKeeperEditLogInputStream.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 7e8475948e2..c9ecac8f8de 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -464,6 +464,9 @@ Release 2.0.3-alpha - Unreleased HDFS-1322. Document umask in DistributedFileSystem#mkdirs javadocs. (Colin Patrick McCabe via eli) + HDFS-4038. Override toString() for BookKeeperEditLogInputStream. + (Vinay via umamahesh) + OPTIMIZATIONS BUG FIXES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperEditLogInputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperEditLogInputStream.java index 15d0c02daf0..35c09eb1127 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperEditLogInputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/contrib/bkjournal/src/main/java/org/apache/hadoop/contrib/bkjournal/BookKeeperEditLogInputStream.java @@ -129,8 +129,9 @@ class BookKeeperEditLogInputStream extends EditLogInputStream { @Override public String getName() { - return String.format("BookKeeper[%s,first=%d,last=%d]", - lh.toString(), firstTxId, lastTxId); + return String.format( + "BookKeeperLedger[ledgerId=%d,firstTxId=%d,lastTxId=%d]", lh.getId(), + firstTxId, lastTxId); } @Override @@ -157,6 +158,11 @@ class BookKeeperEditLogInputStream extends EditLogInputStream { } } + @Override + public String toString() { + return ("BookKeeperEditLogInputStream {" + this.getName() + "}"); + } + /** * Input stream implementation which can be used by * FSEditLogOp.Reader