Database Reference
In-Depth Information
Console.WriteLine("Cluster Map Reduce Metrics:");
Console.WriteLine("\tMaps Completed: \t{0}", hostComponentMetric.MapsCompleted);
Console.WriteLine("\tMaps Failed: \t{0}", hostComponentMetric.MapsFailed);
Console.WriteLine("\tMaps Killed: \t{0}", hostComponentMetric.MapsKilled);
Console.WriteLine("\tMaps Launched: \t{0}", hostComponentMetric.MapsLaunched);
Console.WriteLine("\tMaps Running: \t{0}", hostComponentMetric.MapsRunning);
Console.WriteLine("\tMaps Waiting: \t{0}", hostComponentMetric.MapsWaiting);
}
When you execute the MonitorCluster() method, you should see output similar to the following:
Cluster Href: https://democluster.azurehdinsight.net/ambari/api/monitoring/v1/
clusters/democluster.azurehdinsight.net
Cluster Map Redeuce Metrics:
Maps Completed: 151
Maps Failed : 20
Maps Killed : 0
Maps Launched : 171
Maps Running : 0
Maps Waiting : 10
The Ambari APIs can be used as mentioned to display MapReduce metrics for your cluster. The .NET SDK also
supports other functionalities, like data serialization using the Open Source Apache project Avro . For a complete list
of the SDK functionalities, refer to the following site:
http://hadoopsdk.codeplex.com/
Through the HadoopClient program, we automated MapReduce and Hive job submissions. Bundled together
with the cluster-management operations in the previous chapter, the complete Program.cs file along with the using
statements should now look similar to Listing 5-13.
Listing 5-13. The complete code listing
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography.X509Certificates;
using Microsoft.WindowsAzure.Management.HDInsight;
using Microsoft.Hadoop.MapReduce;
using Microsoft.Hadoop.Client;
//For Stream IO
using System.IO;
//For Ambari Monitoring Client
using Microsoft.Hadoop.WebClient.AmbariClient;
using Microsoft.Hadoop.WebClient.AmbariClient.Contracts;
//For Regex
using System.Text.RegularExpressions;
//For thread
using System.Threading;
 
Search WWH ::




Custom Search