Skip to content

Commit

Permalink
Replace Impl suffix with Core (#7868)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLove-msft authored Oct 3, 2019
1 parent 60f26b7 commit 01e7527
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ internal AppendBlobClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="AppendBlobClient"/> instance.</returns>
public new AppendBlobClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) => (AppendBlobClient)WithCustomerProvidedKeyImpl(customerProvidedKey);
public new AppendBlobClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) => (AppendBlobClient)WithCustomerProvidedKeyCore(customerProvidedKey);

/// <summary>
/// Creates a new instance of the <see cref="AppendBlobClient"/> class
Expand All @@ -228,7 +228,7 @@ internal AppendBlobClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="AppendBlobClient"/> instance.</returns>
protected sealed override BlobBaseClient WithCustomerProvidedKeyImpl(CustomerProvidedKey customerProvidedKey)
protected sealed override BlobBaseClient WithCustomerProvidedKeyCore(CustomerProvidedKey customerProvidedKey)
{
var uriBuilder = new UriBuilder(Uri)
{
Expand Down
8 changes: 4 additions & 4 deletions sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ internal BlobBaseClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions op
/// Pass null or empty string to remove the snapshot returning a URL
/// to the base blob.
/// </remarks>
public virtual BlobBaseClient WithSnapshot(string snapshot) => WithSnapshotImpl(snapshot);
public virtual BlobBaseClient WithSnapshot(string snapshot) => WithSnapshotCore(snapshot);

/// <summary>
/// Creates a new instance of the <see cref="BlobClient"/> class
Expand All @@ -306,7 +306,7 @@ internal BlobBaseClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions op
/// </summary>
/// <param name="snapshot">The snapshot identifier.</param>
/// <returns>A new <see cref="BlobClient"/> instance.</returns>
protected virtual BlobBaseClient WithSnapshotImpl(string snapshot)
protected virtual BlobBaseClient WithSnapshotCore(string snapshot)
{
var builder = new BlobUriBuilder(Uri) { Snapshot = snapshot };
return new BlobBaseClient(builder.ToUri(), Pipeline);
Expand All @@ -322,7 +322,7 @@ protected virtual BlobBaseClient WithSnapshotImpl(string snapshot)
/// </param>
/// <returns>A new <see cref="BlobClient"/></returns>
public virtual BlobBaseClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) =>
WithCustomerProvidedKeyImpl(customerProvidedKey);
WithCustomerProvidedKeyCore(customerProvidedKey);

/// <summary>
/// Creates a new instance of the <see cref="BlobClient"/> class
Expand All @@ -333,7 +333,7 @@ public virtual BlobBaseClient WithCustomerProvidedKey(CustomerProvidedKey custom
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="BlobClient"/></returns>
protected virtual BlobBaseClient WithCustomerProvidedKeyImpl(CustomerProvidedKey customerProvidedKey)
protected virtual BlobBaseClient WithCustomerProvidedKeyCore(CustomerProvidedKey customerProvidedKey)
{
var uriBuilder = new UriBuilder(Uri)
{
Expand Down
8 changes: 4 additions & 4 deletions sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ internal BlockBlobClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions o
/// Pass null or empty string to remove the snapshot returning a URL
/// to the base blob.
/// </remarks>
public new BlockBlobClient WithSnapshot(string snapshot) => (BlockBlobClient)WithSnapshotImpl(snapshot);
public new BlockBlobClient WithSnapshot(string snapshot) => (BlockBlobClient)WithSnapshotCore(snapshot);

/// <summary>
/// Creates a new instance of the <see cref="BlockBlobClient"/> class
Expand All @@ -265,7 +265,7 @@ internal BlockBlobClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions o
/// </summary>
/// <param name="snapshot">The snapshot identifier.</param>
/// <returns>A new <see cref="BlockBlobClient"/> instance.</returns>
protected sealed override BlobBaseClient WithSnapshotImpl(string snapshot)
protected sealed override BlobBaseClient WithSnapshotCore(string snapshot)
{
var builder = new BlobUriBuilder(Uri) { Snapshot = snapshot };
return new BlockBlobClient(builder.ToUri(), Pipeline);
Expand All @@ -280,7 +280,7 @@ protected sealed override BlobBaseClient WithSnapshotImpl(string snapshot)
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="BlockBlobClient"/> instance.</returns>
public new BlockBlobClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) => (BlockBlobClient)WithCustomerProvidedKeyImpl(customerProvidedKey);
public new BlockBlobClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) => (BlockBlobClient)WithCustomerProvidedKeyCore(customerProvidedKey);

/// <summary>
/// Creates a new instance of the <see cref="BlockBlobClient"/> class
Expand All @@ -291,7 +291,7 @@ protected sealed override BlobBaseClient WithSnapshotImpl(string snapshot)
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="BlockBlobClient"/> instance.</returns>
protected sealed override BlobBaseClient WithCustomerProvidedKeyImpl(CustomerProvidedKey customerProvidedKey)
protected sealed override BlobBaseClient WithCustomerProvidedKeyCore(CustomerProvidedKey customerProvidedKey)
{
var uriBuilder = new UriBuilder(Uri)
{
Expand Down
8 changes: 4 additions & 4 deletions sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ internal PageBlobClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions op
/// Pass null or empty string to remove the snapshot returning a URL
/// to the base blob.
/// </remarks>
public new PageBlobClient WithSnapshot(string snapshot) => (PageBlobClient)WithSnapshotImpl(snapshot);
public new PageBlobClient WithSnapshot(string snapshot) => (PageBlobClient)WithSnapshotCore(snapshot);

/// <summary>
/// Creates a new instance of the <see cref="PageBlobClient"/> class
Expand All @@ -210,7 +210,7 @@ internal PageBlobClient(Uri blobUri, HttpPipeline pipeline, BlobClientOptions op
/// </summary>
/// <param name="snapshot">The snapshot identifier.</param>
/// <returns>A new <see cref="PageBlobClient"/> instance.</returns>
protected sealed override BlobBaseClient WithSnapshotImpl(string snapshot)
protected sealed override BlobBaseClient WithSnapshotCore(string snapshot)
{
var builder = new BlobUriBuilder(Uri) { Snapshot = snapshot };
return new PageBlobClient(builder.ToUri(), Pipeline);
Expand All @@ -225,7 +225,7 @@ protected sealed override BlobBaseClient WithSnapshotImpl(string snapshot)
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="PageBlobClient"/> instance.</returns>
public new PageBlobClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) => (PageBlobClient)WithCustomerProvidedKeyImpl(customerProvidedKey);
public new PageBlobClient WithCustomerProvidedKey(CustomerProvidedKey customerProvidedKey) => (PageBlobClient)WithCustomerProvidedKeyCore(customerProvidedKey);

/// <summary>
/// Creates a new instance of the <see cref="PageBlobClient"/> class
Expand All @@ -236,7 +236,7 @@ protected sealed override BlobBaseClient WithSnapshotImpl(string snapshot)
/// The customer provided key to be used by the service to encrypt data.
/// </param>
/// <returns>A new <see cref="PageBlobClient"/> instance.</returns>
protected sealed override BlobBaseClient WithCustomerProvidedKeyImpl(CustomerProvidedKey customerProvidedKey)
protected sealed override BlobBaseClient WithCustomerProvidedKeyCore(CustomerProvidedKey customerProvidedKey)
{
var uriBuilder = new UriBuilder(Uri)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public static StorageConnectionString Parse(string connectionString)
throw Errors.ArgumentNull(nameof(connectionString));
}

if (ParseImpl(connectionString, out StorageConnectionString ret, err => { throw Errors.InvalidFormat(err); }))
if (ParseCore(connectionString, out StorageConnectionString ret, err => { throw Errors.InvalidFormat(err); }))
{
return ret;
}
Expand All @@ -349,7 +349,7 @@ public static bool TryParse(string connectionString, out StorageConnectionString

try
{
return ParseImpl(connectionString, out account, err => { });
return ParseCore(connectionString, out account, err => { });
}
catch (Exception)
{
Expand Down Expand Up @@ -532,7 +532,7 @@ private static StorageConnectionString GetDevelopmentStorageAccount(Uri proxyUri
/// <param name="accountInformation">The <see cref="StorageConnectionString"/> to return.</param>
/// <param name="error">A callback for reporting errors.</param>
/// <returns>If true, the parse was successful. Otherwise, false.</returns>
internal static bool ParseImpl(string connectionString, out StorageConnectionString accountInformation, Action<string> error)
internal static bool ParseCore(string connectionString, out StorageConnectionString accountInformation, Action<string> error)
{
IDictionary<string, string> settings = ParseStringIntoSettings(connectionString, error);

Expand Down
4 changes: 2 additions & 2 deletions sdk/storage/Azure.Storage.Common/src/StreamPartition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public StreamPartition(ReadOnlyMemory<byte> buffer, long parentPosition, int cou
_disposeAction = disposeAction;
//this.disposalTaskCompletionSource = new ManualResetEventSlim(false);
_disposalTaskCompletionSource = new SemaphoreSlim(0);
DisposalTask = DisposalTaskImpl(ct);
DisposalTask = DisposalTaskCore(ct);
}

#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
private async Task DisposalTaskImpl(CancellationToken ct)
private async Task DisposalTaskCore(CancellationToken ct)
{
//Console.WriteLine($"Waiting for partition {this.ParentPosition}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public static async Task CopyToAsync(
{
if (async)
{
await copyImpl(partition).ConfigureAwait(false);
await copyCore(partition).ConfigureAwait(false);
}
else
{
copyImpl(partition).EnsureCompleted();
copyCore(partition).EnsureCompleted();
}
}

async Task copyImpl(StreamPartition partition)
async Task copyCore(StreamPartition partition)
{
// if the destination is seekable, ensure we position it correctly,
// else we trust the partitions are received in order and just write
Expand Down
12 changes: 6 additions & 6 deletions sdk/storage/Azure.Storage.Common/src/StreamPartitioner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal class StreamPartitioner : IDisposable
{
private MemoryPool<byte> _memoryPool;
private readonly long? _contentLength;
private Func<int, bool, CancellationToken, Task<StreamPartition>> _getNextPartitionImpl;
private Func<int, bool, CancellationToken, Task<StreamPartition>> _getNextPartitionCore;

public StreamPartitioner(Stream stream, MemoryPool<byte> memoryPool = default)
{
Expand All @@ -27,14 +27,14 @@ public StreamPartitioner(Stream stream, MemoryPool<byte> memoryPool = default)
_contentLength = stream.Length;
}
_memoryPool = memoryPool ?? MemoryPool<byte>.Shared;
_getNextPartitionImpl = (size, async, ct) => GetNextPartitionAsync(stream, size, async, ct);
_getNextPartitionCore = (size, async, ct) => GetNextPartitionAsync(stream, size, async, ct);
}

public StreamPartitioner(FileInfo file, MemoryPool<byte> memoryPool = default)
{
_contentLength = file.Length;
_memoryPool = memoryPool ?? MemoryPool<byte>.Shared;
_getNextPartitionImpl = (size, async, ct) => GetNextPartitionAsync(file, size, async, ct);
_getNextPartitionCore = (size, async, ct) => GetNextPartitionAsync(file, size, async, ct);
}

public async IAsyncEnumerable<StreamPartition> GetPartitionsAsync(
Expand Down Expand Up @@ -157,9 +157,9 @@ public async IAsyncEnumerable<StreamPartition> GetPartitionsAsync(
}

internal Task<StreamPartition> GetNextPartitionAsync(int size = Constants.DefaultBufferSize, bool async = true, CancellationToken ct = default)
=> _getNextPartitionImpl == default
=> _getNextPartitionCore == default
? throw new ObjectDisposedException(nameof(StreamPartitioner))
: _getNextPartitionImpl(size, async, ct);
: _getNextPartitionCore(size, async, ct);

private readonly SemaphoreSlim _getNextPartitionAsync_Semaphore = new SemaphoreSlim(1, 1);

Expand Down Expand Up @@ -286,7 +286,7 @@ protected virtual void Dispose(bool disposing)
{
}

_getNextPartitionImpl = default;
_getNextPartitionCore = default;
_memoryPool = default;

_disposedValue = true;
Expand Down

0 comments on commit 01e7527

Please sign in to comment.