code: int getNumStorageDirs(NameNodeDirType dirType) {
      if(dirType == null)
        return getNumStorageDirs();
      Iterator<StorageDirectory> it = dirIterator(dirType);
      int numDirs = 0;
      for(; it.hasNext(); it.next())
        numDirs++;
      return numDirs;
    }
docs: Return number of storage directories of the given type.
  @param dirType directory type
  @return number of storage directories of type dirType