code: CompletableFuture<Void> updateSegmentInfo(SegmentMetadata segmentMetadata, Duration timeout) {
          if (segmentMetadata.isMerged()) {
              return Futures.failedFuture(new StreamSegmentMergedException(segmentMetadata.getName()));
          } else if (segmentMetadata.isDeleted()) {
              return Futures.failedFuture(new StreamSegmentNotExistsException(segmentMetadata.getName()));
          }
  
          ArrayView toWrite = SegmentInfo.serialize(new SegmentInfo(segmentMetadata.getId(), segmentMetadata.getSnapshot()));
          return updateSegmentInfo(segmentMetadata.getName(), toWrite, timeout);
      }
docs: Updates information about a Segment.
  
  @param segmentMetadata A {@link SegmentMetadata} that will be saved in the Metadata Store.
  @param timeout         Timeout for the operation.
  @return A CompletableFuture that, when completed, will indicate the operation succeeded.