HBase
  1. HBase
  2. HBASE-3925

Make Shell's -d and debug cmd behave the same

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 0.90.3, 0.90.7, 0.92.2, 0.94.3, 0.98.0, 0.95.2
    • Fix Version/s: 0.95.0
    • Component/s: shell
    • Labels:
    • Hadoop Flags:
      Reviewed

      Description

      The -d option switches log4j to DEBUG and leaves the backtrace level at the default. When using the supplied debug command we only switch the backtrace, but I would think this also should set the log4j levels:

      # Debugging method
      def debug
        if @shell.debug
          @shell.debug = false
          conf.back_trace_limit = 0
        else
          @shell.debug = true
          conf.back_trace_limit = 100
        end
        debug?
      end
      

      could be something like

      # Debugging method
      def debug
        if @shell.debug
          @shell.debug = false
          conf.back_trace_limit = 0
          log_level = org.apache.log4j.Level::ERROR
        else
          @shell.debug = true
          conf.back_trace_limit = 100
          log_level = org.apache.log4j.Level::DEBUG
        end
        org.apache.log4j.Logger.getLogger("org.apache.zookeeper").setLevel(log_level)
        org.apache.log4j.Logger.getLogger("org.apache.hadoop.hbase").setLevel(log_level)
        debug?
      end
      
      1. HBASE-3925-v2.txt
        2 kB
        Liang Xie
      2. HBASE-3925.patch
        2 kB
        Liang Xie

        Activity

        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #242 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/242/)
        HBASE-3925 Make Shell's -d and debug cmd behave the same (Revision 1402923)

        Result = FAILURE
        stack :
        Files :

        • /hbase/trunk/bin/hirb.rb
        Show
        Hudson added a comment - Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #242 (See https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/242/ ) HBASE-3925 Make Shell's -d and debug cmd behave the same (Revision 1402923) Result = FAILURE stack : Files : /hbase/trunk/bin/hirb.rb
        Hide
        Hudson added a comment -

        Integrated in HBase-TRUNK #3492 (See https://builds.apache.org/job/HBase-TRUNK/3492/)
        HBASE-3925 Make Shell's -d and debug cmd behave the same (Revision 1402923)

        Result = FAILURE
        stack :
        Files :

        • /hbase/trunk/bin/hirb.rb
        Show
        Hudson added a comment - Integrated in HBase-TRUNK #3492 (See https://builds.apache.org/job/HBase-TRUNK/3492/ ) HBASE-3925 Make Shell's -d and debug cmd behave the same (Revision 1402923) Result = FAILURE stack : Files : /hbase/trunk/bin/hirb.rb
        Hide
        stack added a comment -

        Applied to trunk. Thanks for the patch Liang.

        Show
        stack added a comment - Applied to trunk. Thanks for the patch Liang.
        Hide
        Liang Xie added a comment -

        [root@ha1 bin]# ./hbase shell -d
        Setting DEBUG log level
        ......
        hbase(main):001:0> debug?
        Debug mode is OFF

        And after applied the patch, it'll be consistence(the "-d" option will take effect) :
        [root@ha1 bin]# ./hbase shell -d
        Setting DEBUG log level
        ......
        hbase(main):001:0> debug?
        Debug mode is ON

        Show
        Liang Xie added a comment - [root@ha1 bin] # ./hbase shell -d Setting DEBUG log level ...... hbase(main):001:0> debug? Debug mode is OFF And after applied the patch, it'll be consistence(the "-d" option will take effect) : [root@ha1 bin] # ./hbase shell -d Setting DEBUG log level ...... hbase(main):001:0> debug? Debug mode is ON
        Hide
        Liang Xie added a comment -

        Stack Before i applied the patch, we could see :

        Show
        Liang Xie added a comment - Stack Before i applied the patch, we could see :
        Hide
        stack added a comment -

        Liang Xie Mind attaching console output that demonstrates this patch does what it claims? Patch looks good.

        Show
        stack added a comment - Liang Xie Mind attaching console output that demonstrates this patch does what it claims? Patch looks good.
        Hide
        Ted Yu added a comment -

        @Lars George:
        Do you want to take a look at the patch ?

        Show
        Ted Yu added a comment - @Lars George: Do you want to take a look at the patch ?
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12550584/HBASE-3925-v2.txt
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 hadoop2.0. The patch compiles against the hadoop 2.0 profile.

        -1 javadoc. The javadoc tool appears to have generated 82 warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        -1 findbugs. The patch appears to introduce 2 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed unit tests in .

        Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12550584/HBASE-3925-v2.txt against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 hadoop2.0 . The patch compiles against the hadoop 2.0 profile. -1 javadoc . The javadoc tool appears to have generated 82 warning messages. +1 javac . The applied patch does not increase the total number of javac compiler warnings. -1 findbugs . The patch appears to introduce 2 new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html Findbugs warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/3132//console This message is automatically generated.
        Hide
        Liang Xie added a comment -

        Attached patch addressed Ted's comment

        Show
        Liang Xie added a comment - Attached patch addressed Ted's comment
        Hide
        Ted Yu added a comment -

        Change looks good.
        Please generate the patch from root directory of workspace.

        Show
        Ted Yu added a comment - Change looks good. Please generate the patch from root directory of workspace.
        Hide
        Liang Xie added a comment -

        Could anyone help to review it? thanks in advance

        Show
        Liang Xie added a comment - Could anyone help to review it? thanks in advance
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12542735/HBASE-3925.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2723//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12542735/HBASE-3925.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/2723//console This message is automatically generated.
        Hide
        Liang Xie added a comment -

        a tentitive patch, please help to review, thanks

        Show
        Liang Xie added a comment - a tentitive patch, please help to review, thanks
        Hide
        stack added a comment -

        Moving out of 0.92

        Show
        stack added a comment - Moving out of 0.92
        Hide
        Lars George added a comment - - edited

        Also fix the initial flag when using the -d option. Currently we have this:

        $ bin/hbase shell -d
        Setting DEBUG log level...
        HBase Shell; enter 'help<RETURN>' for list of supported commands.
        Type "exit<RETURN>" to leave the HBase Shell
        Version 0.91.0-SNAPSHOT, r1127782, Thu May 26 10:28:47 CEST 2011
        
        hbase(main):001:0> debug?
        Debug mode is OFF
        

        No biggie, but inconsistent nevertheless.

        Show
        Lars George added a comment - - edited Also fix the initial flag when using the -d option. Currently we have this: $ bin/hbase shell -d Setting DEBUG log level... HBase Shell; enter 'help<RETURN>' for list of supported commands. Type "exit<RETURN>" to leave the HBase Shell Version 0.91.0-SNAPSHOT, r1127782, Thu May 26 10:28:47 CEST 2011 hbase(main):001:0> debug? Debug mode is OFF No biggie, but inconsistent nevertheless.

          People

          • Assignee:
            Liang Xie
            Reporter:
            Lars George
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development