From commits-return-7166-archive-asf-public=cust-asf.ponee.io@helix.apache.org Thu Mar 22 17:57:07 2018 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 [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 431E618067E for ; Thu, 22 Mar 2018 17:57:07 +0100 (CET) Received: (qmail 6600 invoked by uid 500); 22 Mar 2018 16:57:06 -0000 Mailing-List: contact commits-help@helix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@helix.apache.org Delivered-To: mailing list commits@helix.apache.org Received: (qmail 6591 invoked by uid 99); 22 Mar 2018 16:57:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2018 16:57:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id D8150C00D6 for ; Thu, 22 Mar 2018 16:57:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id mKQyrSySkG5K for ; Thu, 22 Mar 2018 16:57:04 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id A9B5D5F6BE for ; Thu, 22 Mar 2018 16:57:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0F935E0D93 for ; Thu, 22 Mar 2018 16:57:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 5CAB4214DF for ; Thu, 22 Mar 2018 16:57:00 +0000 (UTC) Date: Thu, 22 Mar 2018 16:57:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@helix.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HELIX-674) Constraint Based Resource Rebalancer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HELIX-674?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16409= 890#comment-16409890 ]=20 ASF GitHub Bot commented on HELIX-674: -------------------------------------- Github user mcvsubbu commented on a diff in the pull request: https://github.com/apache/helix/pull/145#discussion_r176490613 =20 --- Diff: helix-core/src/main/java/org/apache/helix/api/rebalancer/cons= traint/dataprovider/CapacityProvider.java --- @@ -0,0 +1,48 @@ +package org.apache.helix.api.rebalancer.constraint.dataprovider; + +/* + * 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. + */ + +/** + * An interface for getting participant capacity information. + * The return value will be used to estimate available capacity, as we= ll as utilization in percentage for prioritizing participants. + * + * Note that all return values of the provider are supposed to be in t= he same unit. + * For example, if the provider is for memory capacity of a host (tota= l memory size is 8G, current usage is 512MB), + * the return values could be {@link org.apache.helix.api.rebalancer.c= onstraint.dataprovider.CapacityProvider#getParticipantCapacity(String)} =3D= 8192, and {@link org.apache.helix.api.rebalancer.constraint.dataprovider.C= apacityProvider#getParticipantUsage(String)} =3D 512. + * Another example, if the provider is for partition count capacity (m= ax count 1000 partitions, currently no partition assigned), + * the return values should be {@link org.apache.helix.api.rebalancer.= constraint.dataprovider.CapacityProvider#getParticipantCapacity(String)} = =3D 1000, and {@link org.apache.helix.api.rebalancer.constraint.dataprovide= r.CapacityProvider#getParticipantUsage(String)} =3D 0. + * + * Moreover, while this provider is used together with a {@link org.ap= ache.helix.api.rebalancer.constraint.dataprovider.PartitionWeightProvider P= artitionWeightProvider}, + * both providers are supposed to return values in the same unit so th= ey can be used to estimate the resource usage of an proposed assignment. + */ +public interface CapacityProvider { + + /** + * @param participant + * @return The total participant capacity. + */ + int getParticipantCapacity(String participant); + + /** + * @param participant + * @return The participant usage (provisioned capacity). --- End diff -- =20 The comment "(provisioned capacity)" is confusing. Can we remove it? > Constraint Based Resource Rebalancer > ------------------------------------ > > Key: HELIX-674 > URL: https://issues.apache.org/jira/browse/HELIX-674 > Project: Apache Helix > Issue Type: New Feature > Reporter: Jiajun Wang > Assignee: Jiajun Wang > Priority: Major > Fix For: 0.8.x > > Attachments: Constraint-BasedResourceRebalancing-080318-2226-240.= pdf > > > Helix rebalancer assigns resources according to different strategies. Rec= ently, we optimize the strategy for evenness and minimize movement. However= , the evenness here only applies to partition numbers. Moreover,=C2=A0we've= got more requests for customizable rebalancer=C2=A0from our users. > Take partition weight as an example: > In reality, partition replicas have different size. We use "partition wei= ght" as an abstraction of the partition size. It can be network traffic usa= ge, disk usage, or any other combined factors. > Given each partition may have different weights, Helix should be able to = assign partition accordingly. So that the distribution would be even regard= ing the weight. > In this project, we=C2=A0are planning new rebalancer=C2=A0mechanism that = generates resource partition assignment according to=C2=A0a list of "constr= aints". Current rebalance strategy can be regarded as one kind of constrain= t. Moving forward, Helix users would be able to extend the constraint inter= face using their own logic. > Some init discussions are in progress and we will have a proposal posted = here soon. -- This message was sent by Atlassian JIRA (v7.6.3#76005)