Get also mapreduce history service DelegationToken #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds DelegationToken for the MapReduce History Server when submitting a new application
My use case
I call skein from a periodic job written in python to archive some files in HDFS using hadoop archive. The goal is to reduce the number of files in HDFS.
I call from a Skein Service the hadoop command
hadoop archive
that launches a Map Reduce job that creates the archive.MapReduce jobs do some connections to the MapReduce History Server. It needs a delegation token to authenticate to this service. For this reason, I would like skein also to create a delegation token for this service.
Implementation details
The code is adapted from the hadoop mapreduce project. Unfortunately, I need some functions that are private. That's why I adapted the code in skein.
Original sourcefile: https://github.com/apache/hadoop/blob/branch-2.7.3/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java#L183
If the MapReduce History Server address is not present in the hadoop configuration files. The code does nothing.
How did I test it ?
I tested it by running a skein service that do a
subprocess.check_output
that triggers thehadoop archive
command.