Source:
<code>private LLCRealtimeSegmentZKMetadata updateCommittingSegmentZKMetadata(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor) { String segmentName = committingSegmentDescriptor.getSegmentName(); LOGGER.info("Updating segment ZK metadata for committing segment: {}", segmentName); Stat stat = new Stat(); LLCRealtimeSegmentZKMetadata committingSegmentZKMetadata = getSegmentZKMetadata(realtimeTableName, segmentName, stat); Preconditions.checkState(committingSegmentZKMetadata.getStatus() == Status.IN_PROGRESS, "Segment status for segment: %s should be IN_PROGRESS, found: %s", segmentName, committingSegmentZKMetadata.getStatus()); SegmentMetadataImpl segmentMetadata = committingSegmentDescriptor.getSegmentMetadata(); Preconditions.checkState(segmentMetadata != null, "Failed to find segment metadata from descriptor for segment: %s", segmentName); committingSegmentZKMetadata.setEndOffset(committingSegmentDescriptor.getNextOffset()); committingSegmentZKMetadata.setStatus(Status.DONE); <START> committingSegmentZKMetadata.setDownloadUrl(isPeerURL(committingSegmentDescriptor.getSegmentLocation()) ? "" <END> : committingSegmentDescriptor.getSegmentLocation()); committingSegmentZKMetadata.setCrc(Long.valueOf(segmentMetadata.getCrc())); committingSegmentZKMetadata.setStartTime(segmentMetadata.getTimeInterval().getStartMillis()); committingSegmentZKMetadata.setEndTime(segmentMetadata.getTimeInterval().getEndMillis()); committingSegmentZKMetadata.setTimeUnit(TimeUnit.MILLISECONDS); committingSegmentZKMetadata.setIndexVersion(segmentMetadata.getVersion()); committingSegmentZKMetadata.setTotalDocs(segmentMetadata.getTotalDocs()); persistSegmentZKMetadata(realtimeTableName, committingSegmentZKMetadata, stat.getVersion()); return committingSegmentZKMetadata; }</code><technical_language>define "" public static string METADATA_URI_FOR_PEER_DOWNLOAD in CommonConstants.Segment reference in server well, detect peer download? decide is "" components need thing, a common definition. A change this need done keeping compat in mind, if wants change it. thanks</technical_language>

Target:
private LLCRealtimeSegmentZKMetadata updateCommittingSegmentZKMetadata(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor) { String segmentName = committingSegmentDescriptor.getSegmentName(); LOGGER.info("Updating segment ZK metadata for committing segment: {}", segmentName); Stat stat = new Stat(); LLCRealtimeSegmentZKMetadata committingSegmentZKMetadata = getSegmentZKMetadata(realtimeTableName, segmentName, stat); Preconditions.checkState(committingSegmentZKMetadata.getStatus() == Status.IN_PROGRESS, "Segment status for segment: %s should be IN_PROGRESS, found: %s", segmentName, committingSegmentZKMetadata.getStatus()); SegmentMetadataImpl segmentMetadata = committingSegmentDescriptor.getSegmentMetadata(); Preconditions.checkState(segmentMetadata != null, "Failed to find segment metadata from descriptor for segment: %s", segmentName); committingSegmentZKMetadata.setEndOffset(committingSegmentDescriptor.getNextOffset()); committingSegmentZKMetadata.setStatus(Status.DONE); committingSegmentZKMetadata.setDownloadUrl(isPeerURL(committingSegmentDescriptor.getSegmentLocation()) ? CommonConstants.Segment.METADATA_URI_FOR_PEER_DOWNLOAD : committingSegmentDescriptor.getSegmentLocation()); committingSegmentZKMetadata.setCrc(Long.valueOf(segmentMetadata.getCrc())); committingSegmentZKMetadata.setStartTime(segmentMetadata.getTimeInterval().getStartMillis()); committingSegmentZKMetadata.setEndTime(segmentMetadata.getTimeInterval().getEndMillis()); committingSegmentZKMetadata.setTimeUnit(TimeUnit.MILLISECONDS); committingSegmentZKMetadata.setIndexVersion(segmentMetadata.getVersion()); committingSegmentZKMetadata.setTotalDocs(segmentMetadata.getTotalDocs()); persistSegmentZKMetadata(realtimeTableName, committingSegmentZKMetadata, stat.getVersion()); return committingSegmentZKMetadata; }