< Summary

Class:Azure.Analytics.Synapse.Artifacts.Models.SparkJobProperties
Assembly:Azure.Analytics.Synapse.Artifacts
File(s):C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkJobProperties.cs
C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkJobProperties.Serialization.cs
Covered lines:0
Uncovered lines:188
Coverable lines:188
Total lines:356
Line coverage:0% (0 of 188)
Covered branches:0
Total branches:68
Branch coverage:0% (0 of 68)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Name()-0%100%
get_File()-0%100%
get_ClassName()-0%100%
get_Conf()-0%100%
get_Args()-0%100%
get_Jars()-0%100%
get_Files()-0%100%
get_Archives()-0%100%
get_DriverMemory()-0%100%
get_DriverCores()-0%100%
get_ExecutorMemory()-0%100%
get_ExecutorCores()-0%100%
get_NumExecutors()-0%100%
get_AdditionalProperties()-0%100%
GetEnumerator()-0%100%
System.Collections.IEnumerable.GetEnumerator()-0%100%
TryGetValue(...)-0%100%
ContainsKey(...)-0%100%
get_Keys()-0%100%
get_Values()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_Count()-0%100%
Add(...)-0%100%
Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.get_IsReadOnly()-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Add(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Remove(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Contains(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.CopyTo(...)-0%100%
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<System.String,System.Object>>.Clear()-0%100%
get_Item(...)-0%100%
set_Item(...)-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeSparkJobProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkJobProperties.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections;
 10using System.Collections.Generic;
 11using Azure.Core;
 12
 13namespace Azure.Analytics.Synapse.Artifacts.Models
 14{
 15    /// <summary> The properties of the Spark job. </summary>
 16    public partial class SparkJobProperties : IDictionary<string, object>
 17    {
 18        /// <summary> Initializes a new instance of SparkJobProperties. </summary>
 19        /// <param name="file"> File containing the application to execute. </param>
 20        /// <param name="driverMemory"> Amount of memory to use for the driver process. </param>
 21        /// <param name="driverCores"> Number of cores to use for the driver. </param>
 22        /// <param name="executorMemory"> Amount of memory to use per executor process. </param>
 23        /// <param name="executorCores"> Number of cores to use for each executor. </param>
 24        /// <param name="numExecutors"> Number of executors to launch for this job. </param>
 25        /// <exception cref="ArgumentNullException"> <paramref name="file"/>, <paramref name="driverMemory"/>, or <param
 026        public SparkJobProperties(string file, string driverMemory, int driverCores, string executorMemory, int executor
 27        {
 028            if (file == null)
 29            {
 030                throw new ArgumentNullException(nameof(file));
 31            }
 032            if (driverMemory == null)
 33            {
 034                throw new ArgumentNullException(nameof(driverMemory));
 35            }
 036            if (executorMemory == null)
 37            {
 038                throw new ArgumentNullException(nameof(executorMemory));
 39            }
 40
 041            File = file;
 042            Args = new ChangeTrackingList<string>();
 043            Jars = new ChangeTrackingList<string>();
 044            Files = new ChangeTrackingList<string>();
 045            Archives = new ChangeTrackingList<string>();
 046            DriverMemory = driverMemory;
 047            DriverCores = driverCores;
 048            ExecutorMemory = executorMemory;
 049            ExecutorCores = executorCores;
 050            NumExecutors = numExecutors;
 051            AdditionalProperties = new ChangeTrackingDictionary<string, object>();
 052        }
 53
 54        /// <summary> Initializes a new instance of SparkJobProperties. </summary>
 55        /// <param name="name"> The name of the job. </param>
 56        /// <param name="file"> File containing the application to execute. </param>
 57        /// <param name="className"> Main class for Java/Scala application. </param>
 58        /// <param name="conf"> Spark configuration properties. </param>
 59        /// <param name="args"> Command line arguments for the application. </param>
 60        /// <param name="jars"> Jars to be used in this job. </param>
 61        /// <param name="files"> files to be used in this job. </param>
 62        /// <param name="archives"> Archives to be used in this job. </param>
 63        /// <param name="driverMemory"> Amount of memory to use for the driver process. </param>
 64        /// <param name="driverCores"> Number of cores to use for the driver. </param>
 65        /// <param name="executorMemory"> Amount of memory to use per executor process. </param>
 66        /// <param name="executorCores"> Number of cores to use for each executor. </param>
 67        /// <param name="numExecutors"> Number of executors to launch for this job. </param>
 68        /// <param name="additionalProperties"> . </param>
 069        internal SparkJobProperties(string name, string file, string className, object conf, IList<string> args, IList<s
 70        {
 071            Name = name;
 072            File = file;
 073            ClassName = className;
 074            Conf = conf;
 075            Args = args;
 076            Jars = jars;
 077            Files = files;
 078            Archives = archives;
 079            DriverMemory = driverMemory;
 080            DriverCores = driverCores;
 081            ExecutorMemory = executorMemory;
 082            ExecutorCores = executorCores;
 083            NumExecutors = numExecutors;
 084            AdditionalProperties = additionalProperties;
 085        }
 86
 87        /// <summary> The name of the job. </summary>
 088        public string Name { get; set; }
 89        /// <summary> File containing the application to execute. </summary>
 090        public string File { get; set; }
 91        /// <summary> Main class for Java/Scala application. </summary>
 092        public string ClassName { get; set; }
 93        /// <summary> Spark configuration properties. </summary>
 094        public object Conf { get; set; }
 95        /// <summary> Command line arguments for the application. </summary>
 096        public IList<string> Args { get; }
 97        /// <summary> Jars to be used in this job. </summary>
 098        public IList<string> Jars { get; }
 99        /// <summary> files to be used in this job. </summary>
 0100        public IList<string> Files { get; }
 101        /// <summary> Archives to be used in this job. </summary>
 0102        public IList<string> Archives { get; }
 103        /// <summary> Amount of memory to use for the driver process. </summary>
 0104        public string DriverMemory { get; set; }
 105        /// <summary> Number of cores to use for the driver. </summary>
 0106        public int DriverCores { get; set; }
 107        /// <summary> Amount of memory to use per executor process. </summary>
 0108        public string ExecutorMemory { get; set; }
 109        /// <summary> Number of cores to use for each executor. </summary>
 0110        public int ExecutorCores { get; set; }
 111        /// <summary> Number of executors to launch for this job. </summary>
 0112        public int NumExecutors { get; set; }
 0113        internal IDictionary<string, object> AdditionalProperties { get; }
 114        /// <inheritdoc />
 0115        public IEnumerator<KeyValuePair<string, object>> GetEnumerator() => AdditionalProperties.GetEnumerator();
 116        /// <inheritdoc />
 0117        IEnumerator IEnumerable.GetEnumerator() => AdditionalProperties.GetEnumerator();
 118        /// <inheritdoc />
 0119        public bool TryGetValue(string key, out object value) => AdditionalProperties.TryGetValue(key, out value);
 120        /// <inheritdoc />
 0121        public bool ContainsKey(string key) => AdditionalProperties.ContainsKey(key);
 122        /// <inheritdoc />
 0123        public ICollection<string> Keys => AdditionalProperties.Keys;
 124        /// <inheritdoc />
 0125        public ICollection<object> Values => AdditionalProperties.Values;
 126        /// <inheritdoc />
 0127        int ICollection<KeyValuePair<string, object>>.Count => AdditionalProperties.Count;
 128        /// <inheritdoc />
 0129        public void Add(string key, object value) => AdditionalProperties.Add(key, value);
 130        /// <inheritdoc />
 0131        public bool Remove(string key) => AdditionalProperties.Remove(key);
 132        /// <inheritdoc />
 0133        bool ICollection<KeyValuePair<string, object>>.IsReadOnly => AdditionalProperties.IsReadOnly;
 134        /// <inheritdoc />
 0135        void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> value) => AdditionalProperties.A
 136        /// <inheritdoc />
 0137        bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> value) => AdditionalPropertie
 138        /// <inheritdoc />
 0139        bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> value) => AdditionalPropert
 140        /// <inheritdoc />
 0141        void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] destination, int offset) =>
 142        /// <inheritdoc />
 0143        void ICollection<KeyValuePair<string, object>>.Clear() => AdditionalProperties.Clear();
 144        /// <inheritdoc />
 145        public object this[string key]
 146        {
 0147            get => AdditionalProperties[key];
 0148            set => AdditionalProperties[key] = value;
 149        }
 150    }
 151}

C:\Git\azure-sdk-for-net\sdk\synapse\Azure.Analytics.Synapse.Artifacts\src\Generated\Models\SparkJobProperties.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Analytics.Synapse.Artifacts.Models
 13{
 14    public partial class SparkJobProperties : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(Name))
 20            {
 021                writer.WritePropertyName("name");
 022                writer.WriteStringValue(Name);
 23            }
 024            writer.WritePropertyName("file");
 025            writer.WriteStringValue(File);
 026            if (Optional.IsDefined(ClassName))
 27            {
 028                writer.WritePropertyName("className");
 029                writer.WriteStringValue(ClassName);
 30            }
 031            if (Optional.IsDefined(Conf))
 32            {
 033                writer.WritePropertyName("conf");
 034                writer.WriteObjectValue(Conf);
 35            }
 036            if (Optional.IsCollectionDefined(Args))
 37            {
 038                writer.WritePropertyName("args");
 039                writer.WriteStartArray();
 040                foreach (var item in Args)
 41                {
 042                    writer.WriteStringValue(item);
 43                }
 044                writer.WriteEndArray();
 45            }
 046            if (Optional.IsCollectionDefined(Jars))
 47            {
 048                writer.WritePropertyName("jars");
 049                writer.WriteStartArray();
 050                foreach (var item in Jars)
 51                {
 052                    writer.WriteStringValue(item);
 53                }
 054                writer.WriteEndArray();
 55            }
 056            if (Optional.IsCollectionDefined(Files))
 57            {
 058                writer.WritePropertyName("files");
 059                writer.WriteStartArray();
 060                foreach (var item in Files)
 61                {
 062                    writer.WriteStringValue(item);
 63                }
 064                writer.WriteEndArray();
 65            }
 066            if (Optional.IsCollectionDefined(Archives))
 67            {
 068                writer.WritePropertyName("archives");
 069                writer.WriteStartArray();
 070                foreach (var item in Archives)
 71                {
 072                    writer.WriteStringValue(item);
 73                }
 074                writer.WriteEndArray();
 75            }
 076            writer.WritePropertyName("driverMemory");
 077            writer.WriteStringValue(DriverMemory);
 078            writer.WritePropertyName("driverCores");
 079            writer.WriteNumberValue(DriverCores);
 080            writer.WritePropertyName("executorMemory");
 081            writer.WriteStringValue(ExecutorMemory);
 082            writer.WritePropertyName("executorCores");
 083            writer.WriteNumberValue(ExecutorCores);
 084            writer.WritePropertyName("numExecutors");
 085            writer.WriteNumberValue(NumExecutors);
 086            foreach (var item in AdditionalProperties)
 87            {
 088                writer.WritePropertyName(item.Key);
 089                writer.WriteObjectValue(item.Value);
 90            }
 091            writer.WriteEndObject();
 092        }
 93
 94        internal static SparkJobProperties DeserializeSparkJobProperties(JsonElement element)
 95        {
 096            Optional<string> name = default;
 097            string file = default;
 098            Optional<string> className = default;
 099            Optional<object> conf = default;
 0100            Optional<IList<string>> args = default;
 0101            Optional<IList<string>> jars = default;
 0102            Optional<IList<string>> files = default;
 0103            Optional<IList<string>> archives = default;
 0104            string driverMemory = default;
 0105            int driverCores = default;
 0106            string executorMemory = default;
 0107            int executorCores = default;
 0108            int numExecutors = default;
 0109            IDictionary<string, object> additionalProperties = default;
 0110            Dictionary<string, object> additionalPropertiesDictionary = default;
 0111            foreach (var property in element.EnumerateObject())
 112            {
 0113                if (property.NameEquals("name"))
 114                {
 0115                    name = property.Value.GetString();
 0116                    continue;
 117                }
 0118                if (property.NameEquals("file"))
 119                {
 0120                    file = property.Value.GetString();
 0121                    continue;
 122                }
 0123                if (property.NameEquals("className"))
 124                {
 0125                    className = property.Value.GetString();
 0126                    continue;
 127                }
 0128                if (property.NameEquals("conf"))
 129                {
 0130                    conf = property.Value.GetObject();
 0131                    continue;
 132                }
 0133                if (property.NameEquals("args"))
 134                {
 0135                    List<string> array = new List<string>();
 0136                    foreach (var item in property.Value.EnumerateArray())
 137                    {
 0138                        array.Add(item.GetString());
 139                    }
 0140                    args = array;
 0141                    continue;
 142                }
 0143                if (property.NameEquals("jars"))
 144                {
 0145                    List<string> array = new List<string>();
 0146                    foreach (var item in property.Value.EnumerateArray())
 147                    {
 0148                        array.Add(item.GetString());
 149                    }
 0150                    jars = array;
 0151                    continue;
 152                }
 0153                if (property.NameEquals("files"))
 154                {
 0155                    List<string> array = new List<string>();
 0156                    foreach (var item in property.Value.EnumerateArray())
 157                    {
 0158                        array.Add(item.GetString());
 159                    }
 0160                    files = array;
 0161                    continue;
 162                }
 0163                if (property.NameEquals("archives"))
 164                {
 0165                    List<string> array = new List<string>();
 0166                    foreach (var item in property.Value.EnumerateArray())
 167                    {
 0168                        array.Add(item.GetString());
 169                    }
 0170                    archives = array;
 0171                    continue;
 172                }
 0173                if (property.NameEquals("driverMemory"))
 174                {
 0175                    driverMemory = property.Value.GetString();
 0176                    continue;
 177                }
 0178                if (property.NameEquals("driverCores"))
 179                {
 0180                    driverCores = property.Value.GetInt32();
 0181                    continue;
 182                }
 0183                if (property.NameEquals("executorMemory"))
 184                {
 0185                    executorMemory = property.Value.GetString();
 0186                    continue;
 187                }
 0188                if (property.NameEquals("executorCores"))
 189                {
 0190                    executorCores = property.Value.GetInt32();
 0191                    continue;
 192                }
 0193                if (property.NameEquals("numExecutors"))
 194                {
 0195                    numExecutors = property.Value.GetInt32();
 0196                    continue;
 197                }
 0198                additionalPropertiesDictionary ??= new Dictionary<string, object>();
 0199                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
 200            }
 0201            additionalProperties = additionalPropertiesDictionary;
 0202            return new SparkJobProperties(name.Value, file, className.Value, conf.Value, Optional.ToList(args), Optional
 203        }
 204    }
 205}