incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1196721 - in /incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server: logger/LogService.java master/Master.java tabletserver/TabletServer.java
Date Wed, 02 Nov 2011 18:01:39 GMT
Author: ecn
Date: Wed Nov  2 18:01:38 2011
New Revision: 1196721

URL: http://svn.apache.org/viewvc?rev=1196721&view=rev
Log:
ACCUMULO-113: log a message on an unexpected exception

Modified:
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java?rev=1196721&r1=1196720&r2=1196721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
Wed Nov  2 18:01:38 2011
@@ -124,8 +124,11 @@ public class LogService implements Mutat
       LOG.fatal("Failed to initialize log service args=" + Arrays.asList(args), e);
       throw e;
     }
-    
-    logService.run();
+    try {
+      logService.run();
+    } catch (Exception ex) {
+      LOG.error("Unexpected exception, exiting.", ex);
+    }
   }
   
   public LogService(String[] args) throws UnknownHostException, KeeperException, InterruptedException,
IOException {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1196721&r1=1196720&r2=1196721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/master/Master.java
Wed Nov  2 18:01:38 2011
@@ -65,6 +65,7 @@ import org.apache.accumulo.core.file.Fil
 import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.master.thrift.LoggerStatus;
 import org.apache.accumulo.core.master.thrift.MasterClientService;
+import org.apache.accumulo.core.master.thrift.MasterClientService.Processor;
 import org.apache.accumulo.core.master.thrift.MasterGoalState;
 import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
 import org.apache.accumulo.core.master.thrift.MasterState;
@@ -72,7 +73,6 @@ import org.apache.accumulo.core.master.t
 import org.apache.accumulo.core.master.thrift.TabletLoadState;
 import org.apache.accumulo.core.master.thrift.TabletServerStatus;
 import org.apache.accumulo.core.master.thrift.TabletSplit;
-import org.apache.accumulo.core.master.thrift.MasterClientService.Processor;
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
@@ -151,9 +151,9 @@ import org.apache.accumulo.server.util.T
 import org.apache.accumulo.server.util.time.SimpleTimer;
 import org.apache.accumulo.server.zookeeper.IZooReaderWriter;
 import org.apache.accumulo.server.zookeeper.ZooLock;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.server.zookeeper.ZooLock.LockLossReason;
 import org.apache.accumulo.server.zookeeper.ZooLock.LockWatcher;
+import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.server.zookeeper.ZooReaderWriter.Mutator;
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
 import org.apache.hadoop.fs.FileSystem;
@@ -276,14 +276,15 @@ public class Master implements LiveTServ
   static final boolean X = true;
   static final boolean _ = false;
   static final boolean transitionOK[][] = {
-      // INITIAL HAVE_LOCK SAFE_MODE NORMAL UNLOAD_META UNLOAD_ROOT STOP
-      /* INITIAL */{X, X, _, _, _, _, X},
-      /* HAVE_LOCK */{_, X, X, X, _, _, X},
-      /* SAFE_MODE */{_, _, X, X, X, _, X},
-      /* NORMAL */{_, _, X, X, X, _, X},
-      /* UNLOAD_METADATA_TABLETS */{_, _, X, X, X, X, X},
-      /* UNLOAD_ROOT_TABLET */{_, _, _, _, _, X, X},
-      /* STOP */{_, _, _, _, _, _, X},};
+      //                            INITIAL HAVE_LOCK SAFE_MODE NORMAL UNLOAD_META UNLOAD_ROOT
STOP
+      /* INITIAL                 */{X,      X,        _,        _,     _,          _,   
      X},
+      /* HAVE_LOCK               */{_,      X,        X,        X,     _,          _,   
      X},
+      /* SAFE_MODE               */{_,      _,        X,        X,     X,          _,   
      X},
+      /* NORMAL                  */{_,      _,        X,        X,     X,          _,   
      X},
+      /* UNLOAD_METADATA_TABLETS */{_,      _,        X,        X,     X,          X,   
      X},
+      /* UNLOAD_ROOT_TABLET      */{_,      _,        _,        _,     _,          X,   
      X},
+      /* STOP                    */{_,      _,        _,        _,     _,          _,   
      X},
+      };
   
   synchronized private void setMasterState(MasterState newState) {
     if (state.equals(newState))
@@ -2139,8 +2140,12 @@ public class Master implements LiveTServ
   }
   
   public static void main(String[] args) throws Exception {
-    Master master = new Master(args);
-    master.run();
+    try {
+      Master master = new Master(args);
+      master.run();
+    } catch (Exception ex) {
+      log.error("Unexpected exception, exiting", ex);
+    }
   }
   
   @Override

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java?rev=1196721&r1=1196720&r2=1196721&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
(original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
Wed Nov  2 18:01:38 2011
@@ -69,8 +69,8 @@ import org.apache.accumulo.core.client.i
 import org.apache.accumulo.core.client.impl.Translator;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.constraints.Violations;
 import org.apache.accumulo.core.constraints.Constraint.Environment;
+import org.apache.accumulo.core.constraints.Violations;
 import org.apache.accumulo.core.data.Column;
 import org.apache.accumulo.core.data.ConstraintViolationSummary;
 import org.apache.accumulo.core.data.Key;
@@ -120,10 +120,10 @@ import org.apache.accumulo.core.util.Col
 import org.apache.accumulo.core.util.Daemon;
 import org.apache.accumulo.core.util.LoggingRunnable;
 import org.apache.accumulo.core.util.ServerServices;
+import org.apache.accumulo.core.util.ServerServices.Service;
 import org.apache.accumulo.core.util.Stat;
 import org.apache.accumulo.core.util.ThriftUtil;
 import org.apache.accumulo.core.util.UtilWaitThread;
-import org.apache.accumulo.core.util.ServerServices.Service;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.core.zookeeper.ZooUtil.NodeExistsPolicy;
 import org.apache.accumulo.server.Accumulo;
@@ -170,8 +170,8 @@ import org.apache.accumulo.server.util.F
 import org.apache.accumulo.server.util.Halt;
 import org.apache.accumulo.server.util.MapCounter;
 import org.apache.accumulo.server.util.MetadataTable;
-import org.apache.accumulo.server.util.TServerUtils;
 import org.apache.accumulo.server.util.MetadataTable.LogEntry;
+import org.apache.accumulo.server.util.TServerUtils;
 import org.apache.accumulo.server.util.TServerUtils.ServerPort;
 import org.apache.accumulo.server.util.time.RelativeTime;
 import org.apache.accumulo.server.util.time.SimpleTimer;
@@ -179,9 +179,9 @@ import org.apache.accumulo.server.zookee
 import org.apache.accumulo.server.zookeeper.TransactionWatcher;
 import org.apache.accumulo.server.zookeeper.ZooCache;
 import org.apache.accumulo.server.zookeeper.ZooLock;
-import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.server.zookeeper.ZooLock.LockLossReason;
 import org.apache.accumulo.server.zookeeper.ZooLock.LockWatcher;
+import org.apache.accumulo.server.zookeeper.ZooReaderWriter;
 import org.apache.accumulo.start.Platform;
 import org.apache.accumulo.start.classloader.AccumuloClassLoader;
 import org.apache.hadoop.conf.Configuration;
@@ -3080,9 +3080,13 @@ public class TabletServer extends Abstra
   }
   
   public static void main(String[] args) throws IOException {
-    TabletServer server = new TabletServer();
-    server.config(args);
-    server.run();
+    try {
+      TabletServer server = new TabletServer();
+      server.config(args);
+      server.run();
+    } catch (Exception ex) {
+      log.error("Uncaught exception in TabletServer.main, exiting", ex);
+    }
   }
   
   public void minorCompactionFinished(CommitSession tablet, String newDatafile, int walogSeq)
throws IOException {



Mime
View raw message