Skip to content

YARN-11334. [Federation] Improve SubClusterState#fromString parameter and LogMessage.#4988

Merged
ayushtkn merged 1 commit intoapache:trunkfrom
slfan1989:YARN-11334
Oct 13, 2022
Merged

YARN-11334. [Federation] Improve SubClusterState#fromString parameter and LogMessage.#4988
ayushtkn merged 1 commit intoapache:trunkfrom
slfan1989:YARN-11334

Conversation

@slfan1989
Copy link
Contributor

@slfan1989 slfan1989 commented Oct 9, 2022

JIRA: YARN-11334. [Federation] Improve SubClusterState#fromString parameter and LogMessage.

The SubClusterState object has a fromString method, which can be improved in the following 2 places

/**
 * Convert a string into {@code SubClusterState}.
 *
 * @param x the string to convert in SubClusterState
 * @return the respective {@code SubClusterState}
 */
public static SubClusterState fromString(String x) {
  try {
    return SubClusterState.valueOf(x);
  } catch (Exception e) {
    LOG.error("Invalid SubCluster State value in the StateStore does not"
        + " match with the YARN Federation standard.");
    return null;
  }
} 
  • The parameter is named x, which cannot well express the meaning of the input parameter.
  • The error log does not print the error value.

@slfan1989 slfan1989 marked this pull request as draft October 9, 2022 07:10
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 54s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 42m 17s trunk passed
+1 💚 compile 0m 54s trunk passed with JDK Ubuntu-11.0.16+8-post-Ubuntu-0ubuntu120.04
+1 💚 compile 0m 46s trunk passed with JDK Private Build-1.8.0_342-8u342-b07-0ubuntu1~20.04-b07
+1 💚 checkstyle 0m 38s trunk passed
+1 💚 mvnsite 0m 53s trunk passed
+1 💚 javadoc 0m 55s trunk passed with JDK Ubuntu-11.0.16+8-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 41s trunk passed with JDK Private Build-1.8.0_342-8u342-b07-0ubuntu1~20.04-b07
+1 💚 spotbugs 1m 50s trunk passed
+1 💚 shadedclient 24m 28s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 0m 37s the patch passed
+1 💚 compile 0m 39s the patch passed with JDK Ubuntu-11.0.16+8-post-Ubuntu-0ubuntu120.04
+1 💚 javac 0m 39s the patch passed
+1 💚 compile 0m 34s the patch passed with JDK Private Build-1.8.0_342-8u342-b07-0ubuntu1~20.04-b07
+1 💚 javac 0m 34s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 19s the patch passed
+1 💚 mvnsite 0m 38s the patch passed
+1 💚 javadoc 0m 32s the patch passed with JDK Ubuntu-11.0.16+8-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 0m 29s the patch passed with JDK Private Build-1.8.0_342-8u342-b07-0ubuntu1~20.04-b07
+1 💚 spotbugs 1m 30s the patch passed
+1 💚 shadedclient 23m 50s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 3m 0s hadoop-yarn-server-common in the patch passed.
+1 💚 asflicense 0m 39s The patch does not generate ASF License warnings.
107m 19s
Subsystem Report/Notes
Docker ClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4988/1/artifact/out/Dockerfile
GITHUB PR #4988
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets
uname Linux 768b49558c09 4.15.0-191-generic #202-Ubuntu SMP Thu Aug 4 01:49:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 074a99b
Default Java Private Build-1.8.0_342-8u342-b07-0ubuntu1~20.04-b07
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.16+8-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_342-8u342-b07-0ubuntu1~20.04-b07
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4988/1/testReport/
Max. process+thread count 582 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common U: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-4988/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@slfan1989 slfan1989 marked this pull request as ready for review October 9, 2022 09:47
@slfan1989
Copy link
Contributor Author

@goiri @ayushtkn Can you help review this PR? Thank you very much! From my personal point of view, there should be no need for unit test.

Copy link
Member

@ayushtkn ayushtkn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slfan1989
Copy link
Contributor Author

@ayushtkn Thank you very much for helping to review the code!

@ayushtkn ayushtkn merged commit 1ff7e84 into apache:trunk Oct 13, 2022
@slfan1989
Copy link
Contributor Author

@ayushtkn Thank you very much for your help reviewing the code and merging the code!

HarshitGupta11 pushed a commit to HarshitGupta11/hadoop that referenced this pull request Nov 28, 2022
…ge. (apache#4988). Contributed by fanshilun.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants