YARN-11334. Improve SubClusterState#fromString parameter and LogMessage. (#4988). Contributed by fanshilun.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
This commit is contained in:
slfan1989 2022-10-13 14:36:24 +08:00 committed by GitHub
parent d6b1e1eeb6
commit 1ff7e84caf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -70,15 +70,15 @@ public enum SubClusterState {
/** /**
* Convert a string into {@code SubClusterState}. * Convert a string into {@code SubClusterState}.
* *
* @param x the string to convert in SubClusterState * @param state the string to convert in SubClusterState
* @return the respective {@code SubClusterState} * @return the respective {@code SubClusterState}
*/ */
public static SubClusterState fromString(String x) { public static SubClusterState fromString(String state) {
try { try {
return SubClusterState.valueOf(x); return SubClusterState.valueOf(state);
} catch (Exception e) { } catch (Exception e) {
LOG.error("Invalid SubCluster State value in the StateStore does not" LOG.error("Invalid SubCluster State value({}) in the StateStore does not"
+ " match with the YARN Federation standard."); + " match with the YARN Federation standard.", state);
return null; return null;
} }
} }