Skip to content

Instantly share code, notes, and snippets.

@AzimUddin
Last active August 29, 2015 13:56
Show Gist options
  • Save AzimUddin/8981045 to your computer and use it in GitHub Desktop.
Save AzimUddin/8981045 to your computer and use it in GitHub Desktop.
Hadoop job configurations via HDInsight .Net SDK
var mapReduceJob = new MapReduceJobCreateParameters()
{
ClassName = "wordcount", // required
JobName = "MyWordCountJob", //optional
JarFile = "/example/jars/hadoop-examples.jar", // Required, alternative syntax: wasb://hdijobs@azimasv2.blob.core.windows.net/example/jar/hadoop-examples.jar
StatusFolder = "/AzimMRJobs/WordCountJobStatus" //Optional, but good to use to know where logs are uploaded in Azure Storage
};
//WordCount progam needs two arguments
mapReduceJob.Arguments.Add("/example/data/gutenberg/davinci.txt"); //input file
mapReduceJob.Arguments.Add("/AzimMRJobs/WordCountOutput"); //Job output location
//example of hadoop job configurations
mapReduceJob.Defines.Add("mapred.reduce.tasks", "2");
mapReduceJob.Defines.Add("mapred.output.compress", "true");
mapReduceJob.Defines.Add("mapred.output.compression.codec", "org.apache.hadoop.io.compress.GzipCodec");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment