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 TEAM3 Code Smell Fix #265

Merged
merged 19 commits into from Dec 6, 2019
Merged

Conversation

davin111
Copy link
Contributor

@davin111 davin111 commented Dec 2, 2019

JIRA: NEMO-429: SWPP TEAM 3 Code Smell Fix

Major changes:

  • Fixed code smells(SWPP Code Smell Session)

Notes:

  • We doubt if just adding transient prefix is good solution, so we didn't fix about it. Please let us know if it should be fixed.

By Team3
P.S. One of our members was absent today.

@johnyangk johnyangk self-requested a review December 4, 2019 06:16
Copy link
Contributor

@johnyangk johnyangk left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I left a comment.

Regarding the two transient issues assigned to your team:

(1) ReduceTransform

I took a look, and it appears that there's no good reason for private T result to be a class variable. Can you move the variable into the onData() method, which is the only place where the variable is used?

(2) ReduceByKeyTransform

This one is tricky. Can you add a TODO that references the following JIRA issue?
https://issues.apache.org/jira/browse/NEMO-431

Revert other lines
make T as a variable of onData()
@davin111
Copy link
Contributor Author

davin111 commented Dec 4, 2019

@johnyangk I reflected your review. Thank you!

Copy link
Contributor

@johnyangk johnyangk left a comment

Choose a reason for hiding this comment

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

I took a more close look at ReduceTransform, and it seems that the result variable does need to be shared across multiple onData() calls, since it sort of accumulates the resulting value. Hence, I take back what I said. result should be kept as a class variable. Sorry for the confusion.

Everything else looks good to me.

Reflected the review
@davin111
Copy link
Contributor Author

davin111 commented Dec 5, 2019

@johnyangk I reflected it, thank you!

Copy link
Contributor

@johnyangk johnyangk left a comment

Choose a reason for hiding this comment

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

Nice! I'll merge.

@johnyangk johnyangk merged commit 5be0571 into apache:master Dec 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants