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

根据HOSTNAME的数字尾缀获取workerId的IdGenerator #192

Closed
hanahmily opened this issue Nov 22, 2016 · 3 comments
Closed

根据HOSTNAME的数字尾缀获取workerId的IdGenerator #192

hanahmily opened this issue Nov 22, 2016 · 3 comments

Comments

@hanahmily
Copy link
Contributor

HostNameWorkerIdIdGenerator:根据机器名最后的数字编号获取workerId,如果线上机器命名有统一规范,建议使用此种方式

列如:机器的HostName为dangdang-db-sharding-dev-12,会截取最后的编号12作为workerId。

@xydonne
Copy link
Contributor

xydonne commented Dec 2, 2016

已完成,用了PowerMock来mock静态方法。
https://github.com/xydonne/sharding-jdbc/tree/id-generator/192

@hanahmily
Copy link
Contributor Author

@xydonne 如果保证测试覆盖率没有下降 就可以提交pull request。我将在pr中做code review

@xydonne
Copy link
Contributor

xydonne commented Dec 2, 2016

@hanahmily 新增内容,测试覆盖率100%,已提交PR。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants