@ Override public FileStatus getFileStatus ( Path hadoopPath ) throws IOException { long startTime = System . nanoTime ( ) ; Preconditions . checkArgument ( hadoopPath != null , "hadoopPath must not be null" ) ; checkOpen ( ) ; logger . atFine ( ) . log ( "GHFS.getFileStatus: %s" , hadoopPath ) ; URI gcsPath = getGcsPath ( hadoopPath ) ; FileInfo fileInfo = getGcsFs ( ) . getFileInfo ( gcsPath ) ; if ( ! fileInfo . exists ( ) ) { logger . atFine ( ) . log ( "GHFS.getFileStatus: not found: %s" , gcsPath ) ; throw new FileNotFoundException ( ( fileInfo . isDirectory ( ) ? "Directory not found : " : "File not found : " ) + hadoopPath ) ; } String userName = getUgiUserName ( ) ; FileStatus status = getFileStatus ( fileInfo , userName ) ; long duration = System . nanoTime ( ) - startTime ; increment ( Counter . GET_FILE_STATUS ) ; increment ( Counter . GET_FILE_STATUS_TIME , duration ) ; return status ; }
Gets status of the given path item .