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

MINOR: Remove magic number and extract Pattern instance from method as class field #4799

Merged
merged 3 commits into from Apr 8, 2018
Merged

MINOR: Remove magic number and extract Pattern instance from method as class field #4799

merged 3 commits into from Apr 8, 2018

Conversation

@asdf2014
Copy link
Member

@asdf2014 asdf2014 commented Mar 30, 2018

  • Remove magic number
  • Extract Pattern instance from method as class field
  • Add @Override declare

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)
@asdf2014
Copy link
Member Author

@asdf2014 asdf2014 commented Apr 4, 2018

Hi, @guozhangwang . PTAL.

Loading

@guozhangwang
Copy link
Contributor

@guozhangwang guozhangwang commented Apr 4, 2018

Loading

Copy link
Contributor

@rhauch rhauch left a comment

@asdf2014 thanks for the fixes. One suggestion below.

Loading

@@ -109,6 +109,8 @@
public class DistributedHerder extends AbstractHerder implements Runnable {
private static final Logger log = LoggerFactory.getLogger(DistributedHerder.class);

private static final long FORWARD_REQUEST_SHUTDOWN_TIMEOUT_MS = 10_000L;
private static final long START_AND_STOP_SHUTDOWN_TIMEOUT_MS = 1000L;
Copy link
Contributor

@rhauch rhauch Apr 4, 2018

Choose a reason for hiding this comment

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

I'd prefer that we use TimeUnit.SECONDS.toMillis(10) and TimeUnit.SECONDS.toMillis(1) here. It avoids having to do any math when looking at the code.

Loading

Copy link
Member Author

@asdf2014 asdf2014 Apr 5, 2018

Choose a reason for hiding this comment

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

Thanks! It is better than pure number.

Loading

@asdf2014
Copy link
Member Author

@asdf2014 asdf2014 commented Apr 8, 2018

Hi, @rhauch @guozhangwang . Already using TimeUnit instead of those pure number. PTAL.

Loading

rhauch
rhauch approved these changes Apr 8, 2018
Copy link
Contributor

@rhauch rhauch left a comment

Thanks! LGTM.

Loading

@guozhangwang guozhangwang merged commit 37efc79 into apache:trunk Apr 8, 2018
3 checks passed
Loading
@asdf2014
Copy link
Member Author

@asdf2014 asdf2014 commented Apr 9, 2018

@rhauch Thx a lot.

Loading

@asdf2014 asdf2014 deleted the magic_num_and_pattern branch Apr 9, 2018
ying-zheng added a commit to ying-zheng/kafka that referenced this issue Jul 6, 2018
…s class field (apache#4799)

* Remove magic number
* Extract Pattern instance from method as class field
* Add @OverRide declare

Reviewers: Randall Hauch <rhauch@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants