From 84ec18eb45a1b94a0f670545cf460292c4f79161 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Fri, 8 Sep 2017 21:27:20 +0800 Subject: [PATCH] HBASE-18780 Remove HLogPrettyPrinter Signed-off-by: Michael Stack --- bin/hbase | 3 +- bin/hbase.cmd | 5 -- .../regionserver/wal/HLogPrettyPrinter.java | 88 ------------------- src/main/asciidoc/_chapters/ops_mgt.adoc | 8 +- 4 files changed, 5 insertions(+), 99 deletions(-) delete mode 100644 hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java diff --git a/bin/hbase b/bin/hbase index 5982c681580..ad2f3b88d8c 100755 --- a/bin/hbase +++ b/bin/hbase @@ -357,8 +357,7 @@ if [ "$COMMAND" = "shell" ] ; then CLASS="org.jruby.Main -X+O ${JRUBY_OPTS} ${HBASE_HOME}/bin/hirb.rb" elif [ "$COMMAND" = "hbck" ] ; then CLASS='org.apache.hadoop.hbase.util.HBaseFsck' -# TODO remove old 'hlog' version -elif [ "$COMMAND" = "hlog" -o "$COMMAND" = "wal" ] ; then +elif [ "$COMMAND" = "wal" ] ; then CLASS='org.apache.hadoop.hbase.wal.WALPrettyPrinter' elif [ "$COMMAND" = "hfile" ] ; then CLASS='org.apache.hadoop.hbase.io.hfile.HFilePrettyPrinter' diff --git a/bin/hbase.cmd b/bin/hbase.cmd index 457e4f7572d..af546a7bee3 100644 --- a/bin/hbase.cmd +++ b/bin/hbase.cmd @@ -415,11 +415,6 @@ goto :eof set CLASS=org.apache.hadoop.hbase.util.HBaseFsck goto :eof -@rem TODO remove older 'hlog' command -:hlog - set CLASS=org.apache.hadoop.hbase.wal.WALPrettyPrinter - goto :eof - :wal set CLASS=org.apache.hadoop.hbase.wal.WALPrettyPrinter goto :eof diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java deleted file mode 100644 index cf3b5c4b1d1..00000000000 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogPrettyPrinter.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.hadoop.hbase.regionserver.wal; - -import java.io.IOException; -import java.io.PrintStream; -import org.apache.hadoop.hbase.classification.InterfaceAudience; -import org.apache.hadoop.hbase.classification.InterfaceStability; -import org.apache.hadoop.hbase.HBaseInterfaceAudience; -import org.apache.hadoop.hbase.wal.WALPrettyPrinter; - -/** - * HLogPrettyPrinter prints the contents of a given HLog with a variety of - * options affecting formatting and extent of content. - * - * It targets two usage cases: pretty printing for ease of debugging directly by - * humans, and JSON output for consumption by monitoring and/or maintenance - * scripts. - * - * It can filter by row, region, or sequence id. - * - * It can also toggle output of values. - * - * @deprecated use the "hbase wal" command - */ -@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS) -@InterfaceStability.Evolving -@Deprecated -public class HLogPrettyPrinter extends WALPrettyPrinter { - - /** - * Basic constructor that simply initializes values to reasonable defaults. - */ - public HLogPrettyPrinter() { - this(false, false, -1l, null, null, false, System.out); - } - - /** - * Fully specified constructor. - * - * @param outputValues - * when true, enables output of values along with other log - * information - * @param outputJSON - * when true, enables output in JSON format rather than a - * "pretty string" - * @param sequence - * when nonnegative, serves as a filter; only log entries with this - * sequence id will be printed - * @param region - * when not null, serves as a filter; only log entries from this - * region will be printed - * @param row - * when not null, serves as a filter; only log entries from this row - * will be printed - * @param persistentOutput - * keeps a single list running for multiple files. if enabled, the - * endPersistentOutput() method must be used! - * @param out - * Specifies an alternative to stdout for the destination of this - * PrettyPrinter's output. - */ - public HLogPrettyPrinter(boolean outputValues, boolean outputJSON, - long sequence, String region, String row, boolean persistentOutput, - PrintStream out) { - super(outputValues, outputJSON, sequence, region, row, persistentOutput, out); - } - - public static void main(String[] args) throws IOException { - WALPrettyPrinter.main(args); - } - -} diff --git a/src/main/asciidoc/_chapters/ops_mgt.adoc b/src/main/asciidoc/_chapters/ops_mgt.adoc index 6f7f9e0da4d..771e3be5263 100644 --- a/src/main/asciidoc/_chapters/ops_mgt.adoc +++ b/src/main/asciidoc/_chapters/ops_mgt.adoc @@ -332,7 +332,7 @@ See <>. === WAL Tools [[hlog_tool]] -==== `FSHLog` tool +==== FSHLog tool The main method on `FSHLog` offers manual split and dump facilities. Pass it WALs or the product of a split, the content of the _recovered.edits_. @@ -353,9 +353,9 @@ Similarly you can force a split of a log file directory by doing: ---- [[hlog_tool.prettyprint]] -===== WAL Pretty Printer +===== WALPrettyPrinter -The WAL Pretty Printer is a tool with configurable options to print the contents of a WAL. +The `WALPrettyPrinter` is a tool with configurable options to print the contents of a WAL. You can invoke it via the HBase cli with the 'wal' command. ---- @@ -365,7 +365,7 @@ You can invoke it via the HBase cli with the 'wal' command. .WAL Printing in older versions of HBase [NOTE] ==== -Prior to version 2.0, the WAL Pretty Printer was called the `HLogPrettyPrinter`, after an internal name for HBase's write ahead log. +Prior to version 2.0, the `WALPrettyPrinter` was called the `HLogPrettyPrinter`, after an internal name for HBase's write ahead log. In those versions, you can print the contents of a WAL using the same configuration as above, but with the 'hlog' command. ----