chenboat commented on a change in pull request #5277: URL: https://github.com/apache/incubator-pinot/pull/5277#discussion_r414221803
########## File path: pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/Server2ControllerSegmentUploader.java ########## @@ -0,0 +1,92 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.pinot.core.data.manager.realtime; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; +import org.apache.pinot.common.metrics.ServerMetrics; +import org.apache.pinot.common.protocols.SegmentCompletionProtocol; +import org.apache.pinot.common.utils.FileUploadDownloadClient; +import org.apache.pinot.core.util.SegmentCompletionProtocolUtils; +import org.apache.pinot.server.realtime.ControllerLeaderLocator; +import org.slf4j.Logger; + +import static org.apache.pinot.common.protocols.SegmentCompletionProtocol.ControllerResponseStatus.UPLOAD_SUCCESS; + + +// A segment uploader which uploads segments to the controller via the controller's segmentCommitUpload end point +// point. +public class Server2ControllerSegmentUploader implements SegmentUploader { + private final Logger _segmentLogger; + // The controller segment upload url. + private final String _controllerSegmentUploadCommitUrl; + private final FileUploadDownloadClient _fileUploadDownloadClient; + private final String _segmentName; + private final int _segmentUploadRequestTimeoutMs; + private final ServerMetrics _serverMetrics; + + public Server2ControllerSegmentUploader(Logger segmentLogger, FileUploadDownloadClient fileUploadDownloadClient, + String controllerSegmentUploadCommitUrl, String segmentName, int segmentUploadRequestTimeoutMs, + ServerMetrics serverMetrics) { + _segmentLogger = segmentLogger; + _fileUploadDownloadClient = fileUploadDownloadClient; + _controllerSegmentUploadCommitUrl = controllerSegmentUploadCommitUrl; Review comment: Done. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
