[#69] Fix for Patch and uint types
Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
eebba7665b
commit
0816be732a
20 changed files with 212 additions and 153 deletions
|
@ -4,12 +4,12 @@ namespace FrostFS.SDK;
|
|||
|
||||
public struct FrostFsReplica : IEquatable<FrostFsReplica>
|
||||
{
|
||||
public int Count { get; set; }
|
||||
public uint Count { get; set; }
|
||||
public string Selector { get; set; }
|
||||
public uint EcDataCount { get; set; }
|
||||
public uint EcParityCount { get; set; }
|
||||
|
||||
public FrostFsReplica(int count, string? selector = null)
|
||||
public FrostFsReplica(uint count, string? selector = null)
|
||||
{
|
||||
selector ??= string.Empty;
|
||||
|
||||
|
@ -31,12 +31,12 @@ public struct FrostFsReplica : IEquatable<FrostFsReplica>
|
|||
|
||||
public readonly uint CountNodes()
|
||||
{
|
||||
return Count != 0 ? (uint)Count : EcDataCount + EcParityCount;
|
||||
return Count != 0 ? Count : EcDataCount + EcParityCount;
|
||||
}
|
||||
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return (Count + Selector.GetHashCode()) ^ (int)EcDataCount ^ (int)EcParityCount;
|
||||
return Count.GetHashCode() ^ Selector.GetHashCode() ^ (int)EcDataCount ^ (int)EcParityCount;
|
||||
}
|
||||
|
||||
public static bool operator ==(FrostFsReplica left, FrostFsReplica right)
|
||||
|
|
|
@ -3,12 +3,12 @@ using FrostFS.SDK.Client.Mappers.GRPC;
|
|||
|
||||
namespace FrostFS.SDK;
|
||||
|
||||
public class FrostFsVersion(int major, int minor)
|
||||
public class FrostFsVersion(uint major, uint minor)
|
||||
{
|
||||
private Version? version;
|
||||
|
||||
public int Major { get; set; } = major;
|
||||
public int Minor { get; set; } = minor;
|
||||
public uint Major { get; set; } = major;
|
||||
public uint Minor { get; set; } = minor;
|
||||
|
||||
internal Version VersionID
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
namespace FrostFS.SDK;
|
||||
|
||||
public class MetaHeader(FrostFsVersion version, int epoch, int ttl)
|
||||
public class MetaHeader(FrostFsVersion version, ulong epoch, uint ttl)
|
||||
{
|
||||
public FrostFsVersion Version { get; set; } = version;
|
||||
public int Epoch { get; set; } = epoch;
|
||||
public int Ttl { get; set; } = ttl;
|
||||
public ulong Epoch { get; set; } = epoch;
|
||||
public uint Ttl { get; set; } = ttl;
|
||||
|
||||
public static MetaHeader Default()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue