Repository: hbase Updated Branches: refs/heads/branch-2.0 a56fd069e -> 5e1c9fcd0
HBASE-20683 Incorrect return value for PreUpgradeValidator Signed-off-by: Ted Yu <yuzhih...@gmail.com> Signed-off-by: Chia-Ping Tsai <chia7...@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5e1c9fcd Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5e1c9fcd Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5e1c9fcd Branch: refs/heads/branch-2.0 Commit: 5e1c9fcd08b35647860553c36140f3e1fa2411ee Parents: a56fd06 Author: Peter Somogyi <psomo...@apache.org> Authored: Tue Jun 5 12:21:27 2018 +0200 Committer: Peter Somogyi <psomo...@apache.org> Committed: Wed Jun 6 20:04:53 2018 +0200 ---------------------------------------------------------------------- .../apache/hadoop/hbase/tool/PreUpgradeValidator.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/5e1c9fcd/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/PreUpgradeValidator.java ---------------------------------------------------------------------- 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 138af6a..6fe5a92 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 @@ -56,12 +56,12 @@ public class PreUpgradeValidator extends AbstractHBaseTool { private boolean validateDBE; /** - * Check DataBlockEncodings for column families. + * Check DataBlockEncodings of column families are compatible. * - * @return DataBlockEncoding compatible with HBase 2 + * @return number of column families with incompatible DataBlockEncoding * @throws IOException if a remote or network exception occurs */ - private boolean validateDBE() throws IOException { + private int validateDBE() throws IOException { int incompatibilities = 0; LOG.info("Validating Data Block Encodings"); @@ -92,17 +92,16 @@ public class PreUpgradeValidator extends AbstractHBaseTool { + "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."); - return false; } else { LOG.info("The used Data Block Encodings are compatible with HBase 2.0."); - return true; } + return incompatibilities; } @Override protected void addOptions() { addOptNoArg("all", "Run all pre-upgrade validations"); - addOptNoArg("validateDBE", "Validate DataBlockEncoding are compatible on the cluster"); + addOptNoArg("validateDBE", "Validate DataBlockEncodings are compatible"); } @Override @@ -115,7 +114,7 @@ public class PreUpgradeValidator extends AbstractHBaseTool { protected int doWork() throws Exception { boolean validationFailed = false; if (validateDBE || validateAll) { - if (validateDBE()) { + if (validateDBE() > 0) { validationFailed = true; } }