You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Liyin Tang (JIRA)" <ji...@apache.org> on 2012/11/06 23:20:12 UTC

[jira] [Created] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Liyin Tang created HBASE-7106:
---------------------------------

             Summary: [89-fb] Fix the NPE in unit tests for JDK7
                 Key: HBASE-7106
                 URL: https://issues.apache.org/jira/browse/HBASE-7106
             Project: HBase
          Issue Type: Improvement
            Reporter: Liyin Tang
            Priority: Trivial


In JDK7, it will throw out NPE if put a NULL into a TreeSet. So the easy fix is to skip putting the NULL qualifier into the family map for the GET and SCAN objects, and everything else shall be backward compatible.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Gustavo Anatoly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13499476#comment-13499476 ] 

Gustavo Anatoly commented on HBASE-7106:
----------------------------------------

Hi, Liyin.

About this issue, Jimmy Xiang fixed null qualifier [HBASE-7130|https://issues.apache.org/jira/browse/HBASE-7130], and the jdk7 profile on maven is opened yet to be implemented?
                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Jimmy Xiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493471#comment-13493471 ] 

Jimmy Xiang commented on HBASE-7106:
------------------------------------

Liyin, you are right. I will fix that (in trunk). I filed HBASE-7130.
                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Liyin Tang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493478#comment-13493478 ] 

Liyin Tang commented on HBASE-7106:
-----------------------------------

Gustavo Anatoly, sure ! 
                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Gustavo Anatoly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493176#comment-13493176 ] 

Gustavo Anatoly commented on HBASE-7106:
----------------------------------------

Hi, Liyin.

I understood your idea, but I'm confused how to replace NULL qualifier when [ -Pjdk7 ] profile is executed. I did think if when running profile we would have a separted package with specific test to JDK 7, using HConstants.EMPTY_BYTE_ARRAY.

Could you explain me, please?

                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Liyin Tang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493401#comment-13493401 ] 

Liyin Tang commented on HBASE-7106:
-----------------------------------

Gustavo Anatoly: I didn't fully understand your questions :) The pom change is orthogonal with the code change.

Jimmy, The semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier. 
However, the fix in HBASE-6206 will skip the NULL qualifier.
-    set.add(qualifier);
+    if (qualifier != null) {
+      set.add(qualifier);
+    }

=========
I think the correct fix shall be:

if (qualifier != null) {
  set.add(qualifier);
} else {
  set.add(HConstants.EMPTY_BYTE_ARRAY);
}
                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Liyin Tang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liyin Tang updated HBASE-7106:
------------------------------

    Description: 
In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
So we shall do the followings: 

1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.

2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.

3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
eg: mvn test -Dtest=TestFromClientSide -Pjdk7

  was:
In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
So we shall do the followings: 

1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.

2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.

3) Add a jdk option in the pom.xml (Assuming user install the fb packaged jdk)
eg: mvn test -Dtest=TestFromClientSide -Pjdk7

    
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Jimmy Xiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493323#comment-13493323 ] 

Jimmy Xiang commented on HBASE-7106:
------------------------------------

I have some fix in HBASE-6206.
                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Liyin Tang (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liyin Tang updated HBASE-7106:
------------------------------

    Description: 
In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
So we shall do the followings: 

1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.

2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.

3) Add a jdk option in the pom.xml (Assuming user install the fb packaged jdk)
eg: mvn test -Dtest=TestFromClientSide -Pjdk7

  was:In JDK7, it will throw out NPE if put a NULL into a TreeSet. So the easy fix is to skip putting the NULL qualifier into the family map for the GET and SCAN objects, and everything else shall be backward compatible.

    
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user install the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-7106) [89-fb] Fix the NPE in unit tests for JDK7

Posted by "Gustavo Anatoly (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-7106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493468#comment-13493468 ] 

Gustavo Anatoly commented on HBASE-7106:
----------------------------------------

Hi, Liyin.

:) I understood changes using HConstants.EMPTY_BYTE_ARRAY, but I was understanding incorrect part of your explanation about the pom profile. 

Thanks.

Could I contribute with a patch for review?
                
> [89-fb] Fix the NPE in unit tests for JDK7
> ------------------------------------------
>
>                 Key: HBASE-7106
>                 URL: https://issues.apache.org/jira/browse/HBASE-7106
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Liyin Tang
>            Priority: Trivial
>
> In JDK7, it will throw out NPE if put a NULL into a TreeSet. And in the unit tests, user can add a NULL as qualifier into the family map for GET or SCAN. 
> So we shall do the followings: 
> 1) Make sure the semantics of NULL column qualifier is equal to that of the EMPYT_BYTE_ARRAY column qualifier.
> 2) An easy fix is to use the EMPYT_BYTE_ARRAY qualifier to replace NULL qualifier in the family map for the GET or SCAN objects, and everything else shall be backward compatible.
> 3) Add a jdk option in the pom.xml (Assuming user installed the fb packaged jdk)
> eg: mvn test -Dtest=TestFromClientSide -Pjdk7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira