YARN-11964: Clamp negative available resources in AllocateResponse to zero (#8523) Contributed by Ryu Kobayashi

Clamp negative scheduler headroom to zero when DefaultAMSProcessor constructs the AllocateResponse. Keeping the change at the response boundary avoids changing the semantics of general Resource operations.

Preserve null resource limits for compatibility and add a regression test covering negative memory and vCore headroom.

Reviewed-by: Cheng Pan <chengpan@apache.org>
Signed-off-by: Shilun Fan <slfan1989@apache.org>
2 files changed