< Summary

Class:Microsoft.Azure.HDInsight.Job.Models.MapReduceStreamingJobSubmissionParameters
Assembly:Microsoft.Azure.HDInsight.Job
File(s):C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\MapReduceStreamingJobSubmissionParameters.cs
Covered lines:22
Uncovered lines:11
Coverable lines:33
Total lines:127
Line coverage:66.6% (22 of 33)
Covered branches:17
Total branches:26
Branch coverage:65.3% (17 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Arguments()-0%100%
get_CmdEnv()-0%100%
get_Defines()-0%100%
get_File()-0%100%
get_Files()-0%100%
get_Input()-100%100%
get_Mapper()-100%100%
get_Output()-100%100%
get_Reducer()-100%100%
get_StatusDir()-0%100%
.ctor()-100%100%
GetJobPostRequestContent()-76.19%65.38%

File(s)

C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\MapReduceStreamingJobSubmissionParameters.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4
 5namespace Microsoft.Azure.HDInsight.Job.Models
 6{
 7    using System.Collections.Generic;
 8
 9    /// <summary>
 10    /// Parameters specifying the HDInsight MapReduce Streaming job definition.
 11    /// </summary>
 12    public partial class MapReduceStreamingJobSubmissionParameters
 13    {
 14        /// <summary>
 15        /// Optional. Gets the arguments for the jobDetails.
 16        /// </summary>
 017        public IList<string> Arguments { get; set; }
 18
 19        /// <summary>
 20        /// Optional. Set list of environment variables.
 21        /// </summary>
 022        public IDictionary<string, string> CmdEnv { get; set; }
 23
 24        /// <summary>
 25        /// Optional. Gets or sets define parameters.
 26        /// </summary>
 027        public IDictionary<string, string> Defines { get; set; }
 28
 29        /// <summary>
 30        /// Optional. File to add to the distributed cache.
 31        /// </summary>
 032        public string File { get; set; }
 33
 34        /// <summary>
 35        /// Optional. List of files to be copied to the cluster.
 36        /// </summary>
 037        public IList<string> Files { get; set; }
 38
 39        /// <summary>
 40        /// Optional. Location of the input data in Hadoop.
 41        /// </summary>
 1242        public string Input { get; set; }
 43
 44        /// <summary>
 45        /// Optional. Gets or sets Mapper executable or Java class name.
 46        /// </summary>
 1247        public string Mapper { get; set; }
 48
 49        /// <summary>
 50        /// Optional. Location in which to store the output data.
 51        /// </summary>
 1252        public string Output { get; set; }
 53
 54        /// <summary>
 55        /// Optional. Gets or sets Reducer executable or Java class name.
 56        /// </summary>
 1257        public string Reducer { get; set; }
 58
 59        /// <summary>
 60        /// Optional. Status directory in the default storage account to store job files stderr, stdout and exit.
 61        /// </summary>
 062        public string StatusDir { get; set; }
 63
 64        /// <summary>
 65        /// Initializes a new instance of the
 66        /// MapReduceStreamingJobSubmissionParameters class.
 67        /// </summary>
 468        public MapReduceStreamingJobSubmissionParameters()
 69        {
 470        }
 71
 72        internal string GetJobPostRequestContent()
 73        {
 74            // Check input parameters and transform them to required format before sending request to templeton.
 475            var values = new List<KeyValuePair<string, string>>();
 76
 477            if (!string.IsNullOrEmpty(this.Input))
 78            {
 479                values.Add(new KeyValuePair<string, string>("input", this.Input));
 80            }
 81
 482            if (!string.IsNullOrEmpty(this.Output))
 83            {
 484                values.Add(new KeyValuePair<string, string>("output", this.Output));
 85            }
 86
 487            if (!string.IsNullOrEmpty(this.Mapper))
 88            {
 489                values.Add(new KeyValuePair<string, string>("mapper", this.Mapper));
 90            }
 91
 492            if (!string.IsNullOrEmpty(this.Reducer))
 93            {
 494                values.Add(new KeyValuePair<string, string>("reducer", this.Reducer));
 95            }
 96
 497            if (!string.IsNullOrEmpty(this.File))
 98            {
 099                values.Add(new KeyValuePair<string, string>("file", this.File));
 100            }
 101
 4102            if (this.Files != null && this.Files.Count > 0)
 103            {
 0104                values.Add(new KeyValuePair<string, string>("files", ModelHelper.BuildListToCommaSeparatedString(this.Fi
 105            }
 106
 4107            if (this.Arguments != null && this.Arguments.Count > 0)
 108            {
 0109                values.AddRange(ModelHelper.BuildList("arg", this.Arguments));
 110            }
 111
 4112            if (this.Defines != null && this.Defines.Count > 0)
 113            {
 0114                values.AddRange(ModelHelper.BuildNameValueList("define", this.Defines));
 115            }
 116
 4117            if (this.CmdEnv != null && this.CmdEnv.Count > 0)
 118            {
 0119                values.AddRange(ModelHelper.BuildNameValueList("cmdenv", this.CmdEnv));
 120            }
 121
 4122            values.Add(new KeyValuePair<string, string>("statusdir", ModelHelper.GetStatusDirectory(this.StatusDir)));
 123
 4124            return ModelHelper.ConvertItemsToString(values);
 125        }
 126    }
 127}