From 147694bb080b6f7cb1d24d2ec2742aac92be27aa Mon Sep 17 00:00:00 2001 From: Balazs Meszaros Date: Tue, 26 Jun 2018 10:47:06 +0200 Subject: [PATCH] HBASE-20649 Validate HFiles do not have PREFIX_TREE DataBlockEncoding --- .../hadoop/hbase/tool/DataBlockEncodingValidator.java | 5 ++--- .../org/apache/hadoop/hbase/tool/PreUpgradeValidator.java | 7 +++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/DataBlockEncodingValidator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/DataBlockEncodingValidator.java index e72521b1225..c909725a616 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/DataBlockEncodingValidator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/DataBlockEncodingValidator.java @@ -76,9 +76,8 @@ public class DataBlockEncodingValidator extends AbstractHBaseTool { if (incompatibilities > 0) { LOG.warn("There are {} column families with incompatible Data Block Encodings. Do not " - + "upgrade until these encodings are converted to a supported one.", incompatibilities); - LOG.warn("Check http://hbase.apache.org/book.html#upgrade2.0.prefix-tree.removed " - + "for instructions."); + + "upgrade until these encodings are converted to a supported one. " + + "Check https://s.apache.org/prefixtree for instructions.", incompatibilities); } else { LOG.info("The used Data Block Encodings are compatible with HBase 2.0."); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/PreUpgradeValidator.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/PreUpgradeValidator.java index 7bf307484b0..818004c272e 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/PreUpgradeValidator.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/PreUpgradeValidator.java @@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory; * *

*/ @@ -49,6 +50,7 @@ public class PreUpgradeValidator implements Tool { public static final String TOOL_NAME = "pre-upgrade"; public static final String VALIDATE_CP_NAME = "validate-cp"; public static final String VALIDATE_DBE_NAME = "validate-dbe"; + public static final String VALIDATE_HFILE = "validate-hfile"; private Configuration configuration; @@ -69,6 +71,8 @@ public class PreUpgradeValidator implements Tool { VALIDATE_CP_NAME); System.out.printf(" %-15s Validate DataBlockEncodings are compatible with HBase%n", VALIDATE_DBE_NAME); + System.out.printf(" %-15s Validate HFile contents are readable%n", + VALIDATE_HFILE); System.out.println("For further information, please use command -h"); } @@ -88,6 +92,9 @@ public class PreUpgradeValidator implements Tool { case VALIDATE_DBE_NAME: tool = new DataBlockEncodingValidator(); break; + case VALIDATE_HFILE: + tool = new HFileContentValidator(); + break; case "-h": printUsage(); return AbstractHBaseTool.EXIT_FAILURE;