I think that the SysInfo name is not as meaningful as ResourceCalculator but I don't have better proposals so I guess is fine
Unfortunately, YARN also has a o.a.h.yarn.util.resource.ResourceCalculator that's not related to o.a.h.yarn.util.ResourceCalculatorPlugin. I'm open to other names, but SysInfo seemed to cover the /proc scraping this performs.
What about making ResourceCalculatorPlugin extend/implement SysInfo to make the dependency more clear? This would also change the initialization of the other plugins and may not work.
Agreed, this is awkward. If RCP extends SysInfo, then the impls in YARN can't be related to the impls in Common. SysInfo as an interface doesn't really make anything cleaner; RCP would need to be an interface, and interfaces can't have static methods (i.e., RCP::getResourceCalculatorPlugin). Letting RCP be an (extensible) wrapper around SysInfo preserves existing RCP implementations in YARN. If we relax the backwards-compat we could do better, but the gains seem mostly aesthetic.
I'll add the LimitedPrivate annotation. I'll file a separate JIRA for thread safety, so
YARN-3819, YARN-3820 can merge and we can consider the whole picture.