Database Reference
In-Depth Information
Adding the References
Open the C# console application HadoopClient that you created in the previous chapter. Once the solution is opened,
open the NuGet Package Manager Console and import the MapReduce NuGet package by running the following
command:
install-package Microsoft.Hadoop.MapReduce
This should import the required .dll, along with any dependencies it may have. You will see output similar
to the following:
PM> install-package Microsoft.Hadoop.MapReduce
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.5.11)'.
Installing 'Newtonsoft.Json 4.5.11'.
Successfully installed 'Newtonsoft.Json 4.5.11'.
Installing 'Microsoft.Hadoop.MapReduce 0.9.4951.25594'.
Successfully installed 'Microsoft.Hadoop.MapReduce 0.9.4951.25594'.
Adding 'Newtonsoft.Json 4.5.11' to HadoopClient.
Successfully added 'Newtonsoft.Json 4.5.11' to HadoopClient.
Adding 'Microsoft.Hadoop.MapReduce 0.9.4951.25594' to HadoopClient.
Successfully added 'Microsoft.Hadoop.MapReduce 0.9.4951.25594' to HadoopClient.
Setting MRLib items CopyToOutputDirectory=true
the version numbers displayed while installing the nuget package might change with future version
updates of the SDK.
Note
Once the NuGet package has been added, add a reference to the dll file in your code:
using Microsoft.Hadoop.MapReduce;
Once these required references are added, you are ready to code your MapReduce classes and job-submission
logic in your application.
Submitting a Custom MapReduce Job
In the previous chapter, we already created the Constants.cs class to re-use several constant values, like your Azure
cluster url, storage account, containers and so on. The code in the class file should look similar to Listing 5-1.
Listing 5-1. The Constants class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HadoopClient
{
public class Constants
 
 
Search WWH ::




Custom Search