Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace>Hazelcast.Benchmarks</RootNamespace>
<AssemblyName>hb</AssemblyName>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(ASSEMBLY_SIGNING)'=='true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace Hazelcast.DependencyInjection;

/// <summary>Extension methods for <see cref="HazelcastOptionsBase"/> and its derivatives.</summary>
public static class HazelcastOptionsExtensions
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@

namespace Hazelcast.DependencyInjection
{
/// <summary>Extension methods for <see cref="IHostBuilder"/>.</summary>
public static class HostBuilderExtensions
{
/// <summary>Configures Hazelcast with default settings.</summary>
public static IHostBuilder ConfigureHazelcast(this IHostBuilder hostBuilder)
=> hostBuilder.ConfigureHazelcast(Array.Empty<string>());

/// <summary>Configures Hazelcast with the specified command-line arguments.</summary>
public static IHostBuilder ConfigureHazelcast(this IHostBuilder builder, string[] args)
{
return builder.ConfigureAppConfiguration((hostingContext, hostBuilder) =>
Expand Down
1 change: 1 addition & 0 deletions src/Hazelcast.Net.Linq.Async/HMapExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace Hazelcast.Linq
{
/// <summary>Extension methods for <see cref="IHMap{TKey,TValue}"/> providing LINQ support.</summary>
public static class HMapExtension
{
/// <summary>
Expand Down
5 changes: 4 additions & 1 deletion src/Hazelcast.Net.Linq.Async/MapEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace Hazelcast.Linq
/// <typeparam name="TValue">Type of Value</typeparam>
public struct MapEntry<TKey, TValue>
{
/// <summary>Initializes a new instance of the <see cref="MapEntry{TKey,TValue}"/> struct.</summary>
/// <param name="key">The key.</param>
/// <param name="value">The value.</param>
public MapEntry(TKey key, TValue value)
{
Key = key;
Expand All @@ -40,7 +43,7 @@ public MapEntry(TKey key, TValue value)


/// <summary>
/// Deconstructs the current <see cref="MapEntry{TKey,TValue}."/>
/// Deconstructs the current <see cref="MapEntry{TKey,TValue}"/>.
/// </summary>
public void Deconstruct(out TKey key, out TValue value)
{
Expand Down
7 changes: 3 additions & 4 deletions src/Hazelcast.Net.Testing/Remote/CloudException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* <auto-generated>
/*
* auto-generated
* Autogenerated by Thrift Compiler (0.18.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/
using System;
using System.Collections;
Expand Down Expand Up @@ -51,7 +50,7 @@ public partial class CloudException : TException, TBase
{
private string _message;

public string Message
public new string Message
{
get
{
Expand Down
5 changes: 2 additions & 3 deletions src/Hazelcast.Net.Testing/Remote/Lang.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* <auto-generated>
/*
* auto-generated
* Autogenerated by Thrift Compiler (0.18.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/

#pragma warning disable IDE0079 // remove unnecessary pragmas
Expand Down
5 changes: 2 additions & 3 deletions src/Hazelcast.Net.Testing/Remote/Member.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* <auto-generated>
/*
* auto-generated
* Autogenerated by Thrift Compiler (0.18.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/
using System;
using System.Collections;
Expand Down
11 changes: 8 additions & 3 deletions src/Hazelcast.Net.Testing/Remote/RemoteController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* <auto-generated>
/*
* auto-generated
* Autogenerated by Thrift Compiler (0.18.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/
using System;
using System.Collections;
Expand Down Expand Up @@ -95,6 +94,7 @@ public interface IAsync
/// <param name="baseUrl"></param>
/// <param name="apiKey"></param>
/// <param name="apiSecret"></param>
/// <param name="cancellationToken">A cancellation token.</param>
global::System.Threading.Tasks.Task loginToCloud(string baseUrl, string apiKey, string apiSecret, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -107,6 +107,7 @@ public interface IAsync
/// </summary>
/// <param name="hazelcastVersion"></param>
/// <param name="isTlsEnabled"></param>
/// <param name="cancellationToken">A cancellation token.</param>
global::System.Threading.Tasks.Task<global::Hazelcast.Testing.Remote.CloudCluster> createCloudCluster(string hazelcastVersion, bool isTlsEnabled, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -117,6 +118,7 @@ public interface IAsync
/// @param cloudClusterId -> Id of the cluster
/// </summary>
/// <param name="cloudClusterId"></param>
/// <param name="cancellationToken">A cancellation token.</param>
global::System.Threading.Tasks.Task<global::Hazelcast.Testing.Remote.CloudCluster> getCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -127,6 +129,7 @@ public interface IAsync
/// @param cloudClusterId -> Id of the cluster
/// </summary>
/// <param name="cloudClusterId"></param>
/// <param name="cancellationToken">A cancellation token.</param>
global::System.Threading.Tasks.Task<global::Hazelcast.Testing.Remote.CloudCluster> stopCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -137,6 +140,7 @@ public interface IAsync
/// @param cloudClusterId
/// </summary>
/// <param name="cloudClusterId"></param>
/// <param name="cancellationToken">A cancellation token.</param>
global::System.Threading.Tasks.Task<global::Hazelcast.Testing.Remote.CloudCluster> resumeCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -147,6 +151,7 @@ public interface IAsync
/// @param cloudClusterId
/// </summary>
/// <param name="cloudClusterId"></param>
/// <param name="cancellationToken">A cancellation token.</param>
global::System.Threading.Tasks.Task deleteCloudCluster(string cloudClusterId, CancellationToken cancellationToken = default);

global::System.Threading.Tasks.Task<global::Hazelcast.Testing.Remote.Response> executeOnController(string clusterId, string script, global::Hazelcast.Testing.Remote.Lang lang, CancellationToken cancellationToken = default);
Expand Down
5 changes: 2 additions & 3 deletions src/Hazelcast.Net.Testing/Remote/Response.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* <auto-generated>
/*
* auto-generated
* Autogenerated by Thrift Compiler (0.18.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/
using System;
using System.Collections;
Expand Down
7 changes: 3 additions & 4 deletions src/Hazelcast.Net.Testing/Remote/ServerException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* <auto-generated>
/*
* auto-generated
* Autogenerated by Thrift Compiler (0.18.0)
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* </auto-generated>
*/
using System;
using System.Collections;
Expand Down Expand Up @@ -51,7 +50,7 @@ public partial class ServerException : TException, TBase
{
private string _message;

public string Message
public new string Message
{
get
{
Expand Down
1 change: 0 additions & 1 deletion src/Hazelcast.Net.Tests/CP/CPMapTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace Hazelcast.Tests.CP;
public class CPMapTests : MultiMembersRemoteTestBase
{
private string _defaultMapName = "myMap";
private string _groupName = "group1";

private List<Member> _members = new();
public IHazelcastClient Client { get; private set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Hazelcast.Net.Tests/Clustering/FailoverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ await AssertEx.SucceedsEventually(
}

/// <summary>
/// Asserts that the client is connected to the expected cluster & can access the specified map.
/// Asserts that the client is connected to the expected cluster &amp; can access the specified map.
/// </summary>
private async Task AssertCluster(IHazelcastClient client, string expectedClusterName, IHMap<string, string> map)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Hazelcast.Net.Tests/Clustering/FailoverTests2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ private async ValueTask ServerHandler(ClientRequest<ServerState> request)
}

/// <summary>
/// Asserts that the client is connected to the expected cluster & can access the specified map.
/// Asserts that the client is connected to the expected cluster &amp; can access the specified map.
/// </summary>
public async Task AssertCluster(IHazelcastClient client, string expectedClusterName, IHMap<string, string> map)
{
Expand Down
4 changes: 4 additions & 0 deletions src/Hazelcast.Net.Tests/Models/HazelcastDataTypesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ public void LocalDate(string stringValue)
Assert.AreEqual(dateTimeValue.ToString("yyyy-MM-dd"), localDateValue.ToString());
Assert.False(refLocalDateVal!= localDateValue);
// ReSharper disable once EqualExpressionComparison
#pragma warning disable CS1718
Assert.True(localDateValue == localDateValue);
#pragma warning restore CS1718
Assert.True(localDateValue.Equals(refLocalDateVal));
Assert.True(localDateValue.Equals((object)refLocalDateVal));
}
Expand Down Expand Up @@ -331,9 +333,11 @@ public void OffsetDateTime(string stringValue)
);

// ReSharper disable once EqualExpressionComparison
#pragma warning disable CS1718
Assert.False(offsetDateTimeValue != offsetDateTimeValue);
// ReSharper disable once EqualExpressionComparison
Assert.True(offsetDateTimeValue == offsetDateTimeValue);
#pragma warning restore CS1718
Assert.True(offsetDateTimeValue.Equals(offsetDateTimeValue));
Assert.True(offsetDateTimeValue.Equals((object)offsetDateTimeValue));
}
Expand Down
4 changes: 0 additions & 4 deletions src/Hazelcast.Net.Tests/Networking/ClientSslTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ namespace Hazelcast.Tests.Networking
{
public abstract class ClientSslTestBase : RemoteTestBase
{
private IDisposable _console;

protected static TimeSpan TestTimeout = TimeSpan.FromSeconds(30);

#if SSLCERTS_JAVA
Expand Down Expand Up @@ -252,8 +250,6 @@ public void SetUp()
[TearDown]
public async Task TearDown()
{
_console?.Dispose();

// terminate & remove member
if (RcMember != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task TearDown()
}
}

private static string GetRandomName(string prefix) => $"{prefix}-{Guid.NewGuid().ToString("N")[..7]}";
private new static string GetRandomName(string prefix) => $"{prefix}-{Guid.NewGuid().ToString("N")[..7]}";

private async Task<string> SetUpCluster(Schema schema)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ public override bool Equals(object obj)

/// <summary>
/// Generates a portable object with data. Also used to size strings in the string arrays.
/// n(where 0<n<=len(randomstring)) length of string array will be like["x", "xx", "xxx", ....., "xxx..xxx"].
/// n(where 0 &lt; n &lt;= len(randomstring)) length of string array will be like["x", "xx", "xxx", ....., "xxx..xxx"].
/// It will allow to test deseriazliser with various size of strings.
/// </summary>
/// <param name="arraySize">arraySize">Size of for array type fields</param>
/// <param name="arraySize">Size of for array type fields</param>
/// <returns></returns>
public static KitchenSinkPortable Generate(int arraySize = 5)
{
Expand Down
1 change: 1 addition & 0 deletions src/Hazelcast.Net.Win32/Security/KerberosTokenProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public class KerberosTokenProvider : IKerberosTokenProvider
//
// and that same code works both for .NET Framework and .NET Core

/// <summary>Gets a Kerberos token for the specified service principal name.</summary>
public byte[] GetToken(string spn, string username, string password, string domain)
{
SspiContext context;
Expand Down
4 changes: 4 additions & 0 deletions src/Hazelcast.Net.Win32/Security/Win32/CredentialHandle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ internal unsafe override CredentialHandle Structify()
}
}

/// <summary>Represents a Windows SSPI credential handle.</summary>
public class CredentialHandle : SafeHandle
{
/// <summary>Initializes a new instance of the <see cref="CredentialHandle"/> class.</summary>
public unsafe CredentialHandle(void* cred)
: base(new IntPtr(cred), true)
{
}

/// <inheritdoc />
public override bool IsInvalid => base.handle == IntPtr.Zero;

/// <inheritdoc />
protected override bool ReleaseHandle()
{
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Hazelcast.Net/CP/ClusterCPGroups.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void SetGroups(long version, ICollection<CPGroupInfo> groups, IList<KeyVa
_logger.IfDebug()?.LogDebug("CP groups updated to Version {Version}." +
" Old groups count: {OldCount}, new count: {NewCount}", Version, oldCount, groups.Count);
}
private Dictionary<CPGroupId, Guid> MapCPtoAPUuids(IList<KeyValuePair<Guid, Guid>> cpToApUuids, ICollection<CPGroupInfo> groupInfos)
private static Dictionary<CPGroupId, Guid> MapCPtoAPUuids(IList<KeyValuePair<Guid, Guid>> cpToApUuids, ICollection<CPGroupInfo> groupInfos)
{
var mapIds = new Dictionary<CPGroupId, Guid>();

Expand Down
2 changes: 2 additions & 0 deletions src/Hazelcast.Net/Clustering/Authenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ public async ValueTask<AuthenticationResult> AuthenticateAsync(MemberConnection
/// <summary>
/// Authenticates a TPC connection.
/// </summary>
#pragma warning disable CA1822 // CA1822: method may gain instance access in the future
public async ValueTask<bool> AuthenticateTpcAsync(MemberConnection client, ClientMessageConnection connection, Guid clientId, byte[] token, CancellationToken cancellationToken)
#pragma warning restore CA1822
{
var message = TpcClientChannelAuthenticationCodec.EncodeRequest(clientId, token);
message.InvocationFlags |= InvocationFlags.InvokeWhenNotConnected;
Expand Down
2 changes: 1 addition & 1 deletion src/Hazelcast.Net/Clustering/ClusterConnections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ void RemoveCompletion()
RemoveCompletion();
return connection;
}
private async Task ThrowInvalidPartitionGroup(MemberConnection connection)
private static async Task ThrowInvalidPartitionGroup(MemberConnection connection)
{
await connection.DisposeAsync().CfAwait();
throw new InvalidPartitionGroupException("No member group is received from server as partition group." +
Expand Down
4 changes: 3 additions & 1 deletion src/Hazelcast.Net/Clustering/ClusterMembers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public ClusterMembers(ClusterState clusterState, TerminateConnections terminateC
// is considered connected - but then, the "match" logic cannot work and must be refactored.
// but, it's something that no other client offers - decision = disable it entirely for now.

private bool MatchMemberAddress
private static bool MatchMemberAddress
//=> _clusterState.Options.Networking.SmartRouting || _clusterState.Options.Networking.Cloud.Enabled;
=> false;

Expand All @@ -161,8 +161,10 @@ private bool MatchMemberAddress
public ClusterCPGroups ClusterCPGroups => _cpGroups;

// see notes above, if matching then addresses must match, else anything matches
#pragma warning disable CA1822 // CA1822: relies on MatchMemberAddress which may become non-constant
public bool IsMemberAddress(MemberInfo member, NetworkAddress address)
=> !MatchMemberAddress || member.ConnectAddress == address;
#pragma warning restore CA1822

// Gets filtered members for multi member connections.
public ISubsetClusterMembers SubsetClusterMembers => _subsetClusterMembers;
Expand Down
7 changes: 6 additions & 1 deletion src/Hazelcast.Net/Clustering/ClusterMessaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ private Task<ClientMessage> SendAsyncInternal(ClientMessage message, MemberConne
/// <summary>
/// Sends an invocation request message.
/// </summary>
/// <param name="invocation">The invocation.</param>
/// <param name="message">The message to send.</param>
/// <param name="connectionGiven">An optional specific connection to use.</param>
/// <param name="targetPartitionId">An optional target partition identifier.</param>
/// <param name="targetMemberId">An optional target member identifier.</param>
/// <param name="correlationId">A correlation identifier.</param>
/// <param name="raiseEvents">Whether to raise events.</param>
/// <param name="cancellationToken">A cancellation token.</param>
/// <returns>The response message.</returns>
private async Task<ClientMessage> SendAsyncInternal(ClientMessage message, MemberConnection connectionGiven, int targetPartitionId,
Expand Down
2 changes: 1 addition & 1 deletion src/Hazelcast.Net/Clustering/MemberPartitionGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ internal MemberGroups GetMostOverlappedGroup(Guid clusterId, Guid memberIdOfGrou
}

// internal for testing
internal MemberGroups GetBiggestGroup(MemberGroups newGroup)
internal static MemberGroups GetBiggestGroup(MemberGroups newGroup)
{
var maxCount = int.MinValue;
HashSet<Guid> biggestGroup = null;
Expand Down
Loading
Loading