keith-turner commented on a change in pull request #973: fixes #768 fix race
condition in generation of table map
URL: https://github.com/apache/accumulo/pull/973#discussion_r259596748
##########
File path: core/src/main/java/org/apache/accumulo/core/client/impl/Tables.java
##########
@@ -132,22 +111,35 @@ public static String getTableName(Instance instance,
String tableId)
/**
* Get the TableMap from the cache. A new one will be populated when needed.
Cache is cleared
- * manually by calling {@link #clearCache(Instance)} or automatically
cleared by ZooCache watcher
- * created in {@link #getZooCache(Instance)}. See ACCUMULO-4778.
+ * manually by calling {@link #clearCache(Instance)}
*/
private static TableMap getTableMap(final Instance instance) {
+
TableMap map;
+
+ final ZooCache zc = getZooCache(instance);
+
+ map = getTableMap(instance, zc);
+
+ if (!map.isCurrent(zc)) {
+ instanceToMapCache.invalidate(instance.getInstanceID());
+ map = getTableMap(instance, zc);
+ }
Review comment:
Guava handles that
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services