code: private UpdateableSegmentMetadata createSegmentMetadata(String segmentName, long segmentId) {
          UpdateableSegmentMetadata metadata = new StreamSegmentMetadata(segmentName, segmentId, this.containerId);
          this.newSegments.put(metadata.getId(), metadata);
          this.newSegmentNames.put(metadata.getName(), metadata.getId());
          return metadata;
      }
docs: Creates a new UpdateableSegmentMetadata for the given Segment and registers it.