hadoop-zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r774081 - in /hadoop/zookeeper/trunk: ./ src/contrib/bookkeeper/src/java/org/apache/bookkeeper/bookie/ src/contrib/bookkeeper/src/java/org/apache/bookkeeper/client/ src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/ src/contrib/bo...
Date Tue, 12 May 2009 20:59:34 GMT
Author: mahadev
Date: Tue May 12 20:59:33 2009
New Revision: 774081

URL: http://svn.apache.org/viewvc?rev=774081&view=rev
Log:
ZOOKEEPER-391. bookeeper mainline code should not be calling printStackTrace. (flavio via
mahadev)

Modified:
    hadoop/zookeeper/trunk/CHANGES.txt
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/bookie/Bookie.java
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/client/BookieHandle.java
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/BookieClient.java
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/NIOServerFactory.java
    hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/util/LocalBookKeeper.java

Modified: hadoop/zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/CHANGES.txt?rev=774081&r1=774080&r2=774081&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/CHANGES.txt (original)
+++ hadoop/zookeeper/trunk/CHANGES.txt Tue May 12 20:59:33 2009
@@ -122,6 +122,9 @@
 
   ZOOKEEPER-376. ant test target re-compiles cppunit code every time (phunt
 via mahadev)
+
+  ZOOKEEPER-391. bookeeper mainline code should not be calling
+printStackTrace. (flavio via mahadev) 
   
 NEW FEATURES:
 

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/bookie/Bookie.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/bookie/Bookie.java?rev=774081&r1=774080&r2=774081&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/bookie/Bookie.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/bookie/Bookie.java
Tue May 12 20:59:33 2009
@@ -267,10 +267,8 @@
                 }
                 toFlush.add(qe);
             }
-        } catch (InterruptedException e) {
-            LOG.debug("Bookie thread exiting due to interrupt");
         } catch (Exception e) {
-            e.printStackTrace();
+            LOG.fatal("Bookie thread exiting", e);
         }
     }
 

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/client/BookieHandle.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/client/BookieHandle.java?rev=774081&r1=774080&r2=774081&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/client/BookieHandle.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/client/BookieHandle.java
Tue May 12 20:59:33 2009
@@ -112,7 +112,7 @@
         try{
             incomingQueue.put(new ToSend(lh, r, entry));
         } catch(InterruptedException e){
-            e.printStackTrace();
+            LOG.warn("Interrupted while waiting for room in the incoming queue");
         }
     }
     
@@ -147,7 +147,7 @@
         try{
             incomingQueue.put(new ToSend(lh, r, entry));
         } catch(InterruptedException e){
-            e.printStackTrace();
+            LOG.warn("Interrupted while waiting for room in the incoming queue");
         }
     }
     

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/BookieClient.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/BookieClient.java?rev=774081&r1=774080&r2=774081&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/BookieClient.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/BookieClient.java
Tue May 12 20:59:33 2009
@@ -312,8 +312,7 @@
                 }
             }
         } catch(Exception e) {
-            LOG.error("Len = " + len + ", Type = " + type + ", rc = " + rc);
-            e.printStackTrace();
+            LOG.error("Len = " + len + ", Type = " + type + ", rc = " + rc, e);
         }
     }
 

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/NIOServerFactory.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/NIOServerFactory.java?rev=774081&r1=774080&r2=774081&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/NIOServerFactory.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/proto/NIOServerFactory.java
Tue May 12 20:59:33 2009
@@ -118,7 +118,6 @@
                 selected.clear();
             } catch (Exception e) {
                 LOG.warn(e);
-                e.printStackTrace();
             }
         }
         LOG.debug("NIOServerCnxn factory exitedloop.");

Modified: hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/util/LocalBookKeeper.java
URL: http://svn.apache.org/viewvc/hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/util/LocalBookKeeper.java?rev=774081&r1=774080&r2=774081&view=diff
==============================================================================
--- hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/util/LocalBookKeeper.java
(original)
+++ hadoop/zookeeper/trunk/src/contrib/bookkeeper/src/java/org/apache/bookkeeper/util/LocalBookKeeper.java
Tue May 12 20:59:33 2009
@@ -39,8 +39,10 @@
 import org.apache.zookeeper.server.ServerStats;
 import org.apache.zookeeper.server.ZooKeeperServer;
 
+import org.apache.log4j.Logger;
+
 public class LocalBookKeeper {
-	Logger LOG;
+    Logger LOG = Logger.getLogger(LocalBookKeeper.class);
 	ConsoleAppender ca;
 	int numberOfBookies;
 	
@@ -87,13 +89,11 @@
 			zks = new ZooKeeperServer(ZkTmpDir, ZkTmpDir, ZooKeeperDefaultPort);
 			serverFactory =  new NIOServerCnxn.Factory(ZooKeeperDefaultPort);
 			serverFactory.startup(zks);
-		} catch (IOException e1) {
-			// TODO Auto-generated catch block
-			e1.printStackTrace();
-		} catch (InterruptedException e) {
+		} catch (Exception e) {
 			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
+			LOG.fatal("Exception while instantiating ZooKeeper", e);
+		} 
+		
         boolean b = ClientBase.waitForServerUp(HOSTPORT, ClientBase.CONNECTION_TIMEOUT);
         LOG.debug("ZooKeeper server up: " + b);
 	}
@@ -112,13 +112,13 @@
 			}
 		} catch (KeeperException e) {
 			// TODO Auto-generated catch block
-			e.printStackTrace();
+			LOG.fatal("Exception while creating znodes", e);
 		} catch (InterruptedException e) {
 			// TODO Auto-generated catch block
-			e.printStackTrace();
+			LOG.fatal("Interrupted while creating znodes", e);
 		} catch (IOException e) {
 			// TODO Auto-generated catch block
-			e.printStackTrace();
+			LOG.fatal("Exception while creating znodes", e);
 		}		
 	}
 	private void runBookies() throws IOException{



Mime
View raw message