### Question:
PinotLLCRealtimeSegmentManager { public void commitSegmentMetadata(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor) { Preconditions.checkState(!_isStopping, "Segment manager is stopping"); try { _numCompletingSegments.addAndGet(1); commitSegmentMetadataInternal(realtimeTableName, committingSegmentDescriptor); } finally { _numCompletingSegments.addAndGet(-1); } } PinotLLCRealtimeSegmentManager(PinotHelixResourceManager helixResourceManager, ControllerConf controllerConf,
      ControllerMetrics controllerMetrics); boolean getIsSplitCommitEnabled(); String getControllerVipUrl(); void stop(); void setUpNewTable(TableConfig tableConfig, IdealState idealState); void removeLLCSegments(IdealState idealState); @VisibleForTesting TableConfig getTableConfig(String realtimeTableName); void commitSegmentFile(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor); void commitSegmentMetadata(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor); long getCommitTimeoutMS(String realtimeTableName); void segmentStoppedConsuming(LLCSegmentName llcSegmentName, String instanceName); void ensureAllPartitionsConsuming(TableConfig tableConfig, PartitionLevelStreamConfig streamConfig);  }### Answer:
@Test public void testCommitSegmentMetadata() { FakePinotLLCRealtimeSegmentManager segmentManager = new FakePinotLLCRealtimeSegmentManager(); setUpNewTable(segmentManager, 2, 5, 4); String committingSegment = new LLCSegmentName(RAW_TABLE_NAME, 0, 0, CURRENT_TIME_MS).getSegmentName(); String segmentLocationVIP = "http: CommittingSegmentDescriptor committingSegmentDescriptor = new CommittingSegmentDescriptor(committingSegment, new LongMsgOffset(PARTITION_OFFSET.getOffset() + NUM_DOCS).toString(), 0L, segmentLocationVIP); committingSegmentDescriptor.setSegmentMetadata(mockSegmentMetadata()); segmentManager.commitSegmentMetadata(REALTIME_TABLE_NAME, committingSegmentDescriptor); LLCRealtimeSegmentZKMetadata metadata = segmentManager.getSegmentZKMetadata(REALTIME_TABLE_NAME, committingSegment, null); Assert.assertEquals(metadata.getDownloadUrl(), segmentLocationVIP); committingSegment = new LLCSegmentName(RAW_TABLE_NAME, 0, 1, CURRENT_TIME_MS).getSegmentName(); String peerSegmentLocation = CommonConstants.Segment.PEER_SEGMENT_DOWNLOAD_SCHEME + "/segment1"; committingSegmentDescriptor = new CommittingSegmentDescriptor(committingSegment, new LongMsgOffset(PARTITION_OFFSET.getOffset() + NUM_DOCS).toString(), 0L, peerSegmentLocation); committingSegmentDescriptor.setSegmentMetadata(mockSegmentMetadata()); segmentManager.commitSegmentMetadata(REALTIME_TABLE_NAME, committingSegmentDescriptor); metadata = segmentManager.getSegmentZKMetadata(REALTIME_TABLE_NAME, committingSegment, null); Assert.assertEquals(metadata.getDownloadUrl(), ""); }