code: CompletableFuture<SegmentProperties> getSegmentInfo(String segmentName, Duration timeout) {
          long streamSegmentId = this.connector.containerMetadata.getStreamSegmentId(segmentName, true);
          CompletableFuture<SegmentProperties> result;
          if (isValidSegmentId(streamSegmentId)) {
              // Looks like the Segment is active and we have it in our Metadata. Return the result from there.
              SegmentMetadata sm = this.connector.containerMetadata.getStreamSegmentMetadata(streamSegmentId);
              if (sm.isDeleted() || sm.isMerged()) {
                  result = Futures.failedFuture(new StreamSegmentNotExistsException(segmentName));
              } else {
                  result = CompletableFuture.completedFuture(sm.getSnapshot());
              }
          } else {
              // The Segment is not yet active.
              // First, check to see if we have a pending assignment. If so, piggyback on that.
              QueuedCallback<SegmentProperties> queuedCallback = checkConcurrentAssignment(segmentName,
                      id -> CompletableFuture.completedFuture(this.connector.containerMetadata.getStreamSegmentMetadata(id).getSnapshot()));
  
              if (queuedCallback != null) {
                  result = queuedCallback.result;
              } else {
                  // Not in metadata and no concurrent assignments. Go to Storage and get what's needed.
                  result = getSegmentInfoInternal(segmentName, timeout)
                          .thenApply(rawData -> SegmentInfo.deserialize(rawData).getProperties());
              }
          }
  
          return result;
      }
docs: Gets information about a Segment. If the Segment is active, it returns this information directly from the
  in-memory Metadata. If the Segment is not active, it fetches the information from Storage and returns it, without
  activating the segment in the Metadata or otherwise touching the DurableLog.
  
  @param segmentName The Segment Name.
  @param timeout     Timeout for the Operation.
  @return A CompletableFuture that, when complete, will contain a {@link SegmentProperties} object with the desired
  information. If failed, it will contain the exception that caused the failure.