code: 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));
      }
docs: 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.
  
  @param segmentName The name of the Segment to assign id for.
  @param timeout     Timeout for the operation.