hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guanghao Zhang (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-16910) Avoid NPE when start StochasticLoadBalancer
Date Fri, 21 Oct 2016 08:19:58 GMT

     [ https://issues.apache.org/jira/browse/HBASE-16910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Guanghao Zhang updated HBASE-16910:
-----------------------------------
    Description: 
When master start, it initialize StochasticLoadBalancer.
{code}
this.balancer.setClusterStatus(getClusterStatus());
this.balancer.setMasterServices(this);
{code}

It first setClusterStatus(), then setMasterService(). But in setClusterStatus method, it use
master service which is not initialized. So it will throw NPE.
{code}
int tablesCount = isByTable ? services.getTableDescriptors().getAll().size() : 1;
{code}
It happens when set isByTable is ture.

  was:
When master start, it initialize StochasticLoadBalancer.
{code}
this.balancer.setClusterStatus(getClusterStatus());
this.balancer.setMasterServices(this);
{code}

It first setClusterStatus(), then setMasterService(). But in setClusterStatus method, it use
master service which is not initialized. So it will throw NPE.
```
int tablesCount = isByTable ? services.getTableDescriptors().getAll().size() : 1;
```
It happens when set isByTable is ture.


> Avoid NPE when start StochasticLoadBalancer
> -------------------------------------------
>
>                 Key: HBASE-16910
>                 URL: https://issues.apache.org/jira/browse/HBASE-16910
>             Project: HBase
>          Issue Type: Bug
>          Components: Balancer
>    Affects Versions: 2.0.0
>            Reporter: Guanghao Zhang
>            Priority: Minor
>
> When master start, it initialize StochasticLoadBalancer.
> {code}
> this.balancer.setClusterStatus(getClusterStatus());
> this.balancer.setMasterServices(this);
> {code}
> It first setClusterStatus(), then setMasterService(). But in setClusterStatus method,
it use master service which is not initialized. So it will throw NPE.
> {code}
> int tablesCount = isByTable ? services.getTableDescriptors().getAll().size() : 1;
> {code}
> It happens when set isByTable is ture.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message