Skip to content

Commit 7cf8349

Browse files
authored
[Event Hubs Client] Formatting Pass (Azure#18356)
The purpose of these changes is to format code to apply project conventions for consistency and in some cases, update member names and documentation to better convey context. **Note:** These changes are intended to be superficial; no change to existing behavior should have taken place.
1 parent 061c377 commit 7cf8349

34 files changed

+335
-203
lines changed

sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Diagnostics/BlobEventStoreEventSource.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ public virtual void UpdateCheckpointStart(string partitionId,
341341
/// <param name="consumerGroup">The name of the consumer group the checkpoint is associated with.</param>
342342
///
343343
[Event(33, Level = EventLevel.Informational, Message = "Completed the attempt to create/update a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'.")]
344-
public virtual void UpdateCheckpointComplete(string partitionId,
345-
string fullyQualifiedNamespace,
346-
string eventHubName,
347-
string consumerGroup)
344+
public virtual void UpdateCheckpointComplete(string partitionId,
345+
string fullyQualifiedNamespace,
346+
string eventHubName,
347+
string consumerGroup)
348348
{
349349
if (IsEnabled())
350350
{
@@ -363,11 +363,11 @@ public virtual void UpdateCheckpointComplete(string partitionId,
363363
/// <param name="errorMessage">The message for the exception that occurred.</param>
364364
///
365365
[Event(34, Level = EventLevel.Error, Message = "An exception occurred when creating/updating a checkpoint for partition: `{0}` of FullyQualifiedNamespace: '{1}'; EventHubName: '{2}'; ConsumerGroup: '{3}'. ErrorMessage: '{4}'.")]
366-
public virtual void UpdateCheckpointError(string partitionId,
367-
string fullyQualifiedNamespace,
368-
string eventHubName,
369-
string consumerGroup,
370-
string errorMessage)
366+
public virtual void UpdateCheckpointError(string partitionId,
367+
string fullyQualifiedNamespace,
368+
string eventHubName,
369+
string consumerGroup,
370+
string errorMessage)
371371
{
372372
if (IsEnabled())
373373
{

sdk/eventhub/Azure.Messaging.EventHubs.Processor/src/Storage/BlobsCheckpointStore.Diagnostics.cs

Lines changed: 78 additions & 19 deletions
Large diffs are not rendered by default.

sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/CheckpointStore/BlobsCheckpointStoreTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ public async Task GetCheckpointLogsStartAndComplete()
14661466
await target.GetCheckpointAsync(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0", new CancellationToken());
14671467

14681468
mockLog.Verify(m => m.GetCheckpointStart(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0"));
1469-
mockLog.Verify(m => m.GetCheckpointComplete(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0"));
1469+
mockLog.Verify(m => m.GetCheckpointComplete(FullyQualifiedNamespace, EventHubName, ConsumerGroup, "0"));
14701470
}
14711471

14721472
/// <summary>

sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Infrastructure/StorageTestEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace Azure.Messaging.EventHubs.Processor.Tests
1313
/// being run, offering access to information such as environment variables.
1414
/// </summary>
1515
///
16-
public class StorageTestEnvironment: TestEnvironment
16+
public class StorageTestEnvironment : TestEnvironment
1717
{
1818
/// <summary>The singleton instance of the <see cref="StorageTestEnvironment" />, lazily created.</summary>
1919
private static readonly Lazy<StorageTestEnvironment> Singleton = new Lazy<StorageTestEnvironment>(() => new StorageTestEnvironment(), LazyThreadSafetyMode.ExecutionAndPublication);

sdk/eventhub/Azure.Messaging.EventHubs.Processor/tests/Processor/EventProcessorClientLiveTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public async Task EventsCanBeReadByOneProcessorClient(LoadBalancingStrategy load
4747
var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName);
4848

4949
using var cancellationSource = new CancellationTokenSource();
50-
cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit);
50+
cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit);
5151

5252
// Send a set of events.
5353

@@ -79,7 +79,7 @@ public async Task EventsCanBeReadByOneProcessorClient(LoadBalancingStrategy load
7979
foreach (var sourceEvent in sourceEvents)
8080
{
8181
var sourceId = sourceEvent.Properties[EventGenerator.IdPropertyName].ToString();
82-
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed." );
82+
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed.");
8383
Assert.That(sourceEvent.IsEquivalentTo(processedEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event.");
8484
}
8585
}
@@ -97,7 +97,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingAnIdentityCredential()
9797
var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName);
9898

9999
using var cancellationSource = new CancellationTokenSource();
100-
cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit);
100+
cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit);
101101

102102
// Send a set of events.
103103

@@ -129,7 +129,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingAnIdentityCredential()
129129
foreach (var sourceEvent in sourceEvents)
130130
{
131131
var sourceId = sourceEvent.Properties[EventGenerator.IdPropertyName].ToString();
132-
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed." );
132+
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed.");
133133
Assert.That(sourceEvent.IsEquivalentTo(processedEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event.");
134134
}
135135
}
@@ -148,7 +148,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingTheSharedKeyCredential
148148
var connectionString = EventHubsTestEnvironment.Instance.BuildConnectionStringForEventHub(scope.EventHubName);
149149

150150
using var cancellationSource = new CancellationTokenSource();
151-
cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit);
151+
cancellationSource.CancelAfter(EventHubsTestEnvironment.Instance.TestExecutionTimeLimit);
152152

153153
// Send a set of events.
154154

@@ -180,7 +180,7 @@ public async Task EventsCanBeReadByOneProcessorClientUsingTheSharedKeyCredential
180180
foreach (var sourceEvent in sourceEvents)
181181
{
182182
var sourceId = sourceEvent.Properties[EventGenerator.IdPropertyName].ToString();
183-
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed." );
183+
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed.");
184184
Assert.That(sourceEvent.IsEquivalentTo(processedEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event.");
185185
}
186186
}
@@ -244,7 +244,7 @@ public async Task EventsCanBeReadByMultipleProcessorClients()
244244
foreach (var sourceEvent in sourceEvents)
245245
{
246246
var sourceId = sourceEvent.Properties[EventGenerator.IdPropertyName].ToString();
247-
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed." );
247+
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed.");
248248
Assert.That(sourceEvent.IsEquivalentTo(processedEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event.");
249249
}
250250
}
@@ -288,7 +288,7 @@ public async Task ProcessorClientCreatesOwnership()
288288

289289
var processedEvents = new ConcurrentDictionary<string, EventData>();
290290
var completionSource = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
291-
var storageManager = new InMemoryStorageManager(_ => {});
291+
var storageManager = new InMemoryStorageManager(_ => { });
292292
var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250) };
293293
var processor = CreateProcessorWithIdentity(scope.ConsumerGroups.First(), scope.EventHubName, storageManager, options);
294294

@@ -346,7 +346,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition()
346346

347347
await using (var consumer = new EventHubConsumerClient(scope.ConsumerGroups.First(), connectionString))
348348
{
349-
await foreach (var partitionEvent in consumer.ReadEventsAsync(new ReadEventOptions { MaximumWaitTime = null }, cancellationSource.Token))
349+
await foreach (var partitionEvent in consumer.ReadEventsAsync(new ReadEventOptions { MaximumWaitTime = null }, cancellationSource.Token))
350350
{
351351
if (partitionEvent.Data.IsEquivalentTo(lastSourceEvent))
352352
{
@@ -393,7 +393,7 @@ public async Task ProcessorClientCanStartFromAnInitialPosition()
393393
foreach (var sourceEvent in sourceEvents)
394394
{
395395
var sourceId = sourceEvent.Properties[EventGenerator.IdPropertyName].ToString();
396-
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed." );
396+
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed.");
397397
Assert.That(sourceEvent.IsEquivalentTo(processedEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event.");
398398
}
399399
}
@@ -438,7 +438,7 @@ public async Task ProcessorClientBeginsWithTheNextEventAfterCheckpointing()
438438
var completionSource = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
439439
var beforeCheckpointProcessHandler = CreateEventTrackingHandler(segmentEventCount, processedEvents, completionSource, cancellationSource.Token, processedEventCallback);
440440
var options = new EventProcessorOptions { LoadBalancingUpdateInterval = TimeSpan.FromMilliseconds(250) };
441-
var storageManager = new InMemoryStorageManager(_ => {});
441+
var storageManager = new InMemoryStorageManager(_ => { });
442442
var processor = CreateProcessor(scope.ConsumerGroups.First(), connectionString, storageManager, options);
443443

444444
processor.ProcessErrorAsync += CreateAssertingErrorHandler();
@@ -476,7 +476,7 @@ public async Task ProcessorClientBeginsWithTheNextEventAfterCheckpointing()
476476
foreach (var sourceEvent in afterCheckpointEvents)
477477
{
478478
var sourceId = sourceEvent.Properties[EventGenerator.IdPropertyName].ToString();
479-
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed." );
479+
Assert.That(processedEvents.TryGetValue(sourceId, out var processedEvent), Is.True, $"The event with custom identifier [{ sourceId }] was not processed.");
480480
Assert.That(sourceEvent.IsEquivalentTo(processedEvent), $"The event with custom identifier [{ sourceId }] did not match the corresponding processed event.");
481481
}
482482
}
@@ -500,7 +500,7 @@ private EventProcessorClient CreateProcessor(string consumerGroup,
500500
{
501501
EventHubConnection createConnection() => new EventHubConnection(connectionString);
502502

503-
storageManager ??= new InMemoryStorageManager(_=> {});
503+
storageManager ??= new InMemoryStorageManager(_ => { });
504504
return new TestEventProcessorClient(storageManager, consumerGroup, "fakeNamespace", "fakeEventHub", Mock.Of<TokenCredential>(), createConnection, options);
505505
}
506506

@@ -524,7 +524,7 @@ private EventProcessorClient CreateProcessorWithIdentity(string consumerGroup,
524524
var credential = EventHubsTestEnvironment.Instance.Credential;
525525
EventHubConnection createConnection() => new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, eventHubName, credential);
526526

527-
storageManager ??= new InMemoryStorageManager(_=> {});
527+
storageManager ??= new InMemoryStorageManager(_ => { });
528528
return new TestEventProcessorClient(storageManager, consumerGroup, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, eventHubName, credential, createConnection, options);
529529
}
530530

@@ -548,7 +548,7 @@ private EventProcessorClient CreateProcessorWithSharedAccessKey(string consumerG
548548
var credential = new EventHubsSharedAccessKeyCredential(EventHubsTestEnvironment.Instance.SharedAccessKeyName, EventHubsTestEnvironment.Instance.SharedAccessKey);
549549
EventHubConnection createConnection() => null; //new EventHubConnection(EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, eventHubName, credential);
550550

551-
storageManager ??= new InMemoryStorageManager(_=> {});
551+
storageManager ??= new InMemoryStorageManager(_ => { });
552552
return new TestEventProcessorClient(storageManager, consumerGroup, EventHubsTestEnvironment.Instance.FullyQualifiedNamespace, eventHubName, credential, createConnection, options);
553553
}
554554

@@ -621,7 +621,7 @@ private Func<ProcessEventArgs, Task> CreateEventTrackingHandler(int targetCount,
621621

622622
if (processedEvents.Count >= targetCount)
623623
{
624-
completionSource.TrySetResult(true);
624+
completionSource.TrySetResult(true);
625625
}
626626
}
627627
}

0 commit comments

Comments
 (0)