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 ; }
Return number of storage directories of the given type .