hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r888135 - in /hadoop/hbase/branches/0.20: CHANGES.txt bin/hirb.rb src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Mon, 07 Dec 2009 21:00:05 GMT
Author: stack
Date: Mon Dec  7 21:00:05 2009
New Revision: 888135

URL: http://svn.apache.org/viewvc?rev=888135&view=rev
Log:
HBASE-2029 Reduce shell exception dump on console

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/bin/hirb.rb
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=888135&r1=888134&r2=888135&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Mon Dec  7 21:00:05 2009
@@ -26,6 +26,8 @@
    HBASE-2011  Add zktop like output to HBase's master UI (Lars George via
                Andrew Purtell)
    HBASE-2018  Updates to .META. blocked under high MemStore load
+   HBASE-2029 Reduce shell exception dump on console
+              (Lars George and J-D via Stack)
 
 Release 0.20.2 - November 18th, 2009
   INCOMPATIBLE CHANGES

Modified: hadoop/hbase/branches/0.20/bin/hirb.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/bin/hirb.rb?rev=888135&r1=888134&r2=888135&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/bin/hirb.rb (original)
+++ hadoop/hbase/branches/0.20/bin/hirb.rb Mon Dec  7 21:00:05 2009
@@ -18,17 +18,11 @@
 # Some goodies for hirb. Should these be left up to the user's discretion?
 require 'irb/completion'
 
-# Hack to turn down zk logging so it don't spew over the shell
-# log4j.logger.org.apache.zookeeper=INFO
-logger = org.apache.log4j.Logger.getLogger("org.apache.zookeeper")
-logger.setLevel(org.apache.log4j.Level::WARN);
-
 # Add the $HBASE_HOME/bin directory, the location of this script, to the ruby
 # load path so I can load up my HBase ruby modules
 $LOAD_PATH.unshift File.dirname($PROGRAM_NAME)
-# Require formatter and hbase
+# Require formatter
 require 'Formatter'
-require 'HBase'
 
 # See if there are args for this shell. If any, read and then strip from ARGV
 # so they don't go through to irb.  Output shell 'usage' if user types '--help'
@@ -36,11 +30,13 @@
 HBase Shell command-line options:
  format        Formatter for outputting results: console | html. Default: console
  format-width  Width of table outputs. Default: 110 characters.
+ -d | --debug  Set DEBUG log levels.
 HERE
 found = []
 format = 'console'
 format_width = 110
 script2run = nil
+logLevel = org.apache.log4j.Level::ERROR  
 for arg in ARGV
   if arg =~ /^--format=(.+)/i
     format = $1
@@ -58,6 +54,10 @@
   elsif arg == '-h' || arg == '--help'
     puts cmdline_help
     exit
+  elsif arg == '-d' || arg == '--debug'
+    logLevel = org.apache.log4j.Level::DEBUG
+    $fullBackTrace = true
+    puts "Setting DEBUG log level..."  
   else
     # Presume it a script. Save it off for running later below
     # after we've set up some environment.
@@ -70,11 +70,20 @@
 for arg in found
   ARGV.delete(arg)
 end
+
 # Presume console format.
 # Formatter takes an :output_stream parameter, if you don't want STDOUT.
 @formatter = Formatter::Console.new(:format_width => format_width)
 # TODO, etc.  @formatter = Formatter::XHTML.new(STDOUT)
 
+# Set logging level to avoid verboseness
+logger = org.apache.log4j.Logger.getLogger("org.apache.zookeeper")
+logger.setLevel(logLevel);
+logger = org.apache.log4j.Logger.getLogger("org.apache.hadoop.hbase")
+logger.setLevel(logLevel);
+# Require HBase now after setting log levels
+require 'HBase'
+
 # Setup the HBase module.  Create a configuration.
 # Turn off retries in hbase and ipc.  Human doesn't want to wait on N retries.
 @configuration = org.apache.hadoop.hbase.HBaseConfiguration.new()
@@ -478,6 +487,7 @@
     IRB.setup(ap_path)
     @CONF[:IRB_NAME] = 'hbase'
     @CONF[:AP_NAME] = 'hbase'
+    @CONF[:BACK_TRACE_LIMIT] = 0 unless $fullBackTrace
     
     if @CONF[:SCRIPT]
       hirb = HIRB.new(nil, @CONF[:SCRIPT])

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=888135&r1=888134&r2=888135&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Mon Dec  7 21:00:05 2009
@@ -196,8 +196,10 @@
      */
     public void process(WatchedEvent event) {
       KeeperState state = event.getState();
-      LOG.debug("Got ZooKeeper event, state: " + state + ", type: "
-          + event.getType() + ", path: " + event.getPath());
+      if(!state.equals(KeeperState.SyncConnected)) {
+        LOG.debug("Got ZooKeeper event, state: " + state + ", type: "
+            + event.getType() + ", path: " + event.getPath());
+      }
       if (state == KeeperState.Expired) {
         resetZooKeeper();
       }
@@ -699,7 +701,7 @@
             if (LOG.isDebugEnabled()) {
               LOG.debug("locateRegionInMeta attempt " + tries + " of " +
                 this.numRetries + " failed; retrying after sleep of " +
-                getPauseTime(tries), e);
+                getPauseTime(tries) + " because: " + e.getMessage());
             }
             relocateRegion(parentTable, metaKey);
           } else {
@@ -856,7 +858,9 @@
       SoftValueSortedMap<byte [], HRegionLocation> tableLocations =
         getTableLocations(tableName);
       if (tableLocations.put(startKey, location) == null) {
-        LOG.debug("Cached location " + location);
+        LOG.debug("Cached location for " +
+            location.getRegionInfo().getRegionNameAsString() +
+            " is " + location.getServerAddress());
       }
     }
     



Mime
View raw message