public void stopSyncPostJournal ( AlluxioURI syncPoint ) throws InvalidPathException { MountTable . Resolution resolution = mMountTable . resolve ( syncPoint ) ; long mountId = resolution . getMountId ( ) ; // Remove initial sync thread Future < ? > syncFuture = mSyncPathStatus . remove ( syncPoint ) ; if ( syncFuture != null ) { syncFuture . cancel ( true ) ; } if ( mFilterMap . get ( mountId ) . isEmpty ( ) ) { // syncPoint removed was the last syncPoint for the mountId mFilterMap . remove ( mountId ) ; Future < ? > future = mPollerMap . remove ( mountId ) ; if ( future != null ) { future . cancel ( true ) ; } } // Tell UFS to stop monitoring the path try ( CloseableResource < UnderFileSystem > ufs = resolution . acquireUfsResource ( ) ) { ufs . get ( ) . stopSync ( resolution . getUri ( ) ) ; } catch ( IOException e ) { LOG . info ( "Ufs IOException for uri {}, exception is {}" , syncPoint , e ) ; } // Stop active sync polling on a particular UFS if it is the last sync point if ( mFilterMap . containsKey ( mountId ) && mFilterMap . get ( mountId ) . isEmpty ( ) ) { try ( CloseableResource < UnderFileSystem > ufs = resolution . acquireUfsResource ( ) ) { ufs . get ( ) . stopActiveSyncPolling ( ) ; } catch ( IOException e ) { LOG . warn ( "Encountered IOException when trying to stop polling thread {}" , e ) ; } } }
Clean up tasks to stop sync point after we have journaled .