diff --git a/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter.cs b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporter.cs similarity index 98% rename from csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter.cs rename to csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporter.cs index b895e53331..f96931db6c 100644 --- a/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter.cs +++ b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporter.cs @@ -23,12 +23,10 @@ using OpenTelemetry; using System.Collections.Concurrent; using System.IO; -using System.Linq; using System.Collections.Generic; -using System.Security.Cryptography; using System.Text; -namespace Apache.Arrow.Adbc.Tracing +namespace Apache.Arrow.Adbc.Tracing.FileExporter { internal class FileExporter : BaseExporter { @@ -105,7 +103,7 @@ internal static void ValidParameters(string fileBaseName, string traceLocation, throw new ArgumentNullException(nameof(fileBaseName)); if (fileBaseName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0) throw new ArgumentException("Invalid or unsupported file name", nameof(fileBaseName)); - if ((string.IsNullOrWhiteSpace(traceLocation) || (traceLocation.IndexOfAny(Path.GetInvalidPathChars()) >= 0))) + if (string.IsNullOrWhiteSpace(traceLocation) || traceLocation.IndexOfAny(Path.GetInvalidPathChars()) >= 0) throw new ArgumentException("Invalid or unsupported folder name", nameof(traceLocation)); if (maxTraceFileSizeKb < 1) throw new ArgumentException("maxTraceFileSizeKb must be greater than zero", nameof(maxTraceFileSizeKb)); diff --git a/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporterExtensions.cs b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporterExtensions.cs similarity index 97% rename from csharp/src/Apache.Arrow.Adbc/Tracing/FileExporterExtensions.cs rename to csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporterExtensions.cs index 373e24ffce..20451c6247 100644 --- a/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporterExtensions.cs +++ b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporterExtensions.cs @@ -21,7 +21,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; -namespace Apache.Arrow.Adbc.Tracing +namespace Apache.Arrow.Adbc.Tracing.FileExporter { public static class FileExporterExtensions { @@ -38,7 +38,7 @@ public static class FileExporterExtensions /// Note that only one global instance of the exporter is added. /// If there is already an existing exporter for the same source and location, no new one is added. /// - public static TracerProviderBuilder AddAdbcFileExporter(this TracerProviderBuilder builder,Action? configure = default) + public static TracerProviderBuilder AddAdbcFileExporter(this TracerProviderBuilder builder, Action? configure = default) => builder.AddAdbcFileExporter(null, configure); /// diff --git a/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporterOptions.cs b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporterOptions.cs similarity index 97% rename from csharp/src/Apache.Arrow.Adbc/Tracing/FileExporterOptions.cs rename to csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporterOptions.cs index 4bc6697779..8aed09e23b 100644 --- a/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporterOptions.cs +++ b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/FileExporterOptions.cs @@ -15,7 +15,7 @@ * limitations under the License. */ -namespace Apache.Arrow.Adbc.Tracing +namespace Apache.Arrow.Adbc.Tracing.FileExporter { /// /// The options an uses to trace active to files. diff --git a/csharp/src/Apache.Arrow.Adbc/Tracing/TracingFile.cs b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/TracingFile.cs similarity index 98% rename from csharp/src/Apache.Arrow.Adbc/Tracing/TracingFile.cs rename to csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/TracingFile.cs index 5d54e482d4..66af2dbc38 100644 --- a/csharp/src/Apache.Arrow.Adbc/Tracing/TracingFile.cs +++ b/csharp/src/Apache.Arrow.Adbc/Tracing/FileExporter/TracingFile.cs @@ -22,7 +22,7 @@ using System.Threading; using System.Threading.Tasks; -namespace Apache.Arrow.Adbc.Tracing +namespace Apache.Arrow.Adbc.Tracing.FileExporter { /// /// Provides access to writing trace files, limiting the @@ -107,7 +107,7 @@ private async Task WriteLinesAsync(IAsyncEnumerable streams) await stream.CopyToAsync(fileStream); _currentTraceFileInfo.Refresh(); - if (_currentTraceFileInfo.Length >= (_maxFileSizeKb * 1024)) + if (_currentTraceFileInfo.Length >= _maxFileSizeKb * 1024) { hasMoreData = true; newFileRequired = true; diff --git a/csharp/src/Apache.Arrow.Adbc/Tracing/TracingBase.cs b/csharp/src/Apache.Arrow.Adbc/Tracing/TracingBase.cs index 103d2810be..9795c1bf7e 100644 --- a/csharp/src/Apache.Arrow.Adbc/Tracing/TracingBase.cs +++ b/csharp/src/Apache.Arrow.Adbc/Tracing/TracingBase.cs @@ -20,7 +20,6 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; -using System.Threading; using System.Threading.Tasks; namespace Apache.Arrow.Adbc.Tracing diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/TracingFileExporterTests.cs b/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/FileExporter/TracingFileExporterTests.cs similarity index 99% rename from csharp/test/Apache.Arrow.Adbc.Tests/Tracing/TracingFileExporterTests.cs rename to csharp/test/Apache.Arrow.Adbc.Tests/Tracing/FileExporter/TracingFileExporterTests.cs index 7a3966651b..3b26a51503 100644 --- a/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/TracingFileExporterTests.cs +++ b/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/FileExporter/TracingFileExporterTests.cs @@ -19,15 +19,15 @@ using System.Diagnostics; using System.IO; using System.Linq; -using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; using Apache.Arrow.Adbc.Tracing; +using Apache.Arrow.Adbc.Tracing.FileExporter; using OpenTelemetry; using OpenTelemetry.Trace; using Xunit; using Xunit.Abstractions; -namespace Apache.Arrow.Adbc.Tests.Tracing +namespace Apache.Arrow.Adbc.Tests.Tracing.FileExporter { public class TracingFileExporterTests : IDisposable { diff --git a/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/TracingPerformance.cs b/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/FileExporter/TracingPerformance.cs similarity index 98% rename from csharp/test/Apache.Arrow.Adbc.Tests/Tracing/TracingPerformance.cs rename to csharp/test/Apache.Arrow.Adbc.Tests/Tracing/FileExporter/TracingPerformance.cs index 9394bb322b..50f25dfbf0 100644 --- a/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/TracingPerformance.cs +++ b/csharp/test/Apache.Arrow.Adbc.Tests/Tracing/FileExporter/TracingPerformance.cs @@ -22,6 +22,7 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using Apache.Arrow.Adbc.Tracing; +using Apache.Arrow.Adbc.Tracing.FileExporter; using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Mathematics; using BenchmarkDotNet.Reports; @@ -31,7 +32,7 @@ using Xunit; using Xunit.Abstractions; -namespace Apache.Arrow.Adbc.Tests.Tracing +namespace Apache.Arrow.Adbc.Tests.Tracing.FileExporter { public class TracingPerformance(ITestOutputHelper outputHelper) {