hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hsieh (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-5798) NPE running hbck on 0.94 out of reportTablesInFlux
Date Mon, 16 Apr 2012 17:54:17 GMT

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

Jonathan Hsieh commented on HBASE-5798:
---------------------------------------

I started a run of the unit test suite testing this fix -- for a method like this, I prefer
returning empty arrays instead of null arrays.

{code}
diff --git src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java src/main/java/org/apache/hadoop/hbase/cli
index ee16e72..44b7c11 100644
--- src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
+++ src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
@@ -1691,7 +1691,7 @@ public class HBaseAdmin implements Abortable, Closeable {
  /**
  * Get tableDescriptors
  * @param tableNames List of table names
- * @return HTD[] the tableDescriptor
+ * @return HTD[] the tableDescriptor (never null)
  * @throws IOException if a remote or network exception occurs
  */
   public HTableDescriptor[] getTableDescriptors(List<String> tableNames)
diff --git src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java src/main/java/org/apache/hadoop/h
index 820e2a9..f183b15 100644
--- src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
+++ src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
@@ -2195,7 +2195,7 @@ public class HConnectionManager {
 
     @Override
     public HTableDescriptor[] getHTableDescriptors(List<String> tableNames) throws
IOException {
-      if (tableNames == null || tableNames.isEmpty()) return null;
+      if (tableNames == null || tableNames.isEmpty()) return new HTableDescriptor[0];
       MasterKeepAliveConnection master = getKeepAliveMaster();
       try {
         return master.getHTableDescriptors(tableNames);
{code}
                
> NPE running hbck on 0.94 out of reportTablesInFlux
> --------------------------------------------------
>
>                 Key: HBASE-5798
>                 URL: https://issues.apache.org/jira/browse/HBASE-5798
>             Project: HBase
>          Issue Type: Bug
>            Reporter: stack
>            Assignee: Jonathan Hsieh
>
> Got this playing w/ hbck going against the 0.94RC:
> {code}
> 12/04/16 17:03:14 INFO util.HBaseFsck: getHTableDescriptors == tableNames => []
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hbase.util.HBaseFsck.reportTablesInFlux(HBaseFsck.java:553)
>         at org.apache.hadoop.hbase.util.HBaseFsck.onlineConsistencyRepair(HBaseFsck.java:344)
>         at org.apache.hadoop.hbase.util.HBaseFsck.onlineHbck(HBaseFsck.java:380)
>         at org.apache.hadoop.hbase.util.HBaseFsck.main(HBaseFsck.java:3033)
> {code}

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

        

Mime
View raw message