Skip to content

Commit

Permalink
mark older LeastShardAllocationStrategy as obsolete (#6975)
Browse files Browse the repository at this point in the history
* mark older LeastShardAllocationStrategy as obsolete

* added API approvals
  • Loading branch information
Aaronontheweb committed Oct 25, 2023
1 parent 1f868e0 commit f2867df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/contrib/cluster/Akka.Cluster.Sharding/ClusterSharding.cs
Expand Up @@ -1415,10 +1415,13 @@ public IShardAllocationStrategy DefaultShardAllocationStrategy(ClusterShardingSe
}
else
{
// TODO: remove this in v1.6 and force all users to use only the new strategy going forward
// old algorithm
var threshold = settings.TuningParameters.LeastShardAllocationRebalanceThreshold;
var maxSimultaneousRebalance = settings.TuningParameters.LeastShardAllocationMaxSimultaneousRebalance;
#pragma warning disable CS0618 // Type or member is obsolete
return new LeastShardAllocationStrategy(threshold, maxSimultaneousRebalance);
#pragma warning restore CS0618 // Type or member is obsolete
}
}
}
Expand Down
Expand Up @@ -139,6 +139,7 @@ public static IShardAllocationStrategy LeastShardAllocationStrategy(int absolute
/// The number of ongoing rebalancing processes can be limited by `maxSimultaneousRebalance`.
/// </summary>
[Serializable]
[Obsolete("Use ShardAllocationStrategy.LeastShardAllocationStrategy instead. This will be removed in v1.6.")]
public class LeastShardAllocationStrategy : AbstractLeastShardAllocationStrategy
{
private readonly int _rebalanceThreshold;
Expand Down
Expand Up @@ -180,6 +180,8 @@ namespace Akka.Cluster.Sharding
{
void Start();
}
[System.ObsoleteAttribute("Use ShardAllocationStrategy.LeastShardAllocationStrategy instead. This will be re" +
"moved in v1.6.")]
public class LeastShardAllocationStrategy : Akka.Cluster.Sharding.Internal.AbstractLeastShardAllocationStrategy
{
public LeastShardAllocationStrategy(int rebalanceThreshold, int maxSimultaneousRebalance) { }
Expand Down
Expand Up @@ -180,6 +180,8 @@ namespace Akka.Cluster.Sharding
{
void Start();
}
[System.ObsoleteAttribute("Use ShardAllocationStrategy.LeastShardAllocationStrategy instead. This will be re" +
"moved in v1.6.")]
public class LeastShardAllocationStrategy : Akka.Cluster.Sharding.Internal.AbstractLeastShardAllocationStrategy
{
public LeastShardAllocationStrategy(int rebalanceThreshold, int maxSimultaneousRebalance) { }
Expand Down

0 comments on commit f2867df

Please sign in to comment.