chenboat commented on a change in pull request #5336:
URL: https://github.com/apache/incubator-pinot/pull/5336#discussion_r445709820



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/utils/fetcher/PeerServerSegmentFetcher.java
##########
@@ -0,0 +1,155 @@
+/**
+ * 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.common.utils.fetcher;
+
+import com.google.common.annotations.VisibleForTesting;
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import org.apache.commons.configuration.Configuration;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixManager;
+import org.apache.helix.model.ExternalView;
+import org.apache.helix.model.InstanceConfig;
+import org.apache.pinot.common.utils.CommonConstants;
+import org.apache.pinot.common.utils.LLCSegmentName;
+import org.apache.pinot.common.utils.StringUtil;
+import org.apache.pinot.common.utils.helix.HelixHelper;
+import org.apache.pinot.spi.config.table.TableType;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+
+/**
+ * This segment fetcher downloads the segment by first discovering the server 
having the segment through external view
+ * of a Pinot table and then downloading the segment from the peer server 
using a configured http or https fetcher. By
+ * default, HttpSegmentFetcher is used.
+ * The format fo expected segment address uri is
+ *    peer:///segment_name
+ * Note the host component is empty.
+ */
+public class PeerServerSegmentFetcher extends BaseSegmentFetcher {
+  private static final String PEER_2_PEER_PROTOCOL = "peer";
+  private static final String PEER_SEGMENT_DOWNLOAD_SCHEME = 
"peerSegmentDownloadScheme";
+  private HelixManager _helixManager;
+  private String _helixClusterName;
+  private HttpSegmentFetcher _httpSegmentFetcher;
+  // The value is either https or http
+  private final String _httpScheme;
+
+  public PeerServerSegmentFetcher(Configuration config, HelixManager 
helixManager, String helixClusterName) {
+    _helixManager = helixManager;
+    _helixClusterName = helixClusterName;
+    switch (config.getString(PEER_SEGMENT_DOWNLOAD_SCHEME)) {

Review comment:
       this is obsolete now.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to