private FileStatus findStatusForSegment ( String segmentName , boolean enforceExistence ) throws IOException { FileStatus [ ] rawFiles = findAllRaw ( segmentName ) ; if ( rawFiles == null || rawFiles . length == 0 ) { if ( enforceExistence ) { throw HDFSExceptionHelpers . segmentNotExistsException ( segmentName ) ; } return null ; } val result = Arrays . stream ( rawFiles ) . sorted ( this :: compareFileStatus ) . collect ( Collectors . toList ( ) ) ; return result . get ( result . size ( ) - 1 ) ; }
Gets the filestatus representing the segment .