private static int parsePlanFile ( ) { int ret = - 1 ; try { FileInputStream fis = new FileInputStream ( planfilePath_ ) ; DataInputStream dis = new DataInputStream ( fis ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( dis ) ) ; if ( prefix_ . isEmpty ( ) ) { prefix_ = "PATH_PREFIX_" ; } String line ; while ( ( line = br . readLine ( ) ) != null ) { if ( line . length ( ) == 0 || line . startsWith ( "#" ) ) { continue ; } if ( line . startsWith ( "type=" ) ) { type_ = line . substring ( 5 ) ; continue ; } if ( line . startsWith ( "levels=" ) ) { levels_ = Integer . parseInt ( line . substring ( 7 ) ) ; continue ; } if ( line . startsWith ( "inodes=" ) ) { inodesPerLevel_ = Integer . parseInt ( line . substring ( 7 ) ) ; continue ; } if ( line . startsWith ( "nstat=" ) ) { pathsToStat_ = Integer . parseInt ( line . substring ( 6 ) ) ; continue ; } } dis . close ( ) ; if ( levels_ > 0 && ! type_ . isEmpty ( ) && inodesPerLevel_ > 0 && pathsToStat_ > 0 ) { ret = 0 ; } } catch ( Exception e ) { System . out . println ( "Error: " + e . getMessage ( ) ) ; } return ret ; }
Parses the plan file that contains parameters for the benchmark .