[#26] All: Remove V2 from naming #34

Merged
PavelGrossSpb merged 1 commit from PavelGrossSpb/frostfs-sdk-csharp:misc/remove_V2 into master 2024-11-18 09:42:22 +00:00
219 changed files with 219 additions and 974 deletions
Showing only changes of commit 766f61a5f7 - Show all commits

View file

@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrostFS.SDK.ClientV2", "src\FrostFS.SDK.ClientV2\FrostFS.SDK.ClientV2.csproj", "{50D8F61F-C302-4AC9-8D8A-AB0B8C0988C3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrostFS.SDK.Client", "src\FrostFS.SDK.Client\FrostFS.SDK.Client.csproj", "{50D8F61F-C302-4AC9-8D8A-AB0B8C0988C3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrostFS.SDK.Cryptography", "src\FrostFS.SDK.Cryptography\FrostFS.SDK.Cryptography.csproj", "{3D804F4A-B0B2-47A5-B006-BE447BE64B50}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrostFS.SDK.ProtosV2", "src\FrostFS.SDK.ProtosV2\FrostFS.SDK.ProtosV2.csproj", "{5012EF96-9C9E-4E77-BC78-B4111EE54107}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrostFS.SDK.Protos", "src\FrostFS.SDK.Protos\FrostFS.SDK.Protos.csproj", "{5012EF96-9C9E-4E77-BC78-B4111EE54107}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrostFS.SDK.Tests", "src\FrostFS.SDK.Tests\FrostFS.SDK.Tests.csproj", "{8FDA7E0D-9C75-4874-988E-6592CD28F76C}"
EndProject

View file

@ -1,6 +1,6 @@
using Microsoft.Extensions.Caching.Memory;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
internal static class Caches
{

View file

@ -4,7 +4,7 @@ using FrostFS.SDK.Cryptography;
using Google.Protobuf;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class ClientKey(ECDsa key)
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class FrostFsException : Exception
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class FrostFsInvalidObjectException : FrostFsException
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class FrostFsResponseException : FrostFsException
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class FrostFsStreamException : FrostFsException
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class SessionExpiredException : FrostFsException
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class SessionNotFoundException : FrostFsException
{

View file

@ -8,11 +8,11 @@
</PropertyGroup>
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
@ -30,7 +30,7 @@
<ItemGroup>
<ProjectReference Include="..\FrostFS.SDK.Cryptography\FrostFS.SDK.Cryptography.csproj" />
<ProjectReference Include="..\FrostFS.SDK.ProtosV2\FrostFS.SDK.ProtosV2.csproj" />
<ProjectReference Include="..\FrostFS.SDK.Protos\FrostFS.SDK.Protos.csproj" />
</ItemGroup>
</Project>

View file

@ -10,8 +10,8 @@ using FrostFS.Accounting;
using FrostFS.Container;
using FrostFS.Netmap;
using FrostFS.Object;
using FrostFS.SDK.ClientV2.Interfaces;
using FrostFS.SDK.ClientV2.Services;
using FrostFS.SDK.Client.Interfaces;
using FrostFS.SDK.Client.Services;
using FrostFS.SDK.Cryptography;
using FrostFS.Session;
@ -21,7 +21,7 @@ using Grpc.Net.Client;
using Microsoft.Extensions.Options;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class FrostFSClient : IFrostFSClient
{

View file

@ -5,4 +5,4 @@
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Security", "CA5394:Do not use insecure randomness", Justification = "<Pending>", Scope = "member", Target = "~M:FrostFS.SDK.ClientV2.Sampler.Next~System.Int32")]
[assembly: SuppressMessage("Security", "CA5394:Do not use insecure randomness", Justification = "<Pending>", Scope = "member", Target = "~M:FrostFS.SDK.Client.Sampler.Next~System.Int32")]

View file

@ -4,7 +4,7 @@ using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Interceptors;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods",
Justification = "parameters are provided by GRPC infrastructure")]

View file

@ -5,7 +5,7 @@ using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Interceptors;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1062:Validate arguments of public methods",
Justification = "parameters are provided by GRPC infrastructure")]

View file

@ -3,7 +3,8 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Frostfs.V2.Ape;
namespace FrostFS.SDK.ClientV2.Interfaces;
namespace FrostFS.SDK.Client.Interfaces;
public interface IFrostFSClient : IDisposable
{

View file

@ -1,6 +1,6 @@
using Microsoft.Extensions.Logging;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
internal static partial class FrostFsMessages
{

View file

@ -3,7 +3,7 @@ using System.Linq;
using FrostFS.SDK.Cryptography;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ContainerMapper
{

View file

@ -7,7 +7,7 @@ using Google.Protobuf;
using Microsoft.Extensions.Caching.Memory;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ContainerIdMapper
{

View file

@ -2,7 +2,7 @@ using System;
using FrostFS.Session;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class MetaHeaderMapper
{

View file

@ -3,7 +3,7 @@ using System.Linq;
using FrostFS.Netmap;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public static class NetmapMapper
{

View file

@ -2,9 +2,9 @@ using System;
using System.Linq;
using FrostFS.Netmap;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client.Mappers.GRPC;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public static class NodeInfoMapper
{

View file

@ -3,7 +3,7 @@ using System.Linq;
using FrostFS.Netmap;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public static class PlacementPolicyMapper
{

View file

@ -2,7 +2,7 @@ using System;
using FrostFS.Netmap;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public static class ReplicaMapper
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
internal static class ObjectMapper
{

View file

@ -2,7 +2,7 @@ using System;
using FrostFS.Object;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ObjectAttributeMapper
{

View file

@ -2,7 +2,7 @@ using System;
using FrostFS.Object;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ObjectFilterMapper
{

View file

@ -5,7 +5,7 @@ using System.Linq;
using FrostFS.Object;
using FrostFS.SDK.Cryptography;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ObjectHeaderMapper
{

View file

@ -4,7 +4,7 @@ using FrostFS.Refs;
using Google.Protobuf;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class ObjectIdMapper
{

View file

@ -7,7 +7,7 @@ using Google.Protobuf;
using Microsoft.Extensions.Caching.Memory;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class OwnerIdMapper
{

View file

@ -2,7 +2,7 @@ using System;
using Google.Protobuf;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public static class SessionMapper
{

View file

@ -2,7 +2,7 @@ using System;
using Google.Protobuf;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class SignatureMapper
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class StatusMapper
{

View file

@ -3,7 +3,7 @@ using System.Threading;
using FrostFS.Refs;
namespace FrostFS.SDK.ClientV2.Mappers.GRPC;
namespace FrostFS.SDK.Client.Mappers.GRPC;
public static class VersionMapper
{

View file

@ -2,7 +2,7 @@
using Frostfs.V2.Ape;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public struct FrostFsChainTarget(FrostFsTargetType type, string name) : IEquatable<FrostFsChainTarget>
{

View file

@ -1,6 +1,6 @@
using Google.Protobuf;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public struct FrostFsChain(byte[] raw) : System.IEquatable<FrostFsChain>
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public enum FrostFsTargetType
{

View file

@ -1,6 +1,6 @@
using FrostFS.Refs;
using FrostFS.SDK.ClientV2;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client;
using FrostFS.SDK.Client.Mappers.GRPC;
using FrostFS.SDK.Cryptography;
namespace FrostFS.SDK;

View file

@ -2,8 +2,8 @@ using System;
using System.Collections.ObjectModel;
using System.Linq;
using FrostFS.SDK.ClientV2;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client;
using FrostFS.SDK.Client.Mappers.GRPC;
using FrostFS.SDK.Cryptography;
using Google.Protobuf;

View file

@ -3,7 +3,7 @@ using System;
using System.Linq;
using FrostFS.Netmap;
using FrostFS.SDK.ClientV2;
using FrostFS.SDK.Client;
namespace FrostFS.SDK;

View file

@ -1,5 +1,5 @@
using FrostFS.Refs;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client.Mappers.GRPC;
namespace FrostFS.SDK;

View file

@ -1,5 +1,5 @@
using FrostFS.Refs;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client.Mappers.GRPC;
namespace FrostFS.SDK;

View file

@ -4,7 +4,7 @@ using System.Linq;
using FrostFS.Object;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client.Mappers.GRPC;
namespace FrostFS.SDK;

View file

@ -1,7 +1,7 @@
using System.Security.Cryptography;
using FrostFS.Refs;
using FrostFS.SDK.ClientV2.Mappers.GRPC;
using FrostFS.SDK.Client.Mappers.GRPC;
using FrostFS.SDK.Cryptography;
namespace FrostFS.SDK;

View file

@ -9,7 +9,7 @@ using Google.Protobuf;
using Grpc.Core.Interceptors;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class CallContext()
{

View file

@ -1,6 +1,6 @@
using System.Security.Cryptography;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class Credentials(ECDsa key, FrostFsOwner ownerId)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public interface IContext
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public interface ISessionToken
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmApeChainList(FrostFsChainTarget target, CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmApeChainRemove(FrostFsChainTarget target, FrostFsChain chain, CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmApeChainAdd(FrostFsChainTarget target, FrostFsChain chain, CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmBalance(CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,6 +1,6 @@
using System.Collections.Specialized;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class PrmBase(CallContext? ctx, NameValueCollection? xheaders = null) : IContext
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmContainerCreate(FrostFsContainerInfo container, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmContainerDelete(FrostFsContainerId containerId, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmContainerGet(FrostFsContainerId container, CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmContainerGetAll(CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmNetmapSnapshot(CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmNetworkSettings(CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmNodeInfo(CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmObjectDelete(FrostFsContainerId containerId, FrostFsObjectId objectId, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmObjectGet(FrostFsContainerId containerId, FrostFsObjectId objectId, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmObjectHeadGet(FrostFsContainerId containerId, FrostFsObjectId objectId, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,6 +1,6 @@
using System.IO;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmObjectPatch(FrostFsAddress address, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,6 +1,6 @@
using System.IO;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmObjectPut(CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,6 +1,6 @@
using System.Collections.Generic;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmObjectSearch(FrostFsContainerId containerId, CallContext? ctx = null, params IObjectFilter[] filters) : PrmBase(ctx), ISessionToken
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmRangeGet(
FrostFsContainerId containerId,

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmRangeHashGet(
FrostFsContainerId containerId,

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmSessionCreate(ulong expiration, CallContext? ctx = null) : PrmBase(ctx)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public sealed class PrmSingleObjectPut(FrostFsObject frostFsObject, CallContext? ctx = null) : PrmBase(ctx), ISessionToken
{

View file

@ -1,6 +1,6 @@
using System;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public class PrmWait(TimeSpan timeout, TimeSpan pollInterval)
{

View file

@ -3,7 +3,7 @@ using System.Threading;
using Microsoft.Extensions.Logging;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
// clientStatusMonitor count error rate and other statistics for connection.
public class ClientStatusMonitor : IClientStatus

View file

@ -3,7 +3,7 @@ using System.Threading.Tasks;
using Grpc.Core;
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
// clientWrapper is used by default, alternative implementations are intended for testing purposes only.
public class ClientWrapper : ClientStatusMonitor
@ -101,27 +101,41 @@ public class ClientWrapper : ClientStatusMonitor
await ScheduleGracefulClose().ConfigureAwait(false);
}
//#pragma warning disable CA2000 // Dispose objects before losing scope: will be disposed manually
FrostFSClient client = new(WrapperPrm, sessionCache);
//#pragma warning restore CA2000
FrostFSClient? client = null;
//TODO: set additioanl params
var error = await client.Dial(ctx).ConfigureAwait(false);
if (!string.IsNullOrEmpty(error))
try
{
SetUnhealthyOnDial();
return wasHealthy;
client = new(WrapperPrm, sessionCache);
var dialCtx = new CallContext
{
Timeout = TimeSpan.FromTicks((long)WrapperPrm.DialTimeout),
CancellationToken = ctx.CancellationToken
};
var error = await client.Dial(ctx).ConfigureAwait(false);
if (!string.IsNullOrEmpty(error))
{
SetUnhealthyOnDial();
return wasHealthy;
}
lock (_lock)
{
Client = client;
}
client = null;
}
lock (_lock)
finally
{
Client = client;
client?.Dispose();
}
try
{
var prmNodeInfo = new PrmNodeInfo(ctx);
var res = await client.GetNodeInfoAsync(prmNodeInfo).ConfigureAwait(false);
var res = await Client.GetNodeInfoAsync(prmNodeInfo).ConfigureAwait(false);
}
catch (FrostFsException)
{

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
// values for healthy status of clientStatusMonitor.
public enum HealthyStatus

View file

@ -1,4 +1,4 @@
namespace FrostFS.SDK.ClientV2;
namespace FrostFS.SDK.Client;
public interface IClientStatus
{

Some files were not shown because too many files have changed in this diff Show more