We should exhaustively check the Enum.valueOf to ensure backwards compatibility in those cases as well.
I checked all the enums referenced for valueOf (i.e.: YarnApplicationState, FinalApplicationStatus, YarnApplicationAttemptState, ). YarnApplicationAttemptState had the FINAL_SAVING enum removed in
YARN-1345, but that change was committed way back in Hadoop 2.4.0 which did not support rolling upgrades. So we should be good there. ContainerState had a QUEUED state that was changed to the SCHEDULED state in YARN-4597. However this change, and YARN-2883 that added the QUEUED state originally, only went into Hadoop 2.9.0 and later, so the removed item was never in an official release. So we should be fine there as well.