You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Learn how to submit MapReduce jobs using HDInsight .NET SDK. HDInsight clusters come with a jar file with some MapReduce samples. The jar file is */example/jars/hadoop-mapreduce-examples.jar*. One of the samples is *wordcount*. You develop a C# console application to submit a wordcount job. The job reads the */example/data/gutenberg/davinci.txt* file, and outputs the results to */example/data/davinciwordcount*. If you want to rerun the application, you must clean up the output folder.
17
+
Learn how to submit MapReduce jobs using HDInsight .NET SDK. HDInsight clusters come with a jar file with some MapReduce samples. The jar file is `/example/jars/hadoop-mapreduce-examples.jar`. One of the samples is **wordcount**. You develop a C# console application to submit a wordcount job. The job reads the `/example/data/gutenberg/davinci.txt` file, and outputs the results to `/example/data/davinciwordcount`. If you want to rerun the application, you must clean up the output folder.
18
18
19
19
> [!NOTE]
20
20
> The steps in this article must be performed from a Windows client. For information on using a Linux, OS X, or Unix client to work with Hive, use the tab selector shown on the top of the article.
21
-
>
22
-
>
23
21
24
22
## Prerequisites
25
-
Before you begin this article, you must have the following items:
26
23
27
-
***A Hadoop cluster in HDInsight**. See [Get started using Linux-based Apache Hadoop in HDInsight](apache-hadoop-linux-tutorial-get-started.md).
28
-
***Visual Studio 2013/2015/2017**.
24
+
* An Apache Hadoop cluster on HDInsight. See [Create Apache Hadoop clusters using the Azure portal](../hdinsight-hadoop-create-linux-clusters-portal.md).
1. Copy the code below into **Program.cs**. Then edit the code by setting the values for: `existingClusterName`, `existingClusterPassword`, `defaultStorageAccountName`, `defaultStorageAccountKey`, and `defaultStorageContainerName`.
42
41
43
42
```csharp
44
43
using System.Collections.Generic;
@@ -50,65 +49,64 @@ The HDInsight .NET SDK provides .NET client libraries, which makes it easier to
@@ -143,7 +141,7 @@ The HDInsight .NET SDK provides .NET client libraries, which makes it easier to
143
141
else
144
142
{
145
143
// fetch stderr output in case of failure
146
-
var output = _hdiJobManagementClient.JobManagement.GetJobErrorLogs(jobId, storageAccess);
144
+
var output = _hdiJobManagementClient.JobManagement.GetJobErrorLogs(jobId, storageAccess);
147
145
148
146
using (var reader = new StreamReader(output, Encoding.UTF8))
149
147
{
@@ -155,20 +153,21 @@ The HDInsight .NET SDK provides .NET client libraries, which makes it easier to
155
153
}
156
154
}
157
155
}
156
+
158
157
```
159
158
160
-
4. Press **F5** to run the application.
159
+
1. Press **F5** to run the application.
161
160
162
-
To run the job again, you must change the job output folder name, in the sample, it is "/example/data/davinciwordcount".
161
+
To run the job again, you must change the job output folder name, in the sample it's `/example/data/davinciwordcount`.
163
162
164
-
When the job completes successfully, the application prints the content of the output file "part-r-00000".
163
+
When the job completes successfully, the application prints the content of the output file `part-r-00000`.
165
164
166
165
## Next steps
166
+
167
167
In this article, you have learned several ways to create an HDInsight cluster. To learn more, see the following articles:
168
168
169
169
* For submitting a Hive job, see [Run Apache Hive queries using HDInsight .NET SDK](apache-hadoop-use-hive-dotnet-sdk.md).
170
170
* For creating HDInsight clusters, see [Create Linux-based Apache Hadoop clusters in HDInsight](../hdinsight-hadoop-provision-linux-clusters.md).
171
171
* For managing HDInsight clusters, see [Manage Apache Hadoop clusters in HDInsight](../hdinsight-administer-use-portal-linux.md).
172
172
* For learning the HDInsight .NET SDK, see [HDInsight .NET SDK reference](https://docs.microsoft.com/dotnet/api/overview/azure/hdinsight).
173
-
* For non-interactive authenticate to Azure, see [Create non-interactive authentication .NET HDInsight applications](../hdinsight-create-non-interactive-authentication-dotnet-applications.md).
174
-
173
+
* For non-interactive authenticate to Azure, see [Create non-interactive authentication .NET HDInsight applications](../hdinsight-create-non-interactive-authentication-dotnet-applications.md).
0 commit comments