From commits-return-16092-archive-asf-public=cust-asf.ponee.io@pinot.apache.org Fri Feb 7 23:25:21 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 2A48218060E for ; Sat, 8 Feb 2020 00:25:21 +0100 (CET) Received: (qmail 26728 invoked by uid 500); 7 Feb 2020 23:25:20 -0000 Mailing-List: contact commits-help@pinot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pinot.apache.org Delivered-To: mailing list commits@pinot.apache.org Received: (qmail 26719 invoked by uid 99); 7 Feb 2020 23:25:20 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Feb 2020 23:25:20 +0000 From: GitBox To: commits@pinot.apache.org Subject: [GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5046: Re-design the broker routing Message-ID: <158111792036.11447.7490664825656247215.gitbox@gitbox.apache.org> References: In-Reply-To: Date: Fri, 07 Feb 2020 23:25:20 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Jackie-Jiang commented on a change in pull request #5046: Re-design the broker routing URL: https://github.com/apache/incubator-pinot/pull/5046#discussion_r376653745 ########## File path: pinot-broker/src/main/java/org/apache/pinot/broker/routing/v2/instanceselector/InstanceSelector.java ########## @@ -0,0 +1,56 @@ +/** + * 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.instanceselector; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.apache.helix.model.ExternalView; +import org.apache.pinot.common.request.BrokerRequest; + + +/** + * The instance selector selects server instances to serve the query based on the selected segments. + */ +public interface InstanceSelector { + + /** + * Initializes the instance selector with the enabled instances, external view and online segments (segments with + * ONLINE/CONSUMING instances in ideal state). Should be called only once before calling other methods. + */ + void init(Set enabledInstances, ExternalView externalView, Set onlineSegments); + + /** + * Processes the instances change. Changed instances are pre-computed based on the current and previous enabled + * instances only once on the caller side and passed to all the instance selectors. + */ + void onInstancesChange(Set enabledInstances, List changedInstances); + + /** + * Processes the external view change based on the given online segments (segments with ONLINE/CONSUMING instances in + * ideal state). + */ + void onExternalViewChange(ExternalView externalView, Set onlineSegments); Review comment: It won't be null if it is not annotated as nullable. We don't use it right now, but maybe useful for future implementations. Added some description ---------------------------------------------------------------- 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