code: private void doFindFiles() throws IOException {
      Set<FileSystem> allFs = new HashSet<FileSystem>();
      Set<Path> filesToFix = new HashSet<Path>();      // files that are yet to be fixed
  
      // collect all unique filesystems in all policies.
      for (PolicyInfo pinfo: all) {
        FileSystem fs = getFs(pinfo.getConf(), pinfo.getSrcPath());
        if (fs != null) {
          allFs.add(fs);
        }
        for (PathInfo d:pinfo.getDestPaths()) {
          fs = getFs(pinfo.getConf(), d.rpath);
          if (fs != null) {
            allFs.add(fs);
          }
        }
      }
  
      // make a RPC to all relevant namenodes to find corrupt files
      for (FileSystem fs:allFs) {
        if (!running) break;
        List<Path> corruptFiles = null;
  
        corruptFiles = getCorruptFilesFromNamenode(fs);
  
        // if we are not already fixing this one, then put it in the list
        // of files that need fixing.
        for (Path p : corruptFiles) {
          if (filesBeingFixed.add(p)) {
             filesToFix.add(p);
          }
        }
      }
  
      if (!filesToFix.isEmpty()) {
        LOG.info("Found " + filesToFix.size() + " corrupt files.");
      }
  
      for (Path path: filesToFix) {
        if (!running) break;
        try {
          fixFile(path);
        } catch (IOException ie) {
          LOG.error("Error while processing " + path +
            ": " + StringUtils.stringifyException(ie));
          // For certain kinds of errors, it might be good if we remove
          // this file from filesBeingFixed, so that the file-fix gets
          // attemted in the immediate next iteration. For example, if
          // we get a network Exception, we can retry immediately. On 
          // the other hand, if we get a file length mismatch exception
          // then no amount of retry will fix it, so it is better to 
          // retry less frequently.
        }
      }
    }
docs: Poll namenode(s) to find corrupted files. Enqueue blocks for replication
  if needed.