@ Override public void setWorkingDirectory ( Path hadoopPath ) { long startTime = System . nanoTime ( ) ; Preconditions . checkArgument ( hadoopPath != null , "hadoopPath must not be null" ) ; logger . atFine ( ) . log ( "GHFS.setWorkingDirectory: %s" , hadoopPath ) ; URI gcsPath = FileInfo . convertToDirectoryPath ( pathCodec , getGcsPath ( hadoopPath ) ) ; Path newPath = getHadoopPath ( gcsPath ) ; // Ideally we should check (as we did earlier) if the given path really points to an existing // directory. However, it takes considerable amount of time for that check which hurts perf. // Given that HDFS code does not do such checks either, we choose to not do them in favor of // better performance. workingDirectory = newPath ; logger . atFine ( ) . log ( "GHFS.setWorkingDirectory: => %s" , workingDirectory ) ; long duration = System . nanoTime ( ) - startTime ; increment ( Counter . SET_WD ) ; increment ( Counter . SET_WD_TIME , duration ) ; }
Sets the current working directory to the given path .