accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1239346 - /incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
Date Wed, 01 Feb 2012 21:53:56 GMT
Author: ecn
Date: Wed Feb  1 21:53:56 2012
New Revision: 1239346

URL: http://svn.apache.org/viewvc?rev=1239346&view=rev
Log:
ACCUMULO-340 improve the error message, still hangs to preserve current behavior

Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java?rev=1239346&r1=1239345&r2=1239346&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
(original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
Wed Feb  1 21:53:56 2012
@@ -29,9 +29,9 @@ import org.apache.accumulo.core.conf.Pro
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.accumulo.core.util.ServerServices;
+import org.apache.accumulo.core.util.ServerServices.Service;
 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.ZooCache;
 import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.log4j.Logger;
@@ -109,6 +109,8 @@ public class ServerClient {
     }
   }
   
+  static volatile boolean warnedAboutTServersBeingDown = false;
+
   public static ClientService.Iface getConnection(Instance instance) throws TTransportException
{
     ArgumentChecker.notNull(instance);
     // create list of servers
@@ -133,8 +135,16 @@ public class ServerClient {
       opened = true;
       return client;
     } finally {
-      if (!opened)
-        log.warn("Failed to find an available server in the list of servers: " + servers);
+      if (!opened) {
+        if (!warnedAboutTServersBeingDown) {
+          if (servers.isEmpty()) {
+            log.warn("There are no tablet servers: check that zookeeper and tablet servers
are running.");
+          } else {
+            log.warn("Failed to find an available server in the list of servers: " + servers);
+          }
+          warnedAboutTServersBeingDown = true;
+        }
+      }
     }
   }
   



Mime
View raw message