From a95d125fca172d99e33a0e0bee07190162965f8f Mon Sep 17 00:00:00 2001 From: Aaron Stannard Date: Mon, 22 Jul 2024 15:41:58 -0500 Subject: [PATCH] `ShardCoordinator`: misc cleanup --- .../cluster/Akka.Cluster.Sharding/ClusterShardingGuardian.cs | 2 +- .../cluster/Akka.Cluster.Sharding/DDataShardCoordinator.cs | 2 +- src/contrib/cluster/Akka.Cluster.Sharding/ShardCoordinator.cs | 2 +- src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/ClusterShardingGuardian.cs b/src/contrib/cluster/Akka.Cluster.Sharding/ClusterShardingGuardian.cs index b1ea4198433..4185a8bd7e3 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/ClusterShardingGuardian.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/ClusterShardingGuardian.cs @@ -179,7 +179,7 @@ public ClusterShardingGuardian( { // with the deprecated persistence state store mode we always use the event sourced provider for shard regions // and no store for coordinator (the coordinator is a PersistentActor in that case) - RememberEntitiesStore rememberEntitiesProvider = + var rememberEntitiesProvider = (settings.StateStoreMode == StateStoreMode.Persistence) ? RememberEntitiesStore.Eventsourced : settings.RememberEntitiesStore; diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/DDataShardCoordinator.cs b/src/contrib/cluster/Akka.Cluster.Sharding/DDataShardCoordinator.cs index f6e6558ba58..7dab9d76edc 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/DDataShardCoordinator.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/DDataShardCoordinator.cs @@ -123,7 +123,7 @@ public DDataShardCoordinator( else _stateWriteConsistency = new WriteMajorityPlus(settings.TuningParameters.UpdatingStateTimeout, settings.TuningParameters.CoordinatorStateWriteMajorityPlus, majorityMinCap); - Cluster node = Cluster.Get(Context.System); + var node = Cluster.Get(Context.System); _selfUniqueAddress = node.SelfUniqueAddress; _coordinatorStateKey = new LWWRegisterKey(typeName + "CoordinatorState"); diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/ShardCoordinator.cs b/src/contrib/cluster/Akka.Cluster.Sharding/ShardCoordinator.cs index 4155c9f98d4..5429f403ef8 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/ShardCoordinator.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/ShardCoordinator.cs @@ -1490,7 +1490,7 @@ public static Props Props( private ILoggingAdapter Log { get { return _log ??= Context.GetLogger(); } } - public ITimerScheduler Timers { get; set; } + public ITimerScheduler Timers { get; set; } = null!; /// /// TBD diff --git a/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs b/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs index 0e76a5c89ef..35757f9d02d 100644 --- a/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs +++ b/src/contrib/cluster/Akka.Cluster.Sharding/ShardRegion.cs @@ -353,7 +353,7 @@ internal static Props Props( string coordinatorPath, IMessageExtractor messageExtractor, object handOffStopMessage, - IRememberEntitiesProvider rememberEntitiesProvider) + IRememberEntitiesProvider? rememberEntitiesProvider) { return Actor.Props.Create(() => new ShardRegion( typeName,