Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-1464

In JobTokenIdentifier change method getUsername to getUser which returns UGI

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The TokenIdentifier interface has changed in HADOOP-6510. This jira tracks corresponding change in MR. The only change is that in JobTokenIdentifier getUsername method will be changed to getUser that will return ugi.

      1. MR-1464.1.patch
        0.9 kB
        Jitendra Nath Pandey

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          2d 3h 21m 1 Devaraj Das 08/Feb/10 05:08
          Resolved Resolved Closed Closed
          197d 16h 12m 1 Tom White 24/Aug/10 22:20
          Tom White made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Tom White made changes -
          Fix Version/s 0.21.0 [ 12314045 ]
          Fix Version/s 0.22.0 [ 12314184 ]
          Hide
          Kan Zhang added a comment -

          > UserGroupInformation.createRemoteUser throws IllegalArgumentException if null or empty user is passed to it.

          I think createRemoteUser() should be changed to allow an empty ugi to be created. This will save the null checking at the caller and allow method chaining. Any code that uses ugi (like the authorize() method) should be able to deal with an empty ugi.

          > In HADOOP-6510 getUser() is used. It cannot return null if the user is successfully authorized. Any calls to getUser before the authorization is successful should check for null.

          I'm not aware that the SASL layer requires username (i.e., jobId) being non-empty. We're making a runtime assumption that jobId's won't be empty String or they won't authenticate successfully. In my view, the less such assumptions we make, the more robust the code is.

          Show
          Kan Zhang added a comment - > UserGroupInformation.createRemoteUser throws IllegalArgumentException if null or empty user is passed to it. I think createRemoteUser() should be changed to allow an empty ugi to be created. This will save the null checking at the caller and allow method chaining. Any code that uses ugi (like the authorize() method) should be able to deal with an empty ugi. > In HADOOP-6510 getUser() is used. It cannot return null if the user is successfully authorized. Any calls to getUser before the authorization is successful should check for null. I'm not aware that the SASL layer requires username (i.e., jobId) being non-empty. We're making a runtime assumption that jobId's won't be empty String or they won't authenticate successfully. In my view, the less such assumptions we make, the more robust the code is.
          Hide
          Hudson added a comment -

          Integrated in Hadoop-Mapreduce-trunk-Commit #229 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Mapreduce-trunk-Commit/229/)
          . Makes a compatible change in JobTokenIdentifier to account for HADOOP-6510. Contributed by Jitendra Nath Pandey.

          Show
          Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #229 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Mapreduce-trunk-Commit/229/ ) . Makes a compatible change in JobTokenIdentifier to account for HADOOP-6510 . Contributed by Jitendra Nath Pandey.
          Devaraj Das made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Hadoop Flags [Reviewed]
          Assignee Jitendra Nath Pandey [ jnp ]
          Fix Version/s 0.22.0 [ 12314184 ]
          Resolution Fixed [ 1 ]
          Hide
          Devaraj Das added a comment -

          I just committed this. Thanks, Jitendra!

          Show
          Devaraj Das added a comment - I just committed this. Thanks, Jitendra!
          Hide
          Jitendra Nath Pandey added a comment -

          tests, javac, javadoc and findbugs for this patch were run manually.

          Show
          Jitendra Nath Pandey added a comment - tests, javac, javadoc and findbugs for this patch were run manually.
          Hide
          Devaraj Das added a comment -

          +1

          Show
          Devaraj Das added a comment - +1
          Hide
          Jitendra Nath Pandey added a comment -

          In HADOOP-6510 getUser() is used. It cannot return null if the user is successfully authorized. Any calls to getUser before the authorization is successful should check for null. Updated the patch in HADOOP-6510 to handle null returned by getUser before authorization is successful.

          Show
          Jitendra Nath Pandey added a comment - In HADOOP-6510 getUser() is used. It cannot return null if the user is successfully authorized. Any calls to getUser before the authorization is successful should check for null. Updated the patch in HADOOP-6510 to handle null returned by getUser before authorization is successful.
          Hide
          Jitendra Nath Pandey added a comment -

          UserGroupInformation.createRemoteUser throws IllegalArgumentException if null or empty user is passed to it. Therefore UGI with empty user cannot be constructed.

          I need to revisit HADOOP-6510 patch for the possibility of null returned by getUser()

          Show
          Jitendra Nath Pandey added a comment - UserGroupInformation.createRemoteUser throws IllegalArgumentException if null or empty user is passed to it. Therefore UGI with empty user cannot be constructed. I need to revisit HADOOP-6510 patch for the possibility of null returned by getUser()
          Hide
          Kan Zhang added a comment -

          I looked at the patch again and found that there is no null checking at the caller (per your HADOOP-6510.21.patch). I suggestion you return an empty ugi instead of null for getUser() method (do the same in HDFS-935) to reduce the chance of NullPointerException at runtime.

          Show
          Kan Zhang added a comment - I looked at the patch again and found that there is no null checking at the caller (per your HADOOP-6510 .21.patch). I suggestion you return an empty ugi instead of null for getUser() method (do the same in HDFS-935 ) to reduce the chance of NullPointerException at runtime.
          Hide
          Kan Zhang added a comment -

          Btw, it would be good if you add a JavaDoc saying this method may return null.

          Show
          Kan Zhang added a comment - Btw, it would be good if you add a JavaDoc saying this method may return null.
          Hide
          Kan Zhang added a comment -

          +1, pending hudson.

          Show
          Kan Zhang added a comment - +1, pending hudson.
          Jitendra Nath Pandey made changes -
          Attachment MR-1464.1.patch [ 12435053 ]
          Jitendra Nath Pandey made changes -
          Field Original Value New Value
          Link This issue is blocked by HADOOP-6510 [ HADOOP-6510 ]
          Jitendra Nath Pandey created issue -

            People

            • Assignee:
              Jitendra Nath Pandey
              Reporter:
              Jitendra Nath Pandey
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development