code: public List<HdfsStats> getAllDirs(String cluster, String pathPrefix,
        int limit, long runId) throws IOException {
      long encodedRunId = getEncodedRunId(runId);
      String rowPrefixStr =
          Long.toString(encodedRunId) + HdfsConstants.SEP + cluster;
      if (StringUtils.isNotEmpty(pathPrefix)) {
        // path expected to be cleansed at collection/storage time as well
        rowPrefixStr += HdfsConstants.SEP + StringUtil.cleanseToken(pathPrefix);
      }
      LOG.info(" Getting all dirs for cluster " + cluster + " with pathPrefix: "
          + pathPrefix + " for runId " + runId + " encodedRunId: " + encodedRunId
          + " limit: " + limit + " row prefix : " + rowPrefixStr);
      byte[] rowPrefix = Bytes.toBytes(rowPrefixStr);
      Scan scan = createScanWithAllColumns();
      scan.setStartRow(rowPrefix);
  
      // require that all rows match the prefix we're looking for
      Filter prefixFilter = new WhileMatchFilter(new PrefixFilter(rowPrefix));
      scan.setFilter(prefixFilter);
      // using a large scanner caching value with a small limit can mean we scan a
      // lot more data than
      // necessary, so lower the caching for low limits
      scan.setCaching(Math.min(limit, defaultScannerCaching));
      // we need only the latest cell version
      scan.setMaxVersions(1);
  
      return createFromScanResults(cluster, null, scan, limit, Boolean.FALSE, 0l,
          0l);
  
    }
docs: Gets hdfs stats about all dirs on the given cluster
  @param cluster
  @param pathPrefix
  @param limit
  @param runId
  @return list of hdfs stats
  @throws IOException