belugabehr commented on a change in pull request #2312:
URL: https://github.com/apache/hive/pull/2312#discussion_r639715093
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java
##########
@@ -726,35 +709,24 @@ private boolean entryMatches(LookupInfo lookupInfo,
CacheEntry entry, Set<CacheE
public void removeEntry(CacheEntry entry) {
entry.invalidate();
- rwLock.writeLock().lock();
+ cacheWriteLock.lock();
try {
- removeFromLookup(entry);
+ String queryString = entry.getQueryText();
+ if (!queryMap.remove(queryString, entry)) {
+ LOG.warn("Attempted to remove entry but it was not in the cache: {}",
entry);
+ }
+
+ // Remove this entry from the table usage mappings.
+ entry.getTableNames().forEach(tableName ->
tableToEntryMap.remove(tableName, entry));
+
Review comment:
Moved out from having its own method
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]