private static boolean removeFromEntryMap(Map<String, Set<CacheEntry>> entryMap,
      String key, CacheEntry entry) {
    Set<CacheEntry> entries = entryMap.get(key);
    if (entries == null) {
      return false;
    }
    boolean deleted = entries.remove(entry);
    if (!deleted) {
      return false;
    }
    if (entries.isEmpty()) {
      entryMap.remove(key);
    }
    return true;
  }
Determines if the cache entry should be added to the results cache.
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java