Skip to content

Commit

Permalink
Update nuget packages + cleanup (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
xqrzd authored Jul 23, 2023
1 parent 89da880 commit 6fff12e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 23 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"dotnet.defaultSolution": "kudu-client-net.sln",
"files.exclude": {
"**/bin": true,
"**/obj": true
Expand Down
11 changes: 4 additions & 7 deletions src/Knet.Kudu.Client/Connection/KuduConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ private SequencePosition ProcessMessages(ReadOnlySequence<byte> buffer, ParserCo

while (KuduMessageParser.TryParse(ref reader, parserContext))
{
HandleRpc(parserContext);
CompleteInflightRpc(parserContext);
parserContext.Reset();
}

return reader.Position;
}

private void HandleRpc(ParserContext parserContext)
private void CompleteInflightRpc(ParserContext parserContext)
{
var header = parserContext.Header!;
var callId = header.CallId;
Expand Down Expand Up @@ -272,15 +272,12 @@ private Exception GetException(ErrorStatusPB error)

private int AddInflightRpc(InflightRpc inflightRpc)
{
int callId;

lock (_inflightRpcs)
{
callId = _nextCallId++;
int callId = _nextCallId++;
_inflightRpcs.Add(callId, inflightRpc);
return callId;
}

return callId;
}

private void RemoveInflightRpc(int callId)
Expand Down
4 changes: 2 additions & 2 deletions src/Knet.Kudu.Client/Knet.Kudu.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
<PackageReference Include="Grpc.Tools" Version="2.56.0" PrivateAssets="All" />
<PackageReference Include="Google.Protobuf" Version="3.23.4" />
<PackageReference Include="Grpc.Tools" Version="2.56.2" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Pipelines.Sockets.Unofficial" Version="2.2.8" />
Expand Down
6 changes: 2 additions & 4 deletions src/Knet.Kudu.Client/Mapper/ColumnNameMatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,11 @@ public bool TryGetColumn(string destinationName, [NotNullWhen(true)] out T? colu

if (StringComparer.OrdinalIgnoreCase.Equals(destinationName, projectedName))
{
if (caseInsensitiveMatch is null)
caseInsensitiveMatch = column;
caseInsensitiveMatch ??= column;
}
else
{
if (firstMatch is null)
firstMatch = column;
firstMatch ??= column;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/Knet.Kudu.Client/Requests/ScanRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Google.Protobuf;
using Google.Protobuf.Collections;
using Knet.Kudu.Client.Exceptions;
using Knet.Kudu.Client.Protobuf;
using Knet.Kudu.Client.Protobuf.Tserver;
using Knet.Kudu.Client.Protocol;
using Knet.Kudu.Client.Scanner;
Expand Down
4 changes: 2 additions & 2 deletions src/Knet.Kudu.Client/Util/DecimalUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static class DecimalUtil
public const int MaxDecimal128Precision = 38;
public static readonly Int128 MaxUnscaledDecimal128 = new(
// 99999999999999999999999999999999999999
0x4B3B4CA85A86C47A, 0x98A223FFFFFFFFF);
0x4b3b4ca85a86c47a, 0x98a223fffffffff);
public static readonly Int128 MinUnscaledDecimal128 = -MaxUnscaledDecimal128;
public const int Decimal128Size = 16;

Expand Down Expand Up @@ -318,7 +318,7 @@ private struct DecimalAccessor
// Scale mask for the flags field. This byte in the flags field contains
// the power of 10 to divide the Decimal value by. The scale byte must
// contain a value between 0 and 28 inclusive.
private const int ScaleMask = 0x00FF0000;
private const int ScaleMask = 0x00ff0000;

// Number of bits scale is shifted by.
private const int ScaleShift = 16;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Tools" Version="2.56.0" PrivateAssets="All" />
<PackageReference Include="Grpc.Tools" Version="2.56.2" PrivateAssets="All" />
<PackageReference Include="Knet.Kudu.Binary" Version="1.16.0" />
<PackageReference Include="McMaster.Extensions.Xunit" Version="0.1.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="All" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Knet.Kudu.Client.FunctionalTests/ScannerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ public async Task TestDiffScan()
}
else if (type == RowOperation.Delete)
{
Assert.True(false, "Shouldn't see any DELETEs");
Assert.Fail("Shouldn't see any DELETEs");
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions test/Knet.Kudu.Client.Tests/Knet.Kudu.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="All" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Knet.Kudu.Client.Tests/SchemaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void SingleInt8()

var schema = GetSchema(builder);

Assert.Equal(1, schema.Columns.Count);
Assert.Single(schema.Columns);
Assert.False(schema.HasNullableColumns);
Assert.Equal(0, schema.VarLengthColumnCount);
Assert.Equal(1, schema.RowAllocSize);
Expand Down

0 comments on commit 6fff12e

Please sign in to comment.