can the whole method be a static? Also, it seems to make sense to move it to YarnUtils similar to getVirtualCores?