protected List < FileStatus > listStatus ( JobContext job ) throws IOException { List < FileStatus > result = new ArrayList < FileStatus > ( ) ; Path [ ] dirs = getInputPaths ( job ) ; if ( dirs . length == 0 ) { throw new IOException ( "No input paths specified in job" ) ; } // Get tokens for all the required FileSystems.. TokenCache . obtainTokensForNamenodes ( job . getCredentials ( ) , dirs , job . getConfiguration ( ) ) ; List < IOException > errors = new ArrayList < IOException > ( ) ; for ( Path p : dirs ) { FileSystem fs = p . getFileSystem ( job . getConfiguration ( ) ) ; final SmilePathFilter filter = new SmilePathFilter ( ) ; FileStatus [ ] matches = fs . globStatus ( p , filter ) ; if ( matches == null ) { errors . add ( new IOException ( "Input path does not exist: " + p ) ) ; } else if ( matches . length == 0 ) { errors . add ( new IOException ( "Input Pattern " + p + " matches 0 files" ) ) ; } else { for ( FileStatus globStat : matches ) { if ( globStat . isDir ( ) ) { Collections . addAll ( result , fs . listStatus ( globStat . getPath ( ) , filter ) ) ; } else { result . add ( globStat ) ; } } } } if ( ! errors . isEmpty ( ) ) { throw new InvalidInputException ( errors ) ; } return result ; }
List input directories .