[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-30 Thread Andrew Purtell (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14261315#comment-14261315
 ] 

Andrew Purtell commented on HBASE-12762:


Thanks. I see later builds passed. I'll follow up on test port randomization. 

> 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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-30 Thread stack (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14261228#comment-14261228
 ] 

stack commented on HBASE-12762:
---

[~apurtell] I took a look and saw this:

14/12/30 07:49:47 INFO mortbay.log: Extract 
jar:file:/home/jenkins/jenkins-slave/workspace/HBase-0.98-on-Hadoop-1.1/hbase-server/target/hbase-server-0.98.10-SNAPSHOT.jar!/hbase-webapps/regionserver
 to /tmp/Jetty_0_0_0_0_38973_regionserver6v0l18/webapp
14/12/30 07:49:47 INFO mortbay.log: Started SelectChannelConnector@0.0.0.0:38973
14/12/30 07:49:47 INFO http.HttpServer: Added global filtersafety 
(class=org.apache.hadoop.http.HttpServer$QuotingInputFilter)
14/12/30 07:49:47 INFO http.HttpServer: Port returned by 
webServer.getConnectors()[0].getLocalPort() before open() is -1. Opening the 
listener on 60010
14/12/30 07:49:47 FATAL master.HMaster: Unhandled exception. Starting shutdown.
java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at 
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:124)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at 
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:216)
at org.apache.hadoop.http.HttpServer.start(HttpServer.java:602)
at org.apache.hadoop.hbase.master.HMaster.run(HMaster.java:666)
at java.lang.Thread.run(Thread.java:662)


And it just passed. Let me try it again to see if permanent failing going on.

> 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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-30 Thread Andrew Purtell (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260902#comment-14260902
 ] 

Andrew Purtell commented on HBASE-12762:


My mistake, please pardon, fix version is fine, it's (phone) operator error on 
my part. Test issue is real though. :-)

> 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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-29 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260318#comment-14260318
 ] 

Hudson commented on HBASE-12762:


FAILURE: Integrated in HBase-0.98-on-Hadoop-1.1 #728 (See 
[https://builds.apache.org/job/HBase-0.98-on-Hadoop-1.1/728/])
HBASE-12762 Region with no hfiles will have the highest locality cost in 
LocalityCostFunction (cuijianwei) (stack: rev 
46f6ae85cb3f1bfd4230f8f8c366979337d5c842)
* 
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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-29 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260295#comment-14260295
 ] 

Hudson commented on HBASE-12762:


SUCCESS: Integrated in HBase-0.98 #762 (See 
[https://builds.apache.org/job/HBase-0.98/762/])
HBASE-12762 Region with no hfiles will have the highest locality cost in 
LocalityCostFunction (cuijianwei) (stack: rev 
46f6ae85cb3f1bfd4230f8f8c366979337d5c842)
* 
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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-29 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260274#comment-14260274
 ] 

Hudson commented on HBASE-12762:


SUCCESS: Integrated in HBase-1.0 #617 (See 
[https://builds.apache.org/job/HBase-1.0/617/])
HBASE-12762 Region with no hfiles will have the highest locality cost in 
LocalityCostFunction (cuijianwei) (stack: rev 
bd01581246e4a13169b2b79ba7e9be695971a100)
* 
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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-29 Thread Hudson (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14260262#comment-14260262
 ] 

Hudson commented on HBASE-12762:


SUCCESS: Integrated in HBase-1.1 #30 (See 
[https://builds.apache.org/job/HBase-1.1/30/])
HBASE-12762 Region with no hfiles will have the highest locality cost in 
LocalityCostFunction (cuijianwei) (stack: rev 
0e39b8b9f78b0a660bf041192eb7b0cecc8da444)
* 
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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-29 Thread Hudson (JIRA)

[ 
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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-28 Thread Hadoop QA (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14259908#comment-14259908
 ] 

Hadoop QA commented on HBASE-12762:
---

{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  
http://issues.apache.org/jira/secure/attachment/12689278/HBASE-12762-trunk.patch
  against master branch at commit fbdaf62bf837abd74eca8b13e8786051ed4df38a.
  ATTACHMENT ID: 12689278

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:red}-1 tests included{color}.  The patch doesn't appear to include 
any new or modified tests.
Please justify why no new tests are needed for this 
patch.
Also please list what manual steps were performed to 
verify this patch.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:green}+1 javadoc{color}.  The javadoc tool did not generate any 
warning messages.

{color:green}+1 checkstyle{color}.  The applied patch does not increase the 
total number of checkstyle errors

{color:green}+1 findbugs{color}.  The patch does not introduce any new 
Findbugs (version 2.0.3) warnings.

{color:green}+1 release audit{color}.  The applied patch does not increase 
the total number of release audit warnings.

{color:green}+1 lineLengths{color}.  The patch does not introduce lines 
longer than 100

  {color:green}+1 site{color}.  The mvn site goal succeeds with this patch.

{color:green}+1 core tests{color}.  The patch passed unit tests in .

Test results: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-prefix-tree.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-examples.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-server.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-common.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-rest.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-protocol.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-client.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-thrift.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/newPatchFindbugsWarningshbase-annotations.html
Checkstyle Errors: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//artifact/patchprocess/checkstyle-aggregate.html

  Console output: 
https://builds.apache.org/job/PreCommit-HBASE-Build/12241//console

This message is automatically generated.

> 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
> 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 

[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-28 Thread Elliott Clark (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14259820#comment-14259820
 ] 

Elliott Clark commented on HBASE-12762:
---

+1 looks good to me if jenkins is happy with it.

> 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
>Priority: Minor
> 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)


[jira] [Commented] (HBASE-12762) Region with no hfiles will have the highest locality cost in LocalityCostFunction

2014-12-27 Thread stack (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-12762?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14259423#comment-14259423
 ] 

stack commented on HBASE-12762:
---

[~cuijianwei] Thanks. Good one.  You might have a patch?  [~eclark], check out 
this one.

> 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
>Priority: Minor
>
> 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)