protected void populateHeaders(List<String> mapIds, String jobId, int dagId,
        String user, int reduce, HttpResponse response,
        boolean keepAliveParam, Map<String, MapOutputInfo> mapOutputInfoMap)
        throws IOException {
      // Reads the index file for each requested mapId, and figures out the overall
      // length of the response - which is populated into the response header.

      long contentLength = 0;
      for (String mapId : mapIds) {
        MapOutputInfo outputInfo = getMapOutputInfo(jobId, dagId, mapId, reduce, user);
        // mapOutputInfoMap is used to share the lookups with the caller
        if (mapOutputInfoMap.size() < mapOutputMetaInfoCacheSize) {
          mapOutputInfoMap.put(mapId, outputInfo);
        }
        ShuffleHeader header =
            new ShuffleHeader(mapId, outputInfo.indexRecord.getPartLength(),
                outputInfo.indexRecord.getRawLength(), reduce);
        DataOutputBuffer dob = new DataOutputBuffer();
        header.write(dob);

        contentLength += outputInfo.indexRecord.getPartLength();
        contentLength += dob.getLength();
      }

      // Now set the response headers.
      setResponseHeaders(response, keepAliveParam, contentLength);
    }
Unregister a specific dag

This method and registerDag must be synchronized externally to prevent races in shuffle token registration/unregistration

@param dir
@param applicationIdString
@param dagIdentifier
llap-server/src/java/org/apache/hadoop/hive/llap/shufflehandler/ShuffleHandler.java