Skip to content

Breaking Change: Remove PErFileThreadCount and ConcurrentFileCount fr… #5989

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 3 commits into from
Apr 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ResourceManager/DataLakeStore/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
-->
## Current Release
* Set minimum dependency of module to PowerShell 5.0
* Breaking changes in Export-AzureRmDataLakeStoreItem, Import-AzureRmDataLakeStoreItem, Remove-AzureRmDataLakeStoreItem

## Version 5.2.0
* Updated to the latest version of the Azure ClientRuntime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,6 @@ public class ExportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
ParameterSetName = DiagnosticParameterSetName)]
public SwitchParameter Resume { get; set; }

[Obsolete("Parameter PerFileThreadCount of ExportAzureRmDataLakeStoreItem is deprecated. This parameter will be removed in future releases. Please use Concurrency parameter instead.")]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 5, Mandatory = false,
HelpMessage = "Indicates the maximum number of threads to use per file. Default will be computed as a best effort based on folder and file size",
ParameterSetName = BaseParameterSetName)]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 5, Mandatory = false,
HelpMessage = "Indicates the maximum number of threads to use per file. Default will be computed as a best effort based on folder and file size",
ParameterSetName = DiagnosticParameterSetName)]
public int PerFileThreadCount { get; set; } = -1;

[Obsolete("Parameter ConcurrentFileCount of ExportAzureRmDataLakeStoreItem is deprecated. This parameter will be removed in future releases. Please use Concurrency parameter instead.")]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 6, Mandatory = false,
HelpMessage =
"Indicates the maximum number of files to download in parallel for a folder download. Default will be computed as a best effort based on folder and file size",
ParameterSetName = BaseParameterSetName)]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 6, Mandatory = false,
HelpMessage =
"Indicates the maximum number of files to download in parallel for a folder download. Default will be computed as a best effort based on folder and file size",
ParameterSetName = DiagnosticParameterSetName)]
public int ConcurrentFileCount { get; set; } = -1;

[Parameter(ValueFromPipelineByPropertyName = true, Position = 7, Mandatory = false,
HelpMessage = "Indicates that, if the file or folder exists, it should be overwritten",
ParameterSetName = BaseParameterSetName)]
Expand Down Expand Up @@ -128,14 +108,6 @@ public class ExportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase

public override void ExecuteCmdlet()
{
if (ConcurrentFileCount != -1)
{
WriteWarning(Resources.IncorrectConcurrentFileCountWarning);
}
if (PerFileThreadCount != -1)
{
WriteWarning(Resources.IncorrectPerFileThreadCountWarning);
}
// We will let this throw itself if the path they give us is invalid
var powerShellReadyPath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(Destination);
ConfirmAction(
Expand All @@ -152,23 +124,7 @@ public override void ExecuteCmdlet()
DataLakeStoreFileSystemClient.SetupFileLogging(DiagnosticLogLevel, diagnosticPath);
}

int threadCount;
if (Concurrency > 0)
{
threadCount = Concurrency;
}
else if (ConcurrentFileCount > 0 && PerFileThreadCount <= 0)
{
threadCount = ConcurrentFileCount;
}
else if (ConcurrentFileCount <= 0 && PerFileThreadCount > 0)
{
threadCount = PerFileThreadCount;
}
else
{
threadCount = Math.Min(PerFileThreadCount * ConcurrentFileCount, DataLakeStoreFileSystemClient.ImportExportMaxThreads);
}
int threadCount = Concurrency;
DataLakeStoreFileSystemClient.BulkCopy(powerShellReadyPath, Account,
Path.TransformedPath, CmdletCancellationToken, threadCount, Recurse, Force, Resume, true, this);
WriteObject(powerShellReadyPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,6 @@ public class ImportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
ParameterSetName = DiagnosticParameterSetName)]
public SwitchParameter ForceBinary { get; set; }

[Obsolete("Parameter PerFileThreadCount of ImportAzureRmDataLakeStoreItem is deprecated. This parameter will be removed in future releases. Please use Concurrency parameter instead.")]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 6, Mandatory = false,
HelpMessage =
"Indicates the maximum number of threads to use per file. Default will be computed as a best effort based on folder and file size",
ParameterSetName = BaseParameterSetName)]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 6, Mandatory = false,
HelpMessage = "Indicates the maximum number of threads to use per file. Default will be computed as a best effort based on folder and file size",
ParameterSetName = DiagnosticParameterSetName)]
public int PerFileThreadCount { get; set; } = -1;

[Obsolete("Parameter ConcurrentFileCount of ImportAzureRmDataLakeStoreItem is deprecated. This parameter will be removed in future releases. Please use Concurrency parameter instead.")]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 7, Mandatory = false,
HelpMessage = "Indicates the maximum number of files to upload in parallel for a folder upload. Default will be computed as a best effort based on folder and file size",
ParameterSetName = BaseParameterSetName)]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 7, Mandatory = false,
HelpMessage = "Indicates the maximum number of files to upload in parallel for a folder upload. Default will be computed as a best effort based on folder and file size",
ParameterSetName = DiagnosticParameterSetName)]
public int ConcurrentFileCount { get; set; } = -1;

[Parameter(ValueFromPipelineByPropertyName = true, Position = 8, Mandatory = false,
HelpMessage = "Indicates that, if the file or folder exists, it should be overwritten",
ParameterSetName = BaseParameterSetName)]
Expand Down Expand Up @@ -137,14 +118,6 @@ public class ImportAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase

public override void ExecuteCmdlet()
{
if (ConcurrentFileCount != -1)
{
WriteWarning(Resources.IncorrectConcurrentFileCountWarning);
}
if (PerFileThreadCount != -1)
{
WriteWarning(Resources.IncorrectPerFileThreadCountWarning);
}
var powerShellSourcePath = SessionState.Path.GetUnresolvedProviderPathFromPSPath(Path);
ConfirmAction(
Resources.UploadFileMessage,
Expand All @@ -160,24 +133,7 @@ public override void ExecuteCmdlet()
DataLakeStoreFileSystemClient.SetupFileLogging(DiagnosticLogLevel, diagnosticPath);
}

int threadCount;
// If concurrency is specified then accept that
if (Concurrency > 0)
{
threadCount = Concurrency;
}
else if (ConcurrentFileCount > 0 && PerFileThreadCount <= 0)
{
threadCount = ConcurrentFileCount;
}
else if (ConcurrentFileCount <= 0 && PerFileThreadCount > 0)
{
threadCount = PerFileThreadCount;
}
else
{
threadCount = Math.Min(PerFileThreadCount * ConcurrentFileCount, DataLakeStoreFileSystemClient.ImportExportMaxThreads);
}
int threadCount = Concurrency;
DataLakeStoreFileSystemClient.BulkCopy(Destination.TransformedPath, Account,
powerShellSourcePath, CmdletCancellationToken, threadCount, Recurse, Force, Resume, false, this, ForceBinary);
// only attempt to write output if this cmdlet hasn't been cancelled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using System;
using Microsoft.Azure.Commands.DataLakeStore.Models;
using Microsoft.Azure.Commands.DataLakeStore.Properties;
using System.Management.Automation;
using Microsoft.Azure.DataLake.Store;

namespace Microsoft.Azure.Commands.DataLakeStore
{
Expand All @@ -41,12 +39,6 @@ public class RemoveAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase
HelpMessage = "Indicates the user wants a recursive delete of the folder.")]
public SwitchParameter Recurse { get; set; }

[Obsolete("Parameter Clean of RemoveAzureDataLakeStoreItem is deprecated. This parameter will be removed in future releases.")]
[Parameter(ValueFromPipelineByPropertyName = true, Position = 3, Mandatory = false,
HelpMessage =
"Indicates the user wants to remove all of the contents of the folder, but not the folder itself")]
public SwitchParameter Clean { get; set; }

[Parameter(ValueFromPipelineByPropertyName = true, Position = 4, Mandatory = false,
HelpMessage =
"Indicates delete should be performed without prompting."
Expand All @@ -61,17 +53,9 @@ public class RemoveAzureDataLakeStoreItem : DataLakeStoreFileSystemCmdletBase

public override void ExecuteCmdlet()
{
if (Clean)
{
WriteWarning(Resources.IncorrectCleanWarning);
}
bool success = true;
foreach (var path in Paths)
{
DirectoryEntryType testClean;
var pathExists = DataLakeStoreFileSystemClient.TestFileOrFolderExistence(path.TransformedPath,
Account, out testClean);

ConfirmAction(
Force.IsPresent,
string.Format(Resources.RemovingDataLakeStoreItem, path.OriginalPath),
Expand All @@ -83,11 +67,6 @@ public override void ExecuteCmdlet()
success &&
DataLakeStoreFileSystemClient.DeleteFileOrFolder(path.TransformedPath, Account,
Recurse);
if (pathExists && testClean == DirectoryEntryType.DIRECTORY && Clean)
{
// recreate the directory as an empty directory if clean was specified.
DataLakeStoreFileSystemClient.CreateDirectory(path.TransformedPath, Account);
}
if (PassThru)
{
WriteObject(success);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,6 @@
<data name="IncorrectOutputTypeWarning" xml:space="preserve">
<value>The output type defined for this cmdlet is incorrect and will be updated to reflect what is actually returned (and defined in the help) in a future release.</value>
</data>
<data name="IncorrectPerFileThreadCountWarning" xml:space="preserve">
<value>Parameter PerFileThreadCount is deprecated. This parameter will be removed in future releases. Please use Concurrency parameter instead.</value>
</data>
<data name="IncorrectConcurrentFileCountWarning" xml:space="preserve">
<value>Parameter ConcurrentFileCount is deprecated. This parameter will be removed in future releases. Please use Concurrency parameter instead.</value>
</data>
<data name="IncorrectCleanWarning" xml:space="preserve">
<value>Parameter Clean is deprecated. This parameter will be removed in future releases.</value>
</data>
<data name="InvalidAce" xml:space="preserve">
<value>Invalid ACE returned. Expected ACE format: '[default]:&lt;scope&gt;:&lt;identity&gt;:&lt;permissions&gt;'. Actual ACE: {0}</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.Commands.DataLakeStore.dll-Help.xml
Module Name: AzureRM.DataLakeStore
ms.assetid: C6FD4734-720C-4C8C-9B58-EDB331DD6415
Expand Down Expand Up @@ -69,7 +69,7 @@ The end of the valid ip range for the firewall rule
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 3
Expand All @@ -84,7 +84,7 @@ The name of the firewall rule to add.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 1
Expand All @@ -99,7 +99,7 @@ Name of resource group under which the account to add the firewall rule is.
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 4
Expand All @@ -114,7 +114,7 @@ The start of the valid ip range for the firewall rule
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 2
Expand Down Expand Up @@ -167,4 +167,3 @@ The firewall rule that was added.
## NOTES

## RELATED LINKS

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.Commands.DataLakeStore.dll-Help.xml
Module Name: AzureRM.DataLakeStore
ms.assetid: B008028D-27FC-4469-BE71-54F7218C068B
Expand Down Expand Up @@ -82,7 +82,7 @@ The acceptable values for this parameter are:
```yaml
Type: FileSystemCmdletProviderEncoding
Parameter Sets: (All)
Aliases:
Aliases:
Accepted values: Unknown, String, Unicode, Byte, BigEndianUnicode, UTF8, UTF7, UTF32, Ascii, Default, Oem, BigEndianUTF32

Required: False
Expand All @@ -98,7 +98,7 @@ Specifies the Data Lake Store path of the item to modify, starting with the root
```yaml
Type: DataLakeStorePathInstance
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 1
Expand All @@ -113,7 +113,7 @@ Specifies the content to add to the item.
```yaml
Type: Object
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
external help file: Microsoft.Azure.Commands.DataLakeStore.dll-Help.xml
Module Name: AzureRM.DataLakeStore
ms.assetid: 5C788778-58A4-4798-AB66-1D3562BB9338
Expand Down Expand Up @@ -69,7 +69,7 @@ The name of the trusted identity provider to add
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 1
Expand All @@ -84,7 +84,7 @@ The valid trusted provider endpoint in the format: https://sts.windows.net/\<pro
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: True
Position: 2
Expand All @@ -99,7 +99,7 @@ Name of resource group under which the account to add the trusted identity provi
```yaml
Type: String
Parameter Sets: (All)
Aliases:
Aliases:

Required: False
Position: 3
Expand Down Expand Up @@ -152,4 +152,3 @@ The added Trusted Identity Provider.
## NOTES

## RELATED LINKS

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
Module Name: AzureRM.DataLakeStore
Module Guid: 90dfd814-abce-4e1f-99b6-fe16760c079a
Download Help Link: None
Expand Down
Loading