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

DbSegmentIdServiceImpl的retry全局变量 #5

Closed
zhaoche27 opened this issue Feb 12, 2019 · 3 comments
Closed

DbSegmentIdServiceImpl的retry全局变量 #5

zhaoche27 opened this issue Feb 12, 2019 · 3 comments

Comments

@zhaoche27
Copy link

zhaoche27 commented Feb 12, 2019

单例的DbSegmentIdServiceImpl的retry全局变量,最好搞成常量,大写。

IdController 中 idGeneratorFactoryServer.getIdGenerator(bizType) 每次返回的都是新的CachedIdGenerator的实例,而你在这个实例里搞了(实例)锁,起不到对数据库(version冲突)减压的效果。应该锁 “bizType”

@duimba
Copy link
Collaborator

duimba commented Feb 15, 2019

retry命名确实不规范
每个bizType实际内存只有一个CachedIdGenerator实例,有个cache,如果cache中有,不会create了 @zhaoche27

@zhaoche27
Copy link
Author

image

@duimba
Copy link
Collaborator

duimba commented Feb 16, 2019

这个地方是多此一举了

@duimba duimba closed this as completed Mar 2, 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
Development

No branches or pull requests

2 participants