MAPREDUCE-7409. Make shuffle key length configurable. Contributed by Ashutosh Gupta.
This commit is contained in:
parent
c69e16b297
commit
84081a8cae
@ -71,7 +71,6 @@ class JobSubmitter {
|
|||||||
protected static final Logger LOG =
|
protected static final Logger LOG =
|
||||||
LoggerFactory.getLogger(JobSubmitter.class);
|
LoggerFactory.getLogger(JobSubmitter.class);
|
||||||
private static final String SHUFFLE_KEYGEN_ALGORITHM = "HmacSHA1";
|
private static final String SHUFFLE_KEYGEN_ALGORITHM = "HmacSHA1";
|
||||||
private static final int SHUFFLE_KEY_LENGTH = 64;
|
|
||||||
private FileSystem jtFs;
|
private FileSystem jtFs;
|
||||||
private ClientProtocol submitClient;
|
private ClientProtocol submitClient;
|
||||||
private String submitHostName;
|
private String submitHostName;
|
||||||
@ -177,7 +176,9 @@ JobStatus submitJobInternal(Job job, Cluster cluster)
|
|||||||
KeyGenerator keyGen;
|
KeyGenerator keyGen;
|
||||||
try {
|
try {
|
||||||
keyGen = KeyGenerator.getInstance(SHUFFLE_KEYGEN_ALGORITHM);
|
keyGen = KeyGenerator.getInstance(SHUFFLE_KEYGEN_ALGORITHM);
|
||||||
keyGen.init(SHUFFLE_KEY_LENGTH);
|
int shuffleKeyLength =
|
||||||
|
conf.getInt(MRJobConfig.SHUFFLE_KEY_LENGTH, MRJobConfig.DEFAULT_SHUFFLE_KEY_LENGTH);
|
||||||
|
keyGen.init(shuffleKeyLength);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
throw new IOException("Error generating shuffle secret key", e);
|
throw new IOException("Error generating shuffle secret key", e);
|
||||||
}
|
}
|
||||||
|
@ -1302,4 +1302,6 @@ public interface MRJobConfig {
|
|||||||
*/
|
*/
|
||||||
@Unstable
|
@Unstable
|
||||||
String INPUT_FILE_MANDATORY_PREFIX = "mapreduce.job.input.file.must.";
|
String INPUT_FILE_MANDATORY_PREFIX = "mapreduce.job.input.file.must.";
|
||||||
|
String SHUFFLE_KEY_LENGTH = "mapreduce.shuffle-key-length";
|
||||||
|
int DEFAULT_SHUFFLE_KEY_LENGTH = 64;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user