You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-dev@hadoop.apache.org by "Harsh J (Created) (JIRA)" <ji...@apache.org> on 2011/10/28 12:56:32 UTC

[jira] [Created] (MAPREDUCE-3302) Remove the last dependency call from org.apache.hadoop.record package in MR.

Remove the last dependency call from org.apache.hadoop.record package in MR.
----------------------------------------------------------------------------

                 Key: MAPREDUCE-3302
                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-3302
             Project: Hadoop Map/Reduce
          Issue Type: Task
          Components: client
    Affects Versions: 0.24.0
            Reporter: Harsh J
            Assignee: Harsh J
            Priority: Minor
             Fix For: 0.24.0


SecureShuffleUtils provides the following helper:

{code}
  /**
   * verify that hash equals to HMacHash(msg)
   * @param newHash
   * @return true if is the same
   */
  private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) {
    byte[] msg_hash = generateByteHash(msg, key);
    return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0;
  }
{code}

The {{Utils}} class used there is {{org.apache.hadoop.record.Utils}}. With the {{record}} common package going away via HADOOP-7781, the internal (and also deprecated on the whole) {{compareBytes}} utility must be moved elsewhere.

The {{Utils#compareBytes}} contains:

{code}
/** Lexicographic order of binary data. */
  public static int compareBytes(byte[] b1, int s1, int l1,
                                 byte[] b2, int s2, int l2) {
    return WritableComparator.compareBytes(b1, s1, l1, b2, s2, l2);
  }
{code}

Which looks like it can be replaced inline, as it appears to be a dummy wrapper call. I'll put up a patch with this inline replacement shortly for review.

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

        

[jira] [Reopened] (MAPREDUCE-3302) Remove the last dependency call from org.apache.hadoop.record package in MR.

Posted by "Harsh J (Reopened) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-3302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harsh J reopened MAPREDUCE-3302:
--------------------------------


Actually, this can and should go in anyway. Its the only one using the wrong API.
                
> Remove the last dependency call from org.apache.hadoop.record package in MR.
> ----------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-3302
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-3302
>             Project: Hadoop Map/Reduce
>          Issue Type: Task
>          Components: client
>    Affects Versions: 0.24.0
>            Reporter: Harsh J
>            Assignee: Harsh J
>            Priority: Minor
>             Fix For: 0.24.0
>
>         Attachments: MAPREDUCE-3302.patch
>
>
> SecureShuffleUtils provides the following helper:
> {code}
>   /**
>    * verify that hash equals to HMacHash(msg)
>    * @param newHash
>    * @return true if is the same
>    */
>   private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) {
>     byte[] msg_hash = generateByteHash(msg, key);
>     return Utils.compareBytes(msg_hash, 0, msg_hash.length, hash, 0, hash.length) == 0;
>   }
> {code}
> The {{Utils}} class used there is {{org.apache.hadoop.record.Utils}}. With the {{record}} common package going away via HADOOP-7781, the internal (and also deprecated on the whole) {{compareBytes}} utility must be moved elsewhere.
> The {{Utils#compareBytes}} contains:
> {code}
> /** Lexicographic order of binary data. */
>   public static int compareBytes(byte[] b1, int s1, int l1,
>                                  byte[] b2, int s2, int l2) {
>     return WritableComparator.compareBytes(b1, s1, l1, b2, s2, l2);
>   }
> {code}
> Which looks like it can be replaced inline, as it appears to be a dummy wrapper call. I'll put up a patch with this inline replacement shortly for review.

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