Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-1246

HBaseImportJob should add job authtoken only if HBase is secured

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.4
    • Fix Version/s: 1.4.5
    • Component/s: hbase-integration
    • Labels:
      None

      Description

      Sqoop's HBase import job incorrectly checks if Hadoop is secured instead of HBase is secured before deciding to add an HBase authtoken,

      HBaseImportJob.java
        @Override
        /** Create the target HBase table before running the job. */
        protected void jobSetup(Job job) throws IOException, ImportException {
      ...
            // Get method isSecurityEnabled
            Method isSecurityEnabled = User.class.getMethod("isSecurityEnabled");
      ...
            // Obtain security token if needed
            if ((Boolean)isSecurityEnabled.invoke(null)) {
              obtainAuthTokenForJob.invoke(user, conf, job);
            }
      

      which of course fails if Hadoop is secured but HBase is not.

      1. SQOOP-1246.patch
        1 kB
        Aditya Kishore
      2. SQOOP-1246_v2.patch
        1 kB
        Aditya Kishore

        Activity

        Hide
        adityakishore Aditya Kishore added a comment -

        Attached patch calls "isHBaseSecurityEnabled" to determine if HBase security is on.

        Show
        adityakishore Aditya Kishore added a comment - Attached patch calls "isHBaseSecurityEnabled" to determine if HBase security is on.
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Good catch Aditya Kishore, would you mind also renaming the variable name to be equal to the method name?

        Show
        jarcec Jarek Jarcec Cecho added a comment - Good catch Aditya Kishore , would you mind also renaming the variable name to be equal to the method name?
        Hide
        abec Abraham Elmahrek added a comment -

        You may need to catch NoSuchMethodException exceptions and fallback to the void argument list for that method. It looks like 0.94, which sqoop is currently supporting, didn't supply an isSecurityEnabled method that takes a Configuration object. I'm looking at https://github.com/apache/hbase/blob/0.94/src/main/java/org/apache/hadoop/hbase/security/User.java. Please correct me If I am wrong.

        Show
        abec Abraham Elmahrek added a comment - You may need to catch NoSuchMethodException exceptions and fallback to the void argument list for that method. It looks like 0.94, which sqoop is currently supporting, didn't supply an isSecurityEnabled method that takes a Configuration object. I'm looking at https://github.com/apache/hbase/blob/0.94/src/main/java/org/apache/hadoop/hbase/security/User.java . Please correct me If I am wrong.
        Hide
        abec Abraham Elmahrek added a comment -

        Nvm. isHBaseSecurityEnabled .

        Show
        abec Abraham Elmahrek added a comment - Nvm. isHBaseSecurityEnabled .
        Hide
        adityakishore Aditya Kishore added a comment -

        Thanks for the review Jarek, Abraham!

        Jarek, Attached is the revised patch with variable renamed.

        Abraham, I guess you have already noticed that the isHBaseSecurityEnabled() is available in HBase since 0.92.0.

        Show
        adityakishore Aditya Kishore added a comment - Thanks for the review Jarek, Abraham! Jarek, Attached is the revised patch with variable renamed. Abraham, I guess you have already noticed that the isHBaseSecurityEnabled() is available in HBase since 0.92.0.
        Hide
        abec Abraham Elmahrek added a comment -

        +1 from me!

        Show
        abec Abraham Elmahrek added a comment - +1 from me!
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit e98075976bf53d3e13fa31047b7274b899b37ae5 in branch refs/heads/trunk from Jarek Jarcec Cecho
        [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=e980759 ]

        SQOOP-1246: HBaseImportJob should add job authtoken only if HBase is secured

        (Aditya Kishore via Jarek Jarcec Cecho)

        Show
        jira-bot ASF subversion and git services added a comment - Commit e98075976bf53d3e13fa31047b7274b899b37ae5 in branch refs/heads/trunk from Jarek Jarcec Cecho [ https://git-wip-us.apache.org/repos/asf?p=sqoop.git;h=e980759 ] SQOOP-1246 : HBaseImportJob should add job authtoken only if HBase is secured (Aditya Kishore via Jarek Jarcec Cecho)
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Thank you Aditya Kishore for your contribution and Abraham Elmahrek for the review!

        Show
        jarcec Jarek Jarcec Cecho added a comment - Thank you Aditya Kishore for your contribution and Abraham Elmahrek for the review!
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1065 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1065/)
        SQOOP-1246: HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5)

        • src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop23 #1065 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/1065/ ) SQOOP-1246 : HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5 ) src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #863 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/863/)
        SQOOP-1246: HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5)

        • src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop20 #863 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/863/ ) SQOOP-1246 : HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5 ) src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #828 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/828/)
        SQOOP-1246: HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5)

        • src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop100 #828 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/828/ ) SQOOP-1246 : HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5 ) src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #869 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/869/)
        SQOOP-1246: HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5)

        • src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Sqoop-ant-jdk-1.6-hadoop200 #869 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/869/ ) SQOOP-1246 : HBaseImportJob should add job authtoken only if HBase is secured (jarcec: https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=e98075976bf53d3e13fa31047b7274b899b37ae5 ) src/java/org/apache/sqoop/mapreduce/HBaseImportJob.java
        Show
        in-chief Xiaoshuang LU added a comment - SEE ALSO https://issues.apache.org/jira/browse/SQOOP-599 .

          People

          • Assignee:
            adityakishore Aditya Kishore
            Reporter:
            adityakishore Aditya Kishore
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development