-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1997-multiple-connection-support
- Loading branch information
Showing
27 changed files
with
758 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 4 additions & 6 deletions
10
src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/BatchSerializationResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/OpenTelemetry.Exporter.OneCollector/Internal/Serialization/BatchSerializationState.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Copyright The OpenTelemetry Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Note: StyleCop doesn't understand the C#11 "required" modifier yet. Remove | ||
// this in the future once StyleCop is updated. See: | ||
// https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/3527 | ||
|
||
#if NETSTANDARD2_1_OR_GREATER || NET | ||
using System.Diagnostics.CodeAnalysis; | ||
#endif | ||
|
||
namespace OpenTelemetry.Exporter.OneCollector; | ||
|
||
internal ref struct BatchSerializationState<T> | ||
where T : class | ||
{ | ||
private Batch<T>.Enumerator enumerator; | ||
|
||
public BatchSerializationState(in Batch<T> batch) | ||
{ | ||
this.enumerator = batch.GetEnumerator(); | ||
} | ||
|
||
public bool TryGetNextItem( | ||
#if NETSTANDARD2_1_OR_GREATER || NET | ||
[NotNullWhen(true)] | ||
#endif | ||
out T? item) | ||
{ | ||
if (this.enumerator.MoveNext()) | ||
{ | ||
item = this.enumerator.Current; | ||
return true; | ||
} | ||
|
||
item = null; | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.