You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2012/01/10 01:23:42 UTC
svn commit: r1229427 -
/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
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;
}