Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4C4E10A02 for ; Mon, 29 Dec 2014 17:29:13 +0000 (UTC) Received: (qmail 37782 invoked by uid 500); 29 Dec 2014 17:29:14 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 37726 invoked by uid 500); 29 Dec 2014 17:29:14 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 37714 invoked by uid 99); 29 Dec 2014 17:29:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2014 17:29:14 +0000 Date: Mon, 29 Dec 2014 17:29:14 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260245#comment-14260245 ] Hudson commented on HBASE-12762: -------------------------------- SUCCESS: Integrated in HBase-TRUNK #5971 (See [https://builds.apache.org/job/HBase-TRUNK/5971/]) HBASE-12762 Region with no hfiles will have the highest locality cost in LocalityCostFunction (cuijianwei) (stack: rev 8dac7f9e6c5c22e3d11d22f6a38b7fa9905c6ae8) * hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java > Region with no hfiles will have the highest locality cost in LocalityCostFunction > --------------------------------------------------------------------------------- > > Key: HBASE-12762 > URL: https://issues.apache.org/jira/browse/HBASE-12762 > Project: HBase > Issue Type: Improvement > Components: Balancer > Affects Versions: 0.99.2 > Reporter: cuijianwei > Assignee: cuijianwei > Priority: Minor > Fix For: 1.0.0, 2.0.0, 0.98.10, 1.1.0 > > Attachments: HBASE-12762-trunk.patch > > > The locality cost of region will be computed in LocalityCostFunction.cost as: > {code} > double cost() { > ... > int index = -1; > for (int j = 0; j < regionLocations.length; j++) { > if (regionLocations[j] >= 0 && regionLocations[j] == serverIndex) { > index = j; > break; > } > } > if (index < 0) { > cost += 1; // ==> region with no hfiles will have the highest cost > } else { > cost += (double) index / (double) regionLocations.length; > } > ... > } > {code} > The region with no hfiles(such as empty region) will have the highest cost which represents the worst case that region located in the server with no locality for hfiles. However, this might be the best case because there are no hlogs for the region. Although the absolute cost value won't affect the balance process, will it be more reasonable to have zero cost for such regions? such as: > {code} > ... > if (index < 0) { > if (regionLocation.length > 0) { // ==> only consider regions with hfiles > cost += 1; > } > } else { > cost += (double) index / (double) regionLocations.length; > } > ... > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)