public void removeMap(String mapId) {
    IndexInformation info = cache.get(mapId);
    if (info == null || ((info != null) && isUnderConstruction(info))) {
      return;
    }
    info = cache.remove(mapId);
    if (info != null) {
      totalMemoryUsed.addAndGet(-info.getSize());
      if (!queue.remove(mapId)) {
        LOG.warn("Map ID" + mapId + " not found in queue!!");
      }
    } else {
      LOG.info("Map ID " + mapId + " not found in cache");
    }
  }
This method removes the map from the cache if index information for this
map is loaded(size>0), index information entry in cache will not be 
removed if it is in the loading phrase(size=0), this prevents corruption  
of totalMemoryUsed. It should be called when a map output on this tracker 
is discarded.
@param mapId The taskID of this map.
llap-server/src/java/org/apache/hadoop/hive/llap/shufflehandler/IndexCache.java