public static void persistAndWait ( final FileSystem fs , final AlluxioURI uri , int timeoutMs ) throws FileDoesNotExistException , IOException , AlluxioException , TimeoutException , InterruptedException { fs . persist ( uri ) ; CommonUtils . waitFor ( String . format ( "%s to be persisted" , uri ) , ( ) -> { try { return fs . getStatus ( uri ) . isPersisted ( ) ; } catch ( Exception e ) { Throwables . throwIfUnchecked ( e ) ; throw new RuntimeException ( e ) ; } } , WaitForOptions . defaults ( ) . setTimeoutMs ( timeoutMs ) . setInterval ( Constants . SECOND_MS ) ) ; }
Persists the given path to the under file system and returns once the persist is complete . Note that if this method times out the persist may still occur after the timeout period .