accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1229427 - /incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
Date Tue, 10 Jan 2012 00:23:42 GMT
Author: kturner
Date: Tue Jan 10 00:23:41 2012
New Revision: 1229427

URL: http://svn.apache.org/viewvc?rev=1229427&view=rev
Log:
ACCUMULO-270 fixed cache consistence issue

Modified:
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java?rev=1229427&r1=1229426&r2=1229427&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
Tue Jan 10 00:23:41 2012
@@ -62,9 +62,14 @@ public class ClientServiceHandler implem
   }
   
   protected String checkTableId(String tableName, TableOperation operation) throws ThriftTableOperationException
{
-    final String tableId = Tables.getNameToIdMap(HdfsZooInstance.getInstance()).get(tableName);
-    if (tableId == null)
-      throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.NOTFOUND,
null);
+    String tableId = Tables.getNameToIdMap(HdfsZooInstance.getInstance()).get(tableName);
+    if (tableId == null) {
+      // maybe the table exist, but the cache was not updated yet... so try to clear the
cache and check again
+      Tables.clearCache(HdfsZooInstance.getInstance());
+      tableId = Tables.getNameToIdMap(HdfsZooInstance.getInstance()).get(tableName);
+      if (tableId == null)
+        throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.NOTFOUND,
null);
+    }
     return tableId;
   }
   



Mime
View raw message