From b2e313687be9d52784ee7b93659f3381c3eaa206 Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Fri, 22 Feb 2013 17:04:24 -0800 Subject: [PATCH] HBASE-7690 Improve printing of HFile metadata Add some special cases to improve readability of 'HFile -m' output. --- .../hadoop/hbase/io/hfile/HFilePrettyPrinter.java | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 be0fb17..b7d14fe 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 @@ -322,7 +322,29 @@ public class HFilePrettyPrinter { System.out.println("Fileinfo:"); for (Map.Entry e : fileInfo.entrySet()) { System.out.print(FOUR_SPACES + Bytes.toString(e.getKey()) + " = "); - if (Bytes.compareTo(e.getKey(), Bytes.toBytes("MAX_SEQ_ID_KEY")) == 0) { + if (Bytes.compareTo(e.getKey(), Bytes.toBytes("BULKLOAD_TIMESTAMP")) == 0) { + long ts = Bytes.toLong(e.getValue()); + System.out.println(ts); + } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("DELETE_FAMILY_COUNT")) == 0) { + long count = Bytes.toLong(e.getValue()); + System.out.println(count); + } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("EARLIEST_PUT_TS")) == 0) { + long ts = Bytes.toLong(e.getValue()); + System.out.println(ts); + } else if (Bytes.compareTo(e.getKey(), + Bytes.toBytes("EXCLUDE_FROM_MINOR_COMPACTION")) == 0) { + boolean flag = Bytes.toBoolean(e.getValue()); + System.out.println(flag); + } else if (Bytes.compareTo(e.getKey(), HFileWriterV2.KEY_VALUE_VERSION) == 0) { + int version = Bytes.toInt(e.getValue()); + System.out.println(version); + } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("MAJOR_COMPACTION_KEY")) == 0) { + boolean flag = Bytes.toBoolean(e.getValue()); + System.out.println(flag); + } else if (Bytes.compareTo(e.getKey(), HFileWriterV2.MAX_MEMSTORE_TS_KEY) == 0) { + long ts = Bytes.toLong(e.getValue()); + System.out.println(ts); + } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("MAX_SEQ_ID_KEY")) == 0) { long seqid = Bytes.toLong(e.getValue()); System.out.println(seqid); } else if (Bytes.compareTo(e.getKey(), Bytes.toBytes("TIMERANGE")) == 0) { -- 1.8.1