Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.0.0-alpha1
-
None
Description
SecureShuffleUtils provides the following helper:
/** * 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; }
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:
/** 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); }
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.
Attachments
Attachments
Issue Links
- blocks
-
HADOOP-7781 Remove RecordIO
- Resolved