src/main/java/org/apache/hadoop/hdfs/server/namenode/AbstractQueryEngine.java
@Override // QueryEngine
  public void dumpINodePaths(Collection<INode> inodes, Integer limit, HttpServletResponse resp)
      throws IOException {
    LOG.info("Dumping a list of {} INodes to a client.", inodes.size());
    long start = System.currentTimeMillis();
    PrintWriter writer = resp.getWriter();
    try {
      Collection<INode> subCollection;
      if (limit != null && limit < inodes.size()) {
        subCollection = inodes.stream().limit(limit).collect(Collectors.toList());
      } else {
        subCollection = inodes;
      }
      subCollection
          .stream()
          .sorted(Comparator.comparing(INode::getFullPathName))
          .forEach(
              node -> {
                writer.write(node.getFullPathName() + '\n');
                writer.flush();
              });
    } finally {
      IOUtils.closeStream(writer);
      LOG.info("Closed response.");
    }
    long end = System.currentTimeMillis();
    LOG.info("Sending the entire response took {} ms.", (end - start));
  }
/**
   * Dump collection of INodes to parameter HTTP response.
   *
   * @param inodes the collection to dump
   * @param limit some limit of inodes to show
   * @param resp the HTTP response
   * @throws IOException error in dumping collection
   */
Dump collection of INodes to parameter HTTP response.
@param inodes the collection to dump
@param limit some limit of inodes to show
@param resp the HTTP response
@throws IOException error in dumping collection
Dump collection of INodes to parameter HTTP response . @param inodes the collection to dump @param limit some limit of inodes to show @param resp the HTTP response @throws IOException error in dumping collection
@Override 
  public void dumpINodePaths(Collection<INode> inodes, Integer limit, HttpServletResponse resp)
      throws IOException {
    LOG.info("Dumping a list of {} INodes to a client.", inodes.size());
    long start = System.currentTimeMillis();
    PrintWriter writer = resp.getWriter();
    try {
      Collection<INode> subCollection;
      if (limit != null && limit < inodes.size()) {
        subCollection = inodes.stream().limit(limit).collect(Collectors.toList());
      } else {
        subCollection = inodes;
      }
      subCollection
          .stream()
          .sorted(Comparator.comparing(INode::getFullPathName))
          .forEach(
              node -> {
                writer.write(node.getFullPathName() + '\n');
                writer.flush();
              });
    } finally {
      IOUtils.closeStream(writer);
      LOG.info("Closed response.");
    }
    long end = System.currentTimeMillis();
    LOG.info("Sending the entire response took {} ms.", (end - start));
  }
@ Override public void dumpINodePaths ( Collection < INode > inodes , Integer limit , HttpServletResponse resp ) throws IOException { LOG . info ( "Dumping a list of {} INodes to a client." , inodes . size ( ) ) ; long start = System . currentTimeMillis ( ) ; PrintWriter writer = resp . getWriter ( ) ; try { Collection < INode > subCollection ; if ( limit != null && limit < inodes . size ( ) ) { subCollection = inodes . stream ( ) . limit ( limit ) . collect ( Collectors . toList ( ) ) ; } else { subCollection = inodes ; } subCollection . stream ( ) . sorted ( Comparator . comparing ( INode :: getFullPathName ) ) . forEach ( node -> { writer . write ( node . getFullPathName ( ) + '\n' ) ; writer . flush ( ) ; } ) ; } finally { IOUtils . closeStream ( writer ) ; LOG . info ( "Closed response." ) ; } long end = System . currentTimeMillis ( ) ; LOG . info ( "Sending the entire response took {} ms." , ( end - start ) ) ; }
Dump collection of INodes to parameter HTTP response.
Dump collection of INodes to parameter HTTP response .
// QueryEngine