code: synchronized public OpenFileInfo[] iterativeGetOpenFiles(
      String prefix, int millis, String startAfter) {
        final long thresholdMillis = System.currentTimeMillis() - millis;
  
        // this flag is for subsequent calls that included a 'start'
        // parameter. in those cases, we need to throw out the first
        // result
        boolean skip = false;
        String jumpTo = startAfter;
        if (jumpTo == null || jumpTo.compareTo("") == 0)
          jumpTo = prefix;
        else
          skip = true;
  
        ArrayList<OpenFileInfo> entries =  new ArrayList<OpenFileInfo>();
  
        final int srclen = prefix.length();
        for(Map.Entry<String, LeaseOpenTime> entry : sortedLeasesByPath.tailMap(jumpTo).entrySet()) {
          final String p = entry.getKey();
          if (!p.startsWith(prefix)) {
            // traversed past the prefix, so we're done
            OpenFileInfo[] result = entries.toArray(
              new OpenFileInfo[entries.size()]);
            return result;
          }
          if (skip) {
            skip = false;
          } else if (p.length() == srclen || p.charAt(srclen) == Path.SEPARATOR_CHAR) {
            long openTime = entry.getValue().openTime;
            if (openTime <= thresholdMillis) {
              entries.add(new OpenFileInfo(entry.getKey(), openTime));
              if (entries.size() >= rpcBatchSize) {
                // reached the configured batch size, so return this subset
                OpenFileInfo[] result = entries.toArray(
                  new OpenFileInfo[entries.size()]);
                return result;
              }
            }
          }
        }
        // reached the end of the list of files, so we're done
        OpenFileInfo[] result = entries.toArray(
          new OpenFileInfo[entries.size()]);
        return result;
      }
docs: Fetch the list of files that have been open longer than a
  specified amount of time.
  @param prefix path prefix specifying subset of files to examine
  @param millis select files that have been open longer that this
  @param startAfter null, or the last path value returned by previous call
  @return array of OpenFileInfo objects
  @throw IOException