Skip to content

Update HDInsight cmdlets to persist values passed in -Config param #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2015
Merged

Update HDInsight cmdlets to persist values passed in -Config param #107

merged 1 commit into from
Feb 17, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jan 23, 2015

Update HDInsight cmdlets to persist values passed in -Config param

When doing a pipelined create like:

New-AzureHDInsightClusterConfig -ClusterType HBase -ClusterSizeInNodes 1 |
Set-AzureHDInsightDefaultStorage -StorageAccountName "MyStorage" -StorageAccountKey "MyKey" -StorageContainerName "MyContainer" |
Add-AzureHDInsightMetastore -SqlAzureServerName "MySqlServer" -DatabaseName "MyDb" -Credential $SomeCredential -MetastoreType HiveMetastore |
New-AzureHDInsightCluster -Credential $CluserCredentials -Name "MyNewCluster" -Location "North Europe" -Version "3.1"

The resulting cluster is created as a Hadoop cluster instead of HBase. It looks like this is the result of the cmdlet creating a new AzureHDInsightConfig in AddAzureHDInsightMetastoreCommand.cs but then neglecting to copy the ClusterType member in AddAzureHDInsightMetastoreCmdlet.cs

AddAzureHDInsightScriptActionCmdlet.cs is a more recently added cmdlet and has a comprehensive(currently) copy of the members of the passed-in Config parameter.

AddAzureHDInsightStorageCmdlet.cs and AddAzureHDInsightStorageCmdlet.cs had similar omissions.

This pull request copies the implementation from AddAzureHDInsightScriptActionCmdlet.cs to the three implementations that are missing fields. A better long-term solution might be to implement a copy constructor on the AzureHDInsightConfig class and just use that in each cmdlet implementation when you need to create a new Config that contains all of the fields of a passed-in Config. Let me know if you'd rather see that change and I can refactor.

This problem was originally reported through a support case, feel free to contact me (rickhall at microsoft.com) with any questions.

@azuresdkci
Copy link

Can one of the admins verify this patch?

@azurecla
Copy link

Hi @rickmsft, I'm your friendly neighborhood Azure Pull Request Bot (You can call me AZPRBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.azure.com.

TTYL, AZPRBOT;

@ghost
Copy link
Author

ghost commented Jan 23, 2015

Do I need to sign the CLA even though I'm an FTE? (http://azure.github.io/guidelines.html#cla)

@stankovski
Copy link
Member

@azuresdkci add to whitelist

@stankovski
Copy link
Member

@rickmsft no, you don't need to sign the CLA

@ogail
Copy link
Contributor

ogail commented Feb 5, 2015

@azuresdkci retest this please

@@ -56,30 +56,26 @@ public AzureHDInsightConfig Config
throw new ArgumentNullException("value", "The value for the configuration can not be null.");
}

if (value.CoreConfiguration != null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you removing all the null checks?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation was copied from AddAzureHDInsightScriptActionCmdlet.cs. These values should reliably be non-null since the AzureHDInsightConfig constructor instantiates each member and the property setters are private.

@shefaliv
Copy link
Contributor

shefaliv commented Feb 9, 2015

Please shoot me an email at [email protected]. I handle PS on the HDI team. Thanks!

@markcowl markcowl merged commit 7ac7aac into Azure:dev Feb 17, 2015
ogail pushed a commit that referenced this pull request Aug 19, 2015
AzureRT referenced this pull request in AzureRT/azure-powershell Sep 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants