code: private SegmentMetadataUpdateTransaction tryGetSegmentUpdateTransaction(long segmentId) {
          SegmentMetadataUpdateTransaction sm = this.segmentUpdates.getOrDefault(segmentId, null);
          if (sm == null) {
              SegmentMetadata baseSegmentMetadata = this.baseMetadata.getStreamSegmentMetadata(segmentId);
              if (baseSegmentMetadata == null) {
                  baseSegmentMetadata = this.newSegments.getOrDefault(segmentId, null);
              }
  
              if (baseSegmentMetadata != null) {
                  sm = new SegmentMetadataUpdateTransaction(baseSegmentMetadata, this.recoveryMode);
                  this.segmentUpdates.put(segmentId, sm);
              }
          }
  
          return sm;
      }
docs: Attempts to get a SegmentMetadataUpdateTransaction for an existing or new Segment.
  
  @param segmentId The Id of the Segment to retrieve.
  @return An instance of SegmentMetadataUpdateTransaction, or null if no such segment exists.