[ 
https://issues.apache.org/jira/browse/HBASE-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lars George updated HBASE-2029:
-------------------------------

    Attachment: HBASE-2029-hirb.patch

Add -d and --debug support. Help:

{noformat}
LarsMacBookPro:hbase-trunk-ro larsgeorge$ bin/hbase shell -h
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.
{noformat}

Without DEBUG switch, nice and clean:

{noformat}
LarsMacBookPro:hbase-trunk-ro larsgeorge$ bin/hbase shell   
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Version: 0.21.0-dev, r886052, Thu Dec  3 17:05:20 CET 2009
hbase(main):001:0> scan 'e'
NativeException: org.apache.hadoop.hbase.TableNotFoundException: e

hbase(main):002:0> exit
{noformat}

And with DEBUG switch, verbose as requested:

{noformat}
LarsMacBookPro:hbase-trunk-ro larsgeorge$ bin/hbase shell -d
Setting DEBUG log level...
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:zookeeper.version=3.2.1-808558, built on 08/27/2009 18:48 GMT
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:host.name=192.168.2.107
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.version=1.6.0_15
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.vendor=Apple Inc.
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.home=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.class.path=/Development/eclipse/workspace/hbase-trunk-ro/bin/../conf:/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home//lib/tools.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../build/classes:/Development/eclipse/workspace/hbase-trunk-ro/bin/../build/test:/Development/eclipse/workspace/hbase-trunk-ro/bin/../build:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/avro-1.2.0.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/commons-cli-2.0-SNAPSHOT.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/commons-el-from-jetty-5.1.4.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/commons-httpclient-3.0.1.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/commons-logging-1.0.4.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/commons-logging-api-1.0.4.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/commons-math-1.1.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/hadoop-core-0.21.0-SNAPSHOT-r832250.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/hadoop-core-test-0.21.0-SNAPSHOT-r832250.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/hadoop-hdfs-0.21.0-dev-r836012.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/hadoop-hdfs-test-0.21.0-dev-r836012.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/hadoop-mapred-0.21.0-dev-r833993.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/hadoop-mapred-test-0.21.0-dev-r833993.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jasper-compiler-5.5.12.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jasper-runtime-5.5.12.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jetty-6.1.14.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jetty-util-6.1.14.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jruby-complete-1.3.1.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/json.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/junit-4.7.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/libthrift-r771587.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/log4j-1.2.15.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/lucene-core-2.2.0.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/servlet-api-2.5-6.1.14.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/zookeeper-3.2.1.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jsp-2.1/jsp-2.1.jar:/Development/eclipse/workspace/hbase-trunk-ro/bin/../lib/jsp-2.1/jsp-api-2.1.jar
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.library.path=.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.io.tmpdir=/var/folders/Ok/Ok45YK4DF8S5jZMXZptEek+++TI/-Tmp-/
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:java.compiler=<NA>
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client environment:os.name=Mac OS X
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client environment:os.arch=x86_64
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client environment:os.version=10.6.2
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:user.name=larsgeorge
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:user.home=/Users/larsgeorge
09/12/04 12:20:36 INFO zookeeper.ZooKeeper: Client 
environment:user.dir=/Development/eclipse/workspace/hbase-trunk-ro
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Version: 0.21.0-dev, r886052, Thu Dec  3 17:05:20 CET 2009
hbase(main):001:0> scan 'e'
09/12/04 12:20:40 INFO zookeeper.ZooKeeper: Initiating client connection, 
connectString=localhost:2181 sessionTimeout=60000 
watcher=org.apache.hadoop.hbase.client.hconnectionmanager$clientzkwatc...@58f41393
09/12/04 12:20:40 INFO zookeeper.ClientCnxn: zookeeper.disableAutoWatchReset is 
false
09/12/04 12:20:40 INFO zookeeper.ClientCnxn: Attempting connection to server 
localhost/0:0:0:0:0:0:0:1:2181
09/12/04 12:20:40 INFO zookeeper.ClientCnxn: Priming connection to 
java.nio.channels.SocketChannel[connected local=/0:0:0:0:0:0:0:1%0:57219 
remote=localhost/0:0:0:0:0:0:0:1:2181]
09/12/04 12:20:40 INFO zookeeper.ClientCnxn: Server connection successful
09/12/04 12:20:40 DEBUG client.HConnectionManager$ClientZKWatcher: Got 
ZooKeeper event, state: SyncConnected, type: None, path: null
09/12/04 12:20:40 DEBUG zookeeper.ClientCnxn: Reading reply 
sessionid:0x125554a4a9f000c, packet:: clientPath:null serverPath:null 
finished:false header:: -8,101  replyHeader:: -8,229,0  request:: 0,v{},v{},v{} 
 response:: null
09/12/04 12:20:40 DEBUG zookeeper.ClientCnxn: Reading reply 
sessionid:0x125554a4a9f000c, packet:: clientPath:null serverPath:null 
finished:false header:: 1,4  replyHeader:: 1,229,0  request:: 
'/hbase/root-region-server,F  response:: 
#3139322e3136382e322e3130373a3532303437,s{11,209,1259840355831,1259856415401,9,0,0,0,19,0,11}
 
09/12/04 12:20:40 DEBUG zookeeper.ZooKeeperWrapper: Read ZNode 
/hbase/root-region-server got 192.168.2.107:52047
09/12/04 12:20:41 DEBUG client.HConnectionManager$TableServers: Found ROOT at 
192.168.2.107:52047
09/12/04 12:20:41 DEBUG client.HConnectionManager$TableServers: Cached location 
address: 192.168.2.107:52047, regioninfo: REGION => {NAME => '.META.,,1', 
STARTKEY => '', ENDKEY => '', ENCODED => 1028785192, TABLE => {{NAME => 
'.META.', IS_META => 'true', FAMILIES => [{NAME => 'historian', VERSIONS => 
'2147483647', COMPRESSION => 'NONE', TTL => '604800', BLOCKSIZE => '8192', 
IN_MEMORY => 'false', BLOCKCACHE => 'false'}, {NAME => 'info', VERSIONS => 
'10', COMPRESSION => 'NONE', TTL => '2147483647', BLOCKSIZE => '8192', 
IN_MEMORY => 'false', BLOCKCACHE => 'false'}]}}
NativeException: org.apache.hadoop.hbase.TableNotFoundException: e

hbase(main):002:0> exit
09/12/04 12:20:48 INFO zookeeper.ZooKeeper: Closing session: 0x125554a4a9f000c
09/12/04 12:20:48 INFO zookeeper.ClientCnxn: Closing ClientCnxn for session: 
0x125554a4a9f000c
09/12/04 12:20:48 INFO zookeeper.ClientCnxn: Exception while closing send 
thread for session 0x125554a4a9f000c : Read error rc = -1 
java.nio.DirectByteBuffer[pos=0 lim=4 cap=4]
09/12/04 12:20:48 WARN zookeeper.ClientCnxn: Ignoring exception during shutdown 
input
java.net.SocketException: Socket is not connected
        at sun.nio.ch.SocketChannelImpl.shutdown(Native Method)
        at 
sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:640)
        at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:360)
        at 
org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:999)
        at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:984)
09/12/04 12:20:48 INFO zookeeper.ClientCnxn: Disconnecting ClientCnxn for 
session: 0x125554a4a9f000c
09/12/04 12:20:48 INFO zookeeper.ZooKeeper: Session: 0x125554a4a9f000c closed
09/12/04 12:20:48 INFO zookeeper.ClientCnxn: EventThread shut down
09/12/04 12:20:48 DEBUG zookeeper.ZooKeeperWrapper: Closed connection with 
ZooKeeper
{noformat}

One last thing I could think of is to set the @CONF[:BACK_TRACE_LIMIT] = 0 
according to that switch as well. So that with DEBUG enabled it also logs the 
full details from the ruby scripts.

> Reduce shell exception dump on console
> --------------------------------------
>
>                 Key: HBASE-2029
>                 URL: https://issues.apache.org/jira/browse/HBASE-2029
>             Project: Hadoop HBase
>          Issue Type: Improvement
>          Components: scripts
>    Affects Versions: 0.20.2
>            Reporter: Lars George
>            Assignee: Jean-Daniel Cryans
>            Priority: Minor
>             Fix For: 0.21.0
>
>         Attachments: HBASE-2029-hirb.patch, HBASE-2029.patch
>
>
> As discussed on IRC and seen over and over, the shell is too verbose when it 
> prints Java related exceptions. The huge stack trace on the console is often 
> causing more harm then actually helping.
> {noformat}
> ...
> [11:31pm] larsgeorge:
> the only concern is to keep it in sync with new changes and also reduce its 
> stacktrace
> [11:31pm] larsgeorge:
> that can be quite nasty
> [11:31pm] _dodger_:
> I've seen a prime example of that on the mailing list today
> [11:32pm] larsgeorge:
> yeah, those do repeat themselves
> [11:32pm] larsgeorge:
> also that DEBUG is on by default
> [11:33pm] larsgeorge:
> mind you, that is a good idea for the daemons
> [11:33pm] larsgeorge:
> but prolly not the shell
> [11:33pm] jdcryans:
> I was thinking
> [11:33pm] larsgeorge:
> maybe we can set ERROR logging level just for the shell when it is started?
> [11:34pm] jdcryans:
> we should stop printing the stack trace for NSRE
> [11:34pm] larsgeorge:
> there are a few others of that sort
> [11:34pm] larsgeorge:
> be it ZK reconnects etc.
> [11:35pm] jdcryans:
> yeah there's a lot of hbase-generated zk-related noise
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to