namespace NATS.Server.JetStream.Cluster;

public sealed class AssetPlacementPlanner
{
    private readonly int _nodes;

    public AssetPlacementPlanner(int nodes)
    {
        _nodes = Math.Max(nodes, 1);
    }

    public IReadOnlyList<int> PlanReplicas(int replicas)
    {
        var count = Math.Min(Math.Max(replicas, 1), _nodes);
        return Enumerable.Range(1, count).ToArray();
    }
}
