From 26458b41ceab6bc4f524b355833020bdf7d8c529 Mon Sep 17 00:00:00 2001 From: Enis Soztutar Date: Mon, 8 Jun 2015 12:17:50 -0700 Subject: [PATCH] HBASE-13853 ITBLL improvements after HBASE-13811 --- .../hbase/test/IntegrationTestBigLinkedList.java | 2 +- .../hadoop/hbase/io/hfile/HFilePrettyPrinter.java | 2 +- .../org/apache/hadoop/hbase/wal/WALSplitter.java | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java index 104c5da9d50..43bc5d4858b 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/test/IntegrationTestBigLinkedList.java @@ -222,7 +222,7 @@ public class IntegrationTestBigLinkedList extends IntegrationTestBase { protected int NUM_SLAVES_BASE = 3; // number of slaves for the cluster - private static final int MISSING_ROWS_TO_LOG = 50; + private static final int MISSING_ROWS_TO_LOG = 2; // YARN complains when too many counters private static final int WIDTH_DEFAULT = 1000000; private static final int WRAP_DEFAULT = 25; diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java index 7b92df91274..f083f8dfefd 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java @@ -167,7 +167,7 @@ public class HFilePrettyPrinter extends Configured implements Tool { if (cmd.hasOption("w")) { String key = cmd.getOptionValue("w"); if (key != null && key.length() != 0) { - row = key.getBytes(); + row = Bytes.toBytesBinary(key); isSeekToRow = true; } else { System.err.println("Invalid row is specified."); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java index 7fbb2855a5f..83da404abd3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALSplitter.java @@ -1342,9 +1342,11 @@ public class WALSplitter { thrown.add(ioe); return null; } - LOG.info("Closed " + wap.p + "; wrote " + wap.editsWritten + " edit(s) in " + if (LOG.isDebugEnabled()) { + LOG.debug("Closed wap " + wap.p + " (wrote " + (wap.editsWritten-wap.editsSkipped) + + " edits, skipped " + wap.editsSkipped + " edits in " + (wap.nanosSpent / 1000 / 1000) + "ms"); - + } if (wap.editsWritten == 0) { // just remove the empty recovered.edits file if (fs.exists(wap.p) && !fs.delete(wap.p, false)) { @@ -1559,6 +1561,8 @@ public class WALSplitter { wap.w.append(logEntry); this.updateRegionMaximumEditLogSeqNum(logEntry); editsCount++; + } else { + wap.incrementSkippedEdits(1); } } // Pass along summary statistics @@ -1597,6 +1601,8 @@ public class WALSplitter { public abstract static class SinkWriter { /* Count of edits written to this path */ long editsWritten = 0; + /* Count of edits skipped to this path */ + long editsSkipped = 0; /* Number of nanos spent writing to this log */ long nanosSpent = 0; @@ -1604,6 +1610,10 @@ public class WALSplitter { editsWritten += edits; } + void incrementSkippedEdits(int skipped) { + editsSkipped += skipped; + } + void incrementNanoTime(long nanos) { nanosSpent += nanos; }