< Summary

Class:Microsoft.Azure.Batch.MultiInstanceSettings
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\MultiInstanceSettings.cs
Covered lines:44
Uncovered lines:2
Coverable lines:46
Total lines:159
Line coverage:95.6% (44 of 46)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
.ctor(...)-100%100%
get_CommonResourceFiles()-100%100%
set_CommonResourceFiles(...)-100%100%
get_CoordinationCommandLine()-100%100%
set_CoordinationCommandLine(...)-100%100%
get_NumberOfInstances()-100%100%
set_NumberOfInstances(...)-100%100%
Microsoft.Azure.Batch.IModifiable.get_HasBeenModified()-0%100%
Microsoft.Azure.Batch.IReadOnly.get_IsReadOnly()-0%100%
Microsoft.Azure.Batch.IReadOnly.set_IsReadOnly(...)-100%100%
Microsoft.Azure.Batch.ITransportObjectProvider<Microsoft.Azure.Batch.Protocol.Models.MultiInstanceSettings>.GetTransportObject()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Generated\MultiInstanceSettings.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 license information.
 3//
 4// Code generated by Microsoft (R) AutoRest Code Generator.
 5// Changes may cause incorrect behavior and will be lost if the code is
 6// regenerated.
 7
 8//
 9// This file was autogenerated by a tool.
 10// Do not modify it.
 11//
 12
 13namespace Microsoft.Azure.Batch
 14{
 15    using Models = Microsoft.Azure.Batch.Protocol.Models;
 16    using System;
 17    using System.Collections.Generic;
 18    using System.Linq;
 19
 20    /// <summary>
 21    /// Settings which specify how to run a multi-instance task. Multi-instance tasks are commonly used to support MPI t
 22    /// In the MPI case, if any of the subtasks fail (for example due to exiting with a non-zero exit code) the entire m
 23    /// task fails. The multi-instance task is then terminated and retried, up to its retry limit. For more information 
 24    /// https://azure.microsoft.com/documentation/articles/batch-mpi/.
 25    /// </summary>
 26    public partial class MultiInstanceSettings : ITransportObjectProvider<Models.MultiInstanceSettings>, IPropertyMetada
 27    {
 28        private class PropertyContainer : PropertyCollection
 29        {
 30            public readonly PropertyAccessor<IList<ResourceFile>> CommonResourceFilesProperty;
 31            public readonly PropertyAccessor<string> CoordinationCommandLineProperty;
 32            public readonly PropertyAccessor<int?> NumberOfInstancesProperty;
 33
 13334            public PropertyContainer() : base(BindingState.Unbound)
 35            {
 13336                this.CommonResourceFilesProperty = this.CreatePropertyAccessor<IList<ResourceFile>>(nameof(CommonResourc
 13337                this.CoordinationCommandLineProperty = this.CreatePropertyAccessor<string>(nameof(CoordinationCommandLin
 13338                this.NumberOfInstancesProperty = this.CreatePropertyAccessor<int?>(nameof(NumberOfInstances), BindingAcc
 13339            }
 40
 51841            public PropertyContainer(Models.MultiInstanceSettings protocolObject) : base(BindingState.Bound)
 42            {
 51843                this.CommonResourceFilesProperty = this.CreatePropertyAccessor(
 51844                    ResourceFile.ConvertFromProtocolCollectionAndFreeze(protocolObject.CommonResourceFiles),
 51845                    nameof(CommonResourceFiles),
 51846                    BindingAccess.Read);
 51847                this.CoordinationCommandLineProperty = this.CreatePropertyAccessor(
 51848                    protocolObject.CoordinationCommandLine,
 51849                    nameof(CoordinationCommandLine),
 51850                    BindingAccess.Read);
 51851                this.NumberOfInstancesProperty = this.CreatePropertyAccessor(
 51852                    protocolObject.NumberOfInstances,
 51853                    nameof(NumberOfInstances),
 51854                    BindingAccess.Read);
 51855            }
 56        }
 57
 58        private readonly PropertyContainer propertyContainer;
 59
 60        #region Constructors
 61
 62        /// <summary>
 63        /// Initializes a new instance of the <see cref="MultiInstanceSettings"/> class.
 64        /// </summary>
 65        /// <param name='coordinationCommandLine'>The command to run on the compute node instances for coordinating amon
 66        /// <param name='numberOfInstances'>The number of compute nodes required by the multi-instance task.</param>
 13367        public MultiInstanceSettings(
 13368            string coordinationCommandLine,
 13369            int? numberOfInstances = default(int?))
 70        {
 13371            this.propertyContainer = new PropertyContainer();
 13372            this.CoordinationCommandLine = coordinationCommandLine;
 13373            this.NumberOfInstances = numberOfInstances;
 13374        }
 75
 51876        internal MultiInstanceSettings(Models.MultiInstanceSettings protocolObject)
 77        {
 51878            this.propertyContainer = new PropertyContainer(protocolObject);
 51879        }
 80
 81        #endregion Constructors
 82
 83        #region MultiInstanceSettings
 84
 85        /// <summary>
 86        /// Gets or sets a list of files that the Batch service will download before running the coordination command li
 87        /// </summary>
 88        /// <remarks>
 89        /// The difference between common resource files and task resource files is that common resource files are downl
 90        /// for all subtasks including the primary, whereas task resource files are downloaded only for the primary. The
 91        /// is a maximum size for the list of resource files. When the max size is exceeded, the request will fail and t
 92        /// response error code will be RequestEntityTooLarge. If this occurs, the collection of resource files must be 
 93        /// in size. This can be achieved using .zip files, Application Packages, or Docker Containers.
 94        /// </remarks>
 95        public IList<ResourceFile> CommonResourceFiles
 96        {
 78397            get { return this.propertyContainer.CommonResourceFilesProperty.Value; }
 98            set
 99            {
 69100                this.propertyContainer.CommonResourceFilesProperty.Value = ConcurrentChangeTrackedModifiableList<Resourc
 68101            }
 102        }
 103
 104        /// <summary>
 105        /// Gets or sets the command to run on the compute node instances for coordinating among the subtasks.
 106        /// </summary>
 107        public string CoordinationCommandLine
 108        {
 783109            get { return this.propertyContainer.CoordinationCommandLineProperty.Value; }
 389110            set { this.propertyContainer.CoordinationCommandLineProperty.Value = value; }
 111        }
 112
 113        /// <summary>
 114        /// Gets or sets the number of compute nodes required by the multi-instance task.
 115        /// </summary>
 116        public int? NumberOfInstances
 117        {
 783118            get { return this.propertyContainer.NumberOfInstancesProperty.Value; }
 385119            set { this.propertyContainer.NumberOfInstancesProperty.Value = value; }
 120        }
 121
 122        #endregion // MultiInstanceSettings
 123
 124        #region IPropertyMetadata
 125
 126        bool IModifiable.HasBeenModified
 127        {
 0128            get { return this.propertyContainer.HasBeenModified; }
 129        }
 130
 131        bool IReadOnly.IsReadOnly
 132        {
 0133            get { return this.propertyContainer.IsReadOnly; }
 1038134            set { this.propertyContainer.IsReadOnly = value; }
 135        }
 136
 137        #endregion //IPropertyMetadata
 138
 139        #region Internal/private methods
 140        /// <summary>
 141        /// Return a protocol object of the requested type.
 142        /// </summary>
 143        /// <returns>The protocol object of the requested type.</returns>
 144        Models.MultiInstanceSettings ITransportObjectProvider<Models.MultiInstanceSettings>.GetTransportObject()
 145        {
 132146            Models.MultiInstanceSettings result = new Models.MultiInstanceSettings()
 132147            {
 132148                CommonResourceFiles = UtilitiesInternal.ConvertToProtocolCollection(this.CommonResourceFiles),
 132149                CoordinationCommandLine = this.CoordinationCommandLine,
 132150                NumberOfInstances = this.NumberOfInstances,
 132151            };
 152
 132153            return result;
 154        }
 155
 156
 157        #endregion // Internal/private methods
 158    }
 159}