pinot-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-pinot] snleee commented on a change in pull request #5046: Re-design the broker routing
Date Thu, 06 Feb 2020 08:56:23 GMT
snleee commented on a change in pull request #5046: Re-design the broker routing
URL: https://github.com/apache/incubator-pinot/pull/5046#discussion_r375682294
 
 

 ##########
 File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/v2/segmentselector/OfflineSegmentSelector.java
 ##########
 @@ -0,0 +1,64 @@
+/**
+ * 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.broker.routing.v2.segmentselector;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+import org.apache.helix.model.ExternalView;
+import org.apache.pinot.common.request.BrokerRequest;
+
+
+public class OfflineSegmentSelector implements SegmentSelector {
+  private volatile List<String> _segments;
+
+  @Override
+  public void init(ExternalView externalView, Set<String> onlineSegments) {
+    onExternalViewChange(externalView, onlineSegments);
+  }
+
+  @Override
+  public void onExternalViewChange(ExternalView externalView, Set<String> onlineSegments)
{
+    Set<String> externalViewSegments = externalView.getPartitionSet();
+    List<String> segments = new ArrayList<>(externalViewSegments.size());
+
+    for (String segment : externalViewSegments) {
+      // Keep segments in both external view and ideal state
+      // - New added segment might only exist in ideal state
+      // - New removed segment might only exist in external view
+      if (!onlineSegments.contains(segment)) {
+        continue;
+      }
+
+      // TODO: for new added segments, before all replicas are up, consider not selecting
them to avoid causing
 
 Review comment:
   +1 on this idea. This can potentially help use cases that are using onheap dictionary with
very high qps.

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


With regards,
Apache Git Services

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


Mime
View raw message