code: private SegmentMetadataUpdateTransaction getSegmentUpdateTransaction(long segmentId) throws MetadataUpdateException {
          SegmentMetadataUpdateTransaction tsm = tryGetSegmentUpdateTransaction(segmentId);
          if (tsm == null) {
              throw new MetadataUpdateException(this.containerId, String.format("No metadata entry exists for Segment Id %d.", segmentId));
          }
  
          return tsm;
      }
docs: Gets all pending changes for the given Segment.
  
  @param segmentId The Id of the Segment to query.
  @throws MetadataUpdateException If no metadata entry exists for the given Segment Id.