private void removeFromLookup(CacheEntry entry) {
    String queryString = entry.getQueryText();
    if (!removeFromEntryMap(queryMap, 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 -> removeFromEntryMap(tableToEntryMap, tableName, entry));
  }
Check that the cache entry matches the lookupInfo.
@param lookupInfo
@param entry
@param entriesToRemove Set of entries to be removed after exiting read lock section.
                       If the entry is found to be invalid it will be added to this set.
@return
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java