< Summary

Class:Microsoft.Azure.HDInsight.Job.Models.PigJobSubmissionParameters
Assembly:Microsoft.Azure.HDInsight.Job
File(s):C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\PigJobSubmissionParameters.cs
Covered lines:11
Uncovered lines:7
Coverable lines:18
Total lines:76
Line coverage:61.1% (11 of 18)
Covered branches:7
Total branches:12
Branch coverage:58.3% (7 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Arguments()-0%100%
get_File()-0%100%
get_Files()-0%100%
get_Query()-100%100%
get_StatusDir()-0%100%
.ctor()-100%100%
GetJobPostRequestContent()-72.73%58.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\PigJobSubmissionParameters.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 Pig job definition.
 11    /// </summary>
 12    public partial class PigJobSubmissionParameters
 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. Gets or sets the query file to use for a Pig job.
 21        /// </summary>
 022        public string File { get; set; }
 23
 24        /// <summary>
 25        /// Optional. Gets or sets the files to be copied to the cluster.
 26        /// </summary>
 027        public IList<string> Files { get; set; }
 28
 29        /// <summary>
 30        /// Optional. Gets or sets the query to use for a Pig job.
 31        /// </summary>
 1232        public string Query { get; set; }
 33
 34        /// <summary>
 35        /// Optional. Status directory in the default storage account to store job files stderr, stdout and exit.
 36        /// </summary>
 037        public string StatusDir { get; set; }
 38
 39        /// <summary>
 40        /// Initializes a new instance of the PigJobSubmissionParameters class.
 41        /// </summary>
 442        public PigJobSubmissionParameters()
 43        {
 444        }
 45
 46        internal string GetJobPostRequestContent()
 47        {
 48            // Check input parameters and transform them to required format before sending request to templeton.
 449            var values = new List<KeyValuePair<string, string>>();
 50
 451            if (!string.IsNullOrEmpty(this.Query))
 52            {
 453                values.Add(new KeyValuePair<string, string>("execute", this.Query));
 54            }
 55
 456            if (!string.IsNullOrEmpty(this.File))
 57            {
 058                values.Add(new KeyValuePair<string, string>("file", this.File));
 59            }
 60
 461            if (this.Arguments != null && this.Arguments.Count > 0)
 62            {
 063                values.AddRange(ModelHelper.BuildList("arg", this.Arguments));
 64            }
 65
 466            if (this.Files != null && this.Files.Count > 0)
 67            {
 068                values.Add(new KeyValuePair<string, string>("files", ModelHelper.BuildListToCommaSeparatedString(this.Fi
 69            }
 70
 471            values.Add(new KeyValuePair<string, string>("statusdir", ModelHelper.GetStatusDirectory(this.StatusDir)));
 72
 473            return ModelHelper.ConvertItemsToString(values);
 74        }
 75    }
 76}