public static void setRequestCostHeader(Map<String, Double> costMap, RestResponseChannel restResponseChannel) {
    Objects.requireNonNull(costMap, "cost map cannot be null");
    restResponseChannel.setHeader(RequestCostHeaders.REQUEST_COST, KVHeaderValueEncoderDecoder.encodeKVHeaderValue(
        costMap.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> String.valueOf(e.getValue())))));
  }
Sets the request cost header in response.
@param costMap {@link Map} of cost for each quota.
@param restResponseChannel the {@link RestResponseChannel} that is used for sending the response.
ambry-api/src/main/java/com/github/ambry/rest/RestUtils.java