mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-21 08:53:42 +00:00
添加snowflake的datacenterId和workerId的ID分配策略,利用redis的原子锁特性
This commit is contained in:
@@ -37,12 +37,12 @@ public class IdWorkerInit {
|
||||
/**
|
||||
* key的过期时间
|
||||
*/
|
||||
private static final long EXPIRATION = 30;
|
||||
private static final long EXPIRATION = 70;
|
||||
|
||||
/**
|
||||
* job执行时间
|
||||
*/
|
||||
private static final long JOB_RUN_TIME = 20l * 1000l;
|
||||
private static final long JOB_RUN_TIME = 60 * 1000l;
|
||||
|
||||
/**
|
||||
* 机器ID( 0 - 31 )
|
||||
|
||||
Reference in New Issue
Block a user