Skip to content

Commit

Permalink
Update to KNet 2.7.5 (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers authored Jul 2, 2024
1 parent c03949a commit f976afb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MASES.KNet.Serialization.Avro" Version="2.7.4" />
<PackageReference Include="MASES.KNet.Serialization.Avro" Version="2.7.5" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/net/KEFCore.SerDes/KEFCore.SerDes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.31" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net6.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.20" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" PrivateAssets="none" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageReference Include="MASES.KNet" Version="2.7.4">
<PackageReference Include="MASES.KNet" Version="2.7.5">
<IncludeAssets>All</IncludeAssets>
<PrivateAssets>None</PrivateAssets>
</PackageReference>
Expand Down
12 changes: 6 additions & 6 deletions src/net/KEFCore/Storage/Internal/KNetStreamsRetriever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public IEnumerator<ValueBuffer> GetEnumerator()
#if DEBUG_PERFORMANCE
Infrastructure.KafkaDbContext.ReportString($"Requesting KafkaEnumerator for {_entityType.Name} on {DateTime.Now:HH:mm:ss.FFFFFFF}");
#endif
return new KafkaEnumerator(_kafkaCluster, _entityType, _keyValueStore?.All, _useEnumeratorWithPrefetch, false);
return new KafkaEnumerator(_kafkaCluster, _entityType, _keyValueStore?.All(), _useEnumeratorWithPrefetch, false);
}

System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
Expand All @@ -306,7 +306,7 @@ public IAsyncEnumerator<ValueBuffer> GetAsyncEnumerator(CancellationToken cancel
#if DEBUG_PERFORMANCE
Infrastructure.KafkaDbContext.ReportString($"Requesting async KafkaEnumerator for {_entityType.Name} on {DateTime.Now:HH:mm:ss.FFFFFFF}");
#endif
return new KafkaEnumerator(_kafkaCluster, _entityType, _keyValueStore?.All, _useEnumeratorWithPrefetch, true);
return new KafkaEnumerator(_kafkaCluster, _entityType, _keyValueStore?.All(), _useEnumeratorWithPrefetch, true);
}
#endif
}
Expand Down Expand Up @@ -382,7 +382,7 @@ public ValueTask DisposeAsync()
#if DEBUG_PERFORMANCE
Infrastructure.KafkaDbContext.ReportString($"KafkaEnumerator _moveNextSw: {_moveNextSw.Elapsed} _currentSw: {_currentSw.Elapsed} _valueGetSw: {_valueGetSw.Elapsed} _valueGet2Sw: {_valueGet2Sw.Elapsed} _valueBufferSw: {_valueBufferSw.Elapsed}");
#endif
return _asyncEnumerator.DisposeAsync();
return _asyncEnumerator != null ? _asyncEnumerator.DisposeAsync() : new ValueTask();
}
#endif

Expand All @@ -396,18 +396,18 @@ public bool MoveNext()
{
_moveNextSw.Start();
#endif
if (_useEnumeratorWithPrefetch ? _enumerator != null && _enumerator.MoveNext() : _keyValueIterator != null && _keyValueIterator.HasNext)
if (_useEnumeratorWithPrefetch ? _enumerator != null && _enumerator.MoveNext() : _keyValueIterator != null && _keyValueIterator.HasNext())
{
#if DEBUG_PERFORMANCE
_cycles++;
_valueGetSw.Start();
#endif
KeyValue<TKey, TValue, TJVMKey, TJVMValue> kv = _useEnumeratorWithPrefetch ? _enumerator.Current : _keyValueIterator.Next;
KeyValue<TKey, TValue, TJVMKey, TJVMValue>? kv = _useEnumeratorWithPrefetch ? _enumerator?.Current : _keyValueIterator?.Next();
#if DEBUG_PERFORMANCE
_valueGetSw.Stop();
_valueGet2Sw.Start();
#endif
TValue value = kv.Value;
TValue value = kv != null ? kv.Value : default;

Check warning on line 410 in src/net/KEFCore/Storage/Internal/KNetStreamsRetriever.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Converting null literal or possible null value to non-nullable type.
#if DEBUG_PERFORMANCE
_valueGet2Sw.Stop();
_valueBufferSw.Start();
Expand Down
5 changes: 3 additions & 2 deletions src/net/KEFCore/Storage/Internal/KafkaStreamsBaseRetriever.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ public bool MoveNext()
V? data;
using (KeyValue<K, V> kv = _keyValueIterator.Next())
{
data = kv.value != null ? (V)(object)kv.value! : default;
var kvSupport = new MASES.KNet.Streams.KeyValueSupport<K, V>(kv.BridgeInstance);
data = kvSupport.Value != null ? (V)(object)kvSupport.Value! : default;
}
#if DEBUG_PERFORMANCE
_valueGetSw.Stop();
Expand All @@ -372,7 +373,7 @@ public bool MoveNext()
_valueBufferSw.Start();
#endif
object[] array = null!;
entityTypeData.GetData(_entityType, ref array);
entityTypeData?.GetData(_entityType, ref array);
#if DEBUG_PERFORMANCE
_valueBufferSw.Stop();
#endif
Expand Down

0 comments on commit f976afb

Please sign in to comment.