private static void addToEntryMap(Map<String, Set<CacheEntry>> entryMap,
      String key, CacheEntry entry) {
    Set<CacheEntry> entriesForKey = entryMap.get(key);
    if (entriesForKey == null) {
      entriesForKey = new HashSet<CacheEntry>();
      entryMap.put(key, entriesForKey);
    }
    entriesForKey.add(entry);
  }
Determines if the cache entry should be added to the results cache.
ql/src/java/org/apache/hadoop/hive/ql/cache/results/QueryResultsCache.java