diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index d6cf4423370..7d9dd5d21d2 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -136,6 +136,9 @@ Release 2.1.0-beta - UNRELEASED MAPREDUCE-5229. Put back FileOutputCommitter.TEMP_DIR_NAME in mapreduce for binary compatibility with 1.x APIs. (Zhijie Shen via vinodkv) + MAPREDUCE-5274. Bring back SecureShuffleUtils.toHex in mapreduce for binary + compatibility with 1.x APIs. (Mayank Bansal via vinodkv) + OPTIMIZATIONS MAPREDUCE-4974. Optimising the LineRecordReader initialize() method diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/SecureShuffleUtils.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/SecureShuffleUtils.java index 7ace34ad8a7..f7189cb317e 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/SecureShuffleUtils.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/security/SecureShuffleUtils.java @@ -132,4 +132,19 @@ public class SecureShuffleUtils { private static String buildMsgFrom(String uri_path, String uri_query, int port) { return String.valueOf(port) + uri_path + "?" + uri_query; } + + /** + * byte array to Hex String + * + * @param ba + * @return string with HEX value of the key + */ + public static String toHex(byte[] ba) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + PrintStream ps = new PrintStream(baos); + for (byte b : ba) { + ps.printf("%x", b); + } + return baos.toString(); + } }