You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Jie Huang (JIRA)" <ji...@apache.org> on 2012/07/27 03:10:35 UTC

[jira] [Commented] (HBASE-6464) reportTableInFlux() throws NPE when no table is returned.

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

Jie Huang commented on HBASE-6464:
----------------------------------

See the code implementation
{code}
 private void reportTablesInFlux() {
    AtomicInteger numSkipped = new AtomicInteger(0);
    HTableDescriptor[] allTables = getTables(numSkipped); // <<<< allTables == null
    errors.print("Number of Tables: " + allTables.length); // <<<< Null pointer exception here
{code}
We'd better to check if (allTables == null)  to avoid that NPE.
                
> reportTableInFlux() throws NPE when no table is returned.
> ---------------------------------------------------------
>
>                 Key: HBASE-6464
>                 URL: https://issues.apache.org/jira/browse/HBASE-6464
>             Project: HBase
>          Issue Type: Bug
>          Components: hbck
>    Affects Versions: 0.94.0, 0.96.0
>            Reporter: Jie Huang
>            Priority: Critical
>
> reportTableInFlux() gets all tables not in flux. However, when no table is found in getTable(numSkipped) function, it will return null. Then, errorReporter attempts to print the table number, which causes a NPE here.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira