Skip to content

Commit b775fea

Browse files
committed
Merge pull request #152 from nemanja88/newdev
VM Sizes merge with Azure/dev
2 parents 60df675 + 81136ba commit b775fea

21 files changed

+311
-42
lines changed

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,13 @@
6666
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
6767
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.0\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
6868
</Reference>
69-
<Reference Include="Microsoft.Hadoop.Client, Version=1.3.3.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.3.3.2\lib\net40\Microsoft.Hadoop.Client.dll</HintPath>
69+
<Reference Include="Microsoft.Hadoop.Client, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
70+
<SpecificVersion>False</SpecificVersion>
71+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.Hadoop.Client.dll</HintPath>
7172
</Reference>
72-
<Reference Include="Microsoft.HDInsight.Net.Http.Formatting, Version=1.3.3.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
73-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.3.3.2\lib\net40\Microsoft.HDInsight.Net.Http.Formatting.dll</HintPath>
73+
<Reference Include="Microsoft.HDInsight.Net.Http.Formatting, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
74+
<SpecificVersion>False</SpecificVersion>
75+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.HDInsight.Net.Http.Formatting.dll</HintPath>
7476
</Reference>
7577
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.11.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7678
<SpecificVersion>False</SpecificVersion>
@@ -96,14 +98,21 @@
9698
<SpecificVersion>False</SpecificVersion>
9799
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.0.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
98100
</Reference>
99-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight, Version=1.3.3.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
100-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.3.3.2\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.dll</HintPath>
101+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
102+
<SpecificVersion>False</SpecificVersion>
103+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.dll</HintPath>
101104
</Reference>
102-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework, Version=1.3.3.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
103-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.3.3.2\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll</HintPath>
105+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Contracts, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
106+
<SpecificVersion>False</SpecificVersion>
107+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.HDInsight.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Contracts.dll</HintPath>
104108
</Reference>
105-
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework.Core, Version=1.3.3.2, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
106-
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.3.3.2\lib\net40\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll</HintPath>
109+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
110+
<SpecificVersion>False</SpecificVersion>
111+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.dll</HintPath>
112+
</Reference>
113+
<Reference Include="Microsoft.WindowsAzure.Management.HDInsight.Framework.Core, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c66ce9294aae1300, processorArchitecture=MSIL">
114+
<SpecificVersion>False</SpecificVersion>
115+
<HintPath>..\..\..\packages\Microsoft.Hadoop.Client.1.4.5\lib\net45\Microsoft.WindowsAzure.Management.HDInsight.Framework.Core.dll</HintPath>
107116
</Reference>
108117
<Reference Include="Microsoft.WindowsAzure.Storage, Version=3.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
109118
<HintPath>..\..\..\packages\WindowsAzure.Storage.3.0.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
@@ -224,8 +233,11 @@
224233
<Compile Include="Properties\AssemblyInfo.cs" />
225234
</ItemGroup>
226235
<ItemGroup>
236+
<None Include="app.config" />
227237
<None Include="MSSharedLibKey.snk" />
228-
<None Include="packages.config" />
238+
<None Include="packages.config">
239+
<SubType>Designer</SubType>
240+
</None>
229241
</ItemGroup>
230242
<ItemGroup>
231243
<ProjectReference Include="..\..\..\Common\Commands.Common.Test\Commands.Common.Test.csproj">

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CmdLetTests/AddConfigValuesCmdletTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,18 @@ public void CanCallTheAddConfigValuesCmdletTestsCmdlet_StormConfig()
8383

8484
}
8585

86+
[TestMethod]
87+
[TestCategory("CheckIn")]
88+
public void CanCallTheAddConfigValuesCmdletTestsCmdlet_SparkConfig()
89+
{
90+
using (IRunspace runspace = this.GetPowerShellRunspace())
91+
{
92+
var sparkConfig = new Hashtable();
93+
sparkConfig.Add("spark.fakeconfig.value", "12345");
94+
RunConfigOptionstest(runspace, CmdletConstants.SparkConfig, sparkConfig, c => c.SparkConfiguration);
95+
}
96+
}
97+
8698
[TestMethod]
8799
[TestCategory("CheckIn")]
88100
public void CanCallTheAddConfigValuesCmdletTestsCmdlet_HiveConfig()
@@ -373,7 +385,9 @@ public void CanCallTheAddConfigValuesCmdletTestsCmdlet_PreserveConfig()
373385
var coreConfig = new Hashtable();
374386
var yarnConfig = new Hashtable();
375387
var stormConfig = new Hashtable();
388+
var sparkConfig = new Hashtable();
376389
stormConfig.Add("storm.fakekey", "123");
390+
sparkConfig.Add("spark.fakekey", "123");
377391
var clusterConfig = new AzureHDInsightConfig
378392
{
379393
HiveMetastore =
@@ -401,12 +415,14 @@ public void CanCallTheAddConfigValuesCmdletTestsCmdlet_PreserveConfig()
401415
.WithParameter(CmdletConstants.CoreConfig, coreConfig)
402416
.WithParameter(CmdletConstants.YarnConfig, yarnConfig)
403417
.WithParameter(CmdletConstants.StormConfig, stormConfig)
418+
.WithParameter(CmdletConstants.SparkConfig, sparkConfig)
404419
.Invoke();
405420
AzureHDInsightConfig config = results.Results.ToEnumerable<AzureHDInsightConfig>().First();
406421

407422
Assert.AreEqual(config.CoreConfiguration.Count, coreConfig.Count);
408423
Assert.AreEqual(config.YarnConfiguration.Count, yarnConfig.Count);
409424
Assert.AreEqual(config.StormConfiguration.Count, stormConfig.Count);
425+
Assert.AreEqual(config.SparkConfiguration.Count, sparkConfig.Count);
410426

411427
foreach (object entry in coreConfig.Keys)
412428
{
@@ -432,6 +448,14 @@ public void CanCallTheAddConfigValuesCmdletTestsCmdlet_PreserveConfig()
432448
Assert.AreEqual(stormConfig[entry], configUnderTest.Value, "value doesn't match for storm config option with name '{0}'", entry);
433449
}
434450

451+
foreach (object entry in sparkConfig.Keys)
452+
{
453+
KeyValuePair<string, string> configUnderTest =
454+
config.SparkConfiguration.FirstOrDefault(c => string.Equals(c.Key, entry.ToString(), StringComparison.Ordinal));
455+
Assert.IsNotNull(configUnderTest, "Unable to find spark config option with name '{0}'", entry);
456+
Assert.AreEqual(sparkConfig[entry], configUnderTest.Value, "value doesn't match for spark config option with name '{0}'", entry);
457+
}
458+
435459
Assert.AreEqual(clusterConfig.HiveMetastore.DatabaseName, config.HiveMetastore.DatabaseName);
436460
Assert.AreEqual(clusterConfig.HiveMetastore.SqlAzureServerName, config.HiveMetastore.SqlAzureServerName);
437461
Assert.AreEqual(clusterConfig.HiveMetastore.Credential.UserName, config.HiveMetastore.Credential.UserName);

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CmdLetTests/CmdletHardCodes.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public static class CmdletConstants
9191
public const string StatusFolder = "StatusFolder";
9292
public const string YarnConfig = "Yarn";
9393
public const string StormConfig = "Storm";
94+
public const string SparkConfig = "Spark";
9495
public const string HBaseConfig = "HBase";
9596

9697
public const string StdErr = "StandardError";

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CmdLetTests/NewClusterCmdletTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public void ICanCreateAClusterUsingPowerShellAndConfig_New_Set_Add_Hive_Oozie()
420420
.WithParameter(CmdletConstants.Credential, GetPSCredential("hadoop", this.GetRandomValidPassword()))
421421
.Invoke();
422422

423-
ClusterCreateParameters request = AzureHDInsightClusterManagementClientSimulator.LastCreateRequest;
423+
ClusterCreateParametersV2 request = AzureHDInsightClusterManagementClientSimulator.LastCreateRequest;
424424
Assert.IsNotNull(request.HiveMetastore);
425425
Assert.IsNotNull(request.OozieMetastore);
426426

@@ -493,7 +493,7 @@ public void ICanCreateAClusterUsingPowerShellAndConfig_New_Set_Add_Hive_Oozie_An
493493
.WithParameter(CmdletConstants.Credential, GetPSCredential("hadoop", this.GetRandomValidPassword()))
494494
.Invoke();
495495

496-
ClusterCreateParameters request = AzureHDInsightClusterManagementClientSimulator.LastCreateRequest;
496+
ClusterCreateParametersV2 request = AzureHDInsightClusterManagementClientSimulator.LastCreateRequest;
497497
Assert.IsNotNull(request.HiveMetastore);
498498
Assert.IsNotNull(request.OozieMetastore);
499499

@@ -565,7 +565,7 @@ public void ICanCreateAClusterUsingPowerShellAndConfig_New_Set_Add_ScriptAction(
565565
.WithParameter(CmdletConstants.Credential, GetPSCredential("hadoop", this.GetRandomValidPassword()))
566566
.Invoke();
567567

568-
ClusterCreateParameters request = AzureHDInsightClusterManagementClientSimulator.LastCreateRequest;
568+
ClusterCreateParametersV2 request = AzureHDInsightClusterManagementClientSimulator.LastCreateRequest;
569569
Assert.IsTrue(request.ConfigActions != null && request.ConfigActions.Count == 2);
570570
Assert.IsTrue(
571571
request.ConfigActions.ElementAt(0).Name == "test1" &&

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Models/Simulators/AzureHDInsightClusterManagementClientSimulator.cs

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.Simulators
3030
{
3131
internal class AzureHDInsightClusterManagementClientSimulator : IHDInsightClient
3232
{
33-
internal static ClusterCreateParameters LastCreateRequest;
33+
internal static ClusterCreateParametersV2 LastCreateRequest;
3434

3535
private static readonly Collection<SimulatorClusterContainer> Clusters = new Collection<SimulatorClusterContainer>
3636
{
@@ -176,9 +176,12 @@ public void Cancel()
176176
{
177177
}
178178

179+
180+
179181
public ClusterDetails CreateCluster(ClusterCreateParameters cluster)
180182
{
181-
Task<ClusterDetails> createTask = this.CreateClusterAsync(cluster);
183+
Task<ClusterDetails> createTask = this.CreateClusterAsync(
184+
new ClusterCreateParametersV2( cluster));
182185
createTask.Wait();
183186
return createTask.Result;
184187
}
@@ -188,7 +191,24 @@ public ClusterDetails CreateCluster(ClusterCreateParameters cluster, TimeSpan ti
188191
return this.CreateCluster(cluster);
189192
}
190193

194+
public ClusterDetails CreateCluster(ClusterCreateParametersV2 cluster)
195+
{
196+
Task<ClusterDetails> createTask = this.CreateClusterAsync(cluster);
197+
createTask.Wait();
198+
return createTask.Result;
199+
}
200+
201+
public ClusterDetails CreateCluster(ClusterCreateParametersV2 cluster, TimeSpan timeout)
202+
{
203+
return this.CreateCluster(cluster);
204+
}
205+
191206
public Task<ClusterDetails> CreateClusterAsync(ClusterCreateParameters clusterCreateParameters)
207+
{
208+
return CreateClusterAsync(new ClusterCreateParametersV2(clusterCreateParameters));
209+
}
210+
211+
public Task<ClusterDetails> CreateClusterAsync(ClusterCreateParametersV2 clusterCreateParameters)
192212
{
193213
this.LogMessage("Creating cluster '{0}' in location {1}", clusterCreateParameters.Name, clusterCreateParameters.Location);
194214
LastCreateRequest = clusterCreateParameters;
@@ -218,6 +238,16 @@ public void DeleteCluster(string dnsName, TimeSpan timeout)
218238
this.DeleteClusterAsync(dnsName).Wait();
219239
}
220240

241+
public void DeleteCluster(string dnsName, string location)
242+
{
243+
throw new NotImplementedException();
244+
}
245+
246+
public void DeleteCluster(string dnsName, string location, TimeSpan timeout)
247+
{
248+
throw new NotImplementedException();
249+
}
250+
221251
public async Task DeleteClusterAsync(string name)
222252
{
223253
ClusterDetails cluster = await this.GetClusterAsync(name);
@@ -230,6 +260,11 @@ public async Task DeleteClusterAsync(string name)
230260
Clusters.Remove(GetClusterInternal(name));
231261
}
232262

263+
public Task DeleteClusterAsync(string name, string location)
264+
{
265+
throw new NotImplementedException();
266+
}
267+
233268
public void DisableHttp(string dnsName, string location)
234269
{
235270
this.DisableHttpAsync(dnsName, location).Wait();
@@ -265,6 +300,13 @@ public ClusterDetails GetCluster(string dnsName)
265300
return getTask.Result;
266301
}
267302

303+
public ClusterDetails GetCluster(string dnsName, string location)
304+
{
305+
Task<ClusterDetails> getTask = this.GetClusterAsync(dnsName, location);
306+
getTask.Wait();
307+
return getTask.Result;
308+
}
309+
268310
public async Task<ClusterDetails> GetClusterAsync(string name)
269311
{
270312
this.LogMessage("Getting hdinsight clusters for subscriptionid : {0}", this.credentials.SubscriptionId.ToString());
@@ -273,6 +315,11 @@ public async Task<ClusterDetails> GetClusterAsync(string name)
273315
return cluster;
274316
}
275317

318+
public Task<ClusterDetails> GetClusterAsync(string name, string location)
319+
{
320+
throw new NotImplementedException();
321+
}
322+
276323
public ClusterDetails ChangeClusterSize(string dnsName, string location, int newSize)
277324
{
278325
return ChangeClusterSizeAsync(dnsName, location, newSize).WaitForResult();
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<runtime>
4+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
5+
<dependentAssembly>
6+
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
7+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
8+
</dependentAssembly>
9+
</assemblyBinding>
10+
</runtime>
11+
</configuration>

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<package id="Microsoft.Data.Edm" version="5.6.0" targetFramework="net45" />
1212
<package id="Microsoft.Data.OData" version="5.6.0" targetFramework="net45" />
1313
<package id="Microsoft.Data.Services.Client" version="5.6.0" targetFramework="net45" />
14-
<package id="Microsoft.Hadoop.Client" version="1.3.3.2" targetFramework="net45" />
14+
<package id="Microsoft.Hadoop.Client" version="1.4.5" targetFramework="net45" />
1515
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.11.10918.1222" targetFramework="net45" />
1616
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1717
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="1.8.0.0" targetFramework="net45" />
1818
<package id="Microsoft.WindowsAzure.Management" version="4.0.1" targetFramework="net45" />
19-
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.3.3.2" targetFramework="net45" />
19+
<package id="Microsoft.WindowsAzure.Management.HDInsight" version="1.4.5" targetFramework="net45" />
2020
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
2121
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
2222
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />

src/ServiceManagement/HDInsight/Commands.HDInsight/Cmdlet/AddAzureHDInsightConfigValuesCmdlet.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public AzureHDInsightConfig Config
8181
this.command.Config.SubnetName = value.SubnetName;
8282
this.command.Config.StormConfiguration.AddRange(value.StormConfiguration);
8383
this.command.Config.HBaseConfiguration.ConfigurationCollection.AddRange(value.HBaseConfiguration.ConfigurationCollection);
84+
this.command.Config.SparkConfiguration.AddRange(value.SparkConfiguration);
8485
}
8586
}
8687

@@ -161,6 +162,17 @@ public Hashtable Storm
161162
set { this.command.Storm = value; }
162163
}
163164

165+
/// <summary>
166+
/// Gets or sets a collection of configuration properties to customize the Spark service.
167+
/// </summary>
168+
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Ease of use in Powershell")]
169+
[Parameter(Mandatory = false, HelpMessage = "a collection of configuration properties to customize the Spark service.")]
170+
public Hashtable Spark
171+
{
172+
get { return this.command.Spark; }
173+
set { this.command.Spark = value; }
174+
}
175+
164176
/// <summary>
165177
/// Gets or sets a collection of configuration properties to customize the HBase service.
166178
/// </summary>

0 commit comments

Comments
 (0)