< Summary

Class:Microsoft.Azure.HDInsight.Job.Models.HiveJobSubmissionParameters
Assembly:Microsoft.Azure.HDInsight.Job
File(s):C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\HiveJobSubmissionParameters.cs
Covered lines:15
Uncovered lines:6
Coverable lines:21
Total lines:86
Line coverage:71.4% (15 of 21)
Covered branches:11
Total branches:16
Branch coverage:68.7% (11 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_Arguments()-0%100%
get_Defines()-100%100%
get_File()-0%100%
get_Files()-0%100%
get_Query()-100%100%
get_StatusDir()-100%100%
.ctor()-100%100%
GetJobPostRequestContent()-76.92%68.75%

File(s)

C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Customizations\Models\HiveJobSubmissionParameters.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 Hive job definition.
 11    /// </summary>
 12    public partial class HiveJobSubmissionParameters
 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 Hive parameters.
 21        /// </summary>
 2622        public IDictionary<string, string> Defines { get; set; }
 23
 24        /// <summary>
 25        /// Optional. Gets or sets the query file to use for a Hive job.
 26        /// </summary>
 027        public string File { get; set; }
 28
 29        /// <summary>
 30        /// Optional. Gets or sets the files to be copied to the cluster.
 31        /// </summary>
 032        public IList<string> Files { get; set; }
 33
 34        /// <summary>
 35        /// Optional. Gets or sets the query to use for a Hive job.
 36        /// </summary>
 5437        public string Query { get; set; }
 38
 39        /// <summary>
 40        /// Optional. Status directory in the default storage account to store job files stderr, stdout and exit.
 41        /// </summary>
 2242        public string StatusDir { get; set; }
 43
 44        /// <summary>
 45        /// Initializes a new instance of the HiveJobSubmissionParameters class.
 46        /// </summary>
 1447        public HiveJobSubmissionParameters()
 48        {
 1449        }
 50
 51        internal string GetJobPostRequestContent()
 52        {
 53            // Check input parameters and transform them to required format before sending request to templeton.
 2054            var values = new List<KeyValuePair<string, string>>();
 55
 2056            if (!string.IsNullOrEmpty(this.Query))
 57            {
 2058                values.Add(new KeyValuePair<string, string>("execute", this.Query));
 59            }
 60
 2061            if (!string.IsNullOrEmpty(this.File))
 62            {
 063                values.Add(new KeyValuePair<string, string>("file", this.File));
 64            }
 65
 2066            if (this.Arguments != null && this.Arguments.Count > 0)
 67            {
 068                values.AddRange(ModelHelper.BuildList("arg", this.Arguments));
 69            }
 70
 2071            if (this.Defines != null && this.Defines.Count > 0)
 72            {
 273                values.AddRange(ModelHelper.BuildNameValueList("define", this.Defines));
 74            }
 75
 2076            if (this.Files != null && this.Files.Count > 0)
 77            {
 078                values.Add(new KeyValuePair<string, string>("files", ModelHelper.BuildListToCommaSeparatedString(this.Fi
 79            }
 80
 2081            values.Add(new KeyValuePair<string, string>("statusdir", ModelHelper.GetStatusDirectory(this.StatusDir)));
 82
 2083            return ModelHelper.ConvertItemsToString(values);
 84        }
 85    }
 86}