public String getMountPoint ( AlluxioURI uri ) throws InvalidPathException { String path = uri . getPath ( ) ; String lastMount = ROOT ; try ( LockResource r = new LockResource ( mReadLock ) ) { for ( Map . Entry < String , MountInfo > entry : mState . getMountTable ( ) . entrySet ( ) ) { String mount = entry . getKey ( ) ; // we choose a new candidate path if the previous candidatepath is a prefix // of the current alluxioPath and the alluxioPath is a prefix of the path if ( ! mount . equals ( ROOT ) && PathUtils . hasPrefix ( path , mount ) && PathUtils . hasPrefix ( mount , lastMount ) ) { lastMount = mount ; } } return lastMount ; } }
Returns the closest ancestor mount point the given path is nested under .