Commit 3efdf03f by liuyf

使用雪花算法优化

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@32483 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 2285bd9b
......@@ -23,6 +23,7 @@ public class SnowFlakeWorkerConfig {
Long nodeId = SnowFlake.getLocalNodeId();
long workerId = nodeId & 31L;
long datacenterId = nodeId % 31L;
log.info("snowflakeWorker workerId={},datacenterId={}", workerId, datacenterId);
return new SnowflakeWorker(workerId, datacenterId);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!