Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEMO-429] SWPP TEAM12 Code Smell Fix #274

Merged
merged 20 commits into from Jan 7, 2020
Merged

Conversation

tyj9327
Copy link
Contributor

@tyj9327 tyj9327 commented Dec 2, 2019

JIRA: NEMO-429: TEAM12

Major changes:

  • Fixed code smells (SWPP Code Smell session)

Minor changes to note:

  • As TA suggested, we excluded make transient or serializable error with //nosonar

Copy link
Member

@wonook wonook left a comment

Choose a reason for hiding this comment

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

Hi all, the PR looks good overall, but I've requested some simple changes. Please apply them and check if it works. It also seems like there's a check style issue on the branch. After applying the requested changes, please run mvn clean install -T1C -DskipTests and confirm that it works before submitting your final works. Thanks! 👍

@@ -264,6 +264,9 @@ public void processElement(final ProcessContext c) throws Exception {
* Composite transform that wraps the transforms inside the loop.
* The loop updates the user matrix and the item matrix in each iteration.
*/



Copy link
Member

Choose a reason for hiding this comment

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

It seems like these few lines were added by mistake. Could you revert the changes for this file? Thanks! 😄

@@ -34,7 +34,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.IntPredicate;
import java.util.function.IntPredicate; //NOSONAR
Copy link
Member

Choose a reason for hiding this comment

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

Let's revert this change on the import line. This isn't applicable. Instead, let's make the terminationCondition variable transient on line 59. You can declare it as private transient IntPredicate... there and it will solve the issue 👍

private final String path;
private Path fileName;
private Path fileName; //NOSONAR
private List<I> elements;
Copy link
Member

Choose a reason for hiding this comment

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

Please revert the change made on line 39, and make the variables declared on line 41 and 42 transient to remove the code smell. You can declare private transient ... to make the changes. Thanks!

@wonook
Copy link
Member

wonook commented Dec 9, 2019

@tyj9327 I've left some comments

@wonook
Copy link
Member

wonook commented Dec 17, 2019

Don't forget to address the comments! @tyj9327 @Imchaemin @YejiAhn @NSYT0607

Copy link
Member

@wonook wonook left a comment

Choose a reason for hiding this comment

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

Others are all fine. Thanks for resolving the comments. One more thing though, the build is failing with a checkstyle error, could you fix this and confirm that the build succeeds before proceeding? I think all will be good to go then. I think it will be solved if you resolve both of my comments. Thanks!

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0:check (validate) on project nemo-runtime-executor: Failed during checkstyle execution: There is 1 error reported by Checkstyle 8.16 with checkstyle.xml ruleset.

@@ -36,10 +36,10 @@
*
* @param <I> input type.
*/
public final class HDFSTextFileTransform<I> extends NoWatermarkEmitTransform<I, String> {
public final class HDFSTextFileTransform<I> extends NoWatermarkEmitTransform<I, String> { //NOSONAR
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove this NOSONAR comment? 😄

}, WATERMARK_PERIOD, WATERMARK_PERIOD, TimeUnit.MILLISECONDS);
this.watermarkTriggerService.scheduleAtFixedRate(() ->
watermarkTriggered = true
, WATERMARK_PERIOD, WATERMARK_PERIOD, TimeUnit.MILLISECONDS);
Copy link
Member

Choose a reason for hiding this comment

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

I think these lines are causing the checkstyle error. Can you append the comma at the end of line 59, instead of at the beginning of line 60?

@wonook wonook merged commit 1c87f16 into apache:master Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants