Skip to content

Commit

Permalink
refactor file exporter namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
birschick-bq committed Feb 7, 2025
1 parent efe111c commit 5481238
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<Activity>
{
Expand Down Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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.
/// </remarks>
public static TracerProviderBuilder AddAdbcFileExporter(this TracerProviderBuilder builder,Action<FileExporterOptions>? configure = default)
public static TracerProviderBuilder AddAdbcFileExporter(this TracerProviderBuilder builder, Action<FileExporterOptions>? configure = default)
=> builder.AddAdbcFileExporter(null, configure);

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Apache.Arrow.Adbc.Tracing
namespace Apache.Arrow.Adbc.Tracing.FileExporter
{
/// <summary>
/// The options an <see cref="FileExporter"/> uses to trace active to files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace Apache.Arrow.Adbc.Tracing
namespace Apache.Arrow.Adbc.Tracing.FileExporter
{
/// <summary>
/// Provides access to writing trace files, limiting the
Expand Down Expand Up @@ -107,7 +107,7 @@ private async Task WriteLinesAsync(IAsyncEnumerable<Stream> streams)
await stream.CopyToAsync(fileStream);

_currentTraceFileInfo.Refresh();
if (_currentTraceFileInfo.Length >= (_maxFileSizeKb * 1024))
if (_currentTraceFileInfo.Length >= _maxFileSizeKb * 1024)
{
hasMoreData = true;
newFileRequired = true;
Expand Down
1 change: 0 additions & 1 deletion csharp/src/Apache.Arrow.Adbc/Tracing/TracingBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down

0 comments on commit 5481238

Please sign in to comment.