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

提供根据作业名称hash值取奇偶数分片排序策略 #10

Closed
terrymanu opened this issue Oct 14, 2015 · 1 comment
Closed

提供根据作业名称hash值取奇偶数分片排序策略 #10

terrymanu opened this issue Oct 14, 2015 · 1 comment

Comments

@terrymanu
Copy link
Member

提供com.dangdang.ddframe.job.plugin.sharding.strategy.OdevitySortByNameJobShardingStrategy分片策略。
根据作业名的哈希值奇偶数决定IP升降序的算法分片策略。

作业名的哈希值为奇数则IP升序。
作业名的哈希值为偶数则IP降序。
用于不同的作业平均分配负载至不同的服务器。
如:

  1. 如果有3台服务器,分成2片,作业名称的哈希值为奇数, 则每台服务器分到的分片是:1=[0], 2=[1], 3=[]
  2. 如果有3台服务器,分成2片,作业名称的哈希值为偶数, 则每台服务器分到的分片是:3=[0], 2=[1], 1=[]
terrymanu added a commit that referenced this issue Oct 14, 2015
@terrymanu
Copy link
Member Author

fixed

@terrymanu terrymanu changed the title [功能提升]jobname的hash值取奇偶数分片排序策略 [功能提升] jobName的hash值取奇偶数分片排序策略 Oct 29, 2015
@terrymanu terrymanu changed the title [功能提升] jobName的hash值取奇偶数分片排序策略 [Improvement] 提供根据作业名称hash值取奇偶数分片排序策略 Mar 8, 2016
@terrymanu terrymanu changed the title [Improvement] 提供根据作业名称hash值取奇偶数分片排序策略 提供根据作业名称hash值取奇偶数分片排序策略 Jul 12, 2016
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

1 participant