private void assignSegmentId ( String segmentName , Duration timeout ) { TimeoutTimer timer = new TimeoutTimer ( timeout ) ; Futures . exceptionListener ( getSegmentInfoInternal ( segmentName , timer . getRemaining ( ) ) . thenComposeAsync ( si -> submitAssignmentWithRetry ( SegmentInfo . deserialize ( si ) , timer . getRemaining ( ) ) , this . executor ) , ex -> failAssignment ( segmentName , ex ) ) ; }
Attempts to map a Segment to an Id by first trying to retrieve an existing id and should that not exist assign a new one .