Commit 1947c464 authored by zhiguo.liu's avatar zhiguo.liu

# 新 ID 生成器支持不设置 data.center.id

parent 609c9ef6
......@@ -108,7 +108,7 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
// initialize worker id
workerId = workerIdAssigner.assignWorkerId(dataCenterId, bitsAllocator);
Assert.isTrue(workerId < bitsAllocator.getMaxWorkerId(), "workerId is too big");
Assert.isTrue(dataCenterId < bitsAllocator.getMaxDataCenterId(), "dataCenterId is too big");
Assert.isTrue(bitsAllocator.getMaxDataCenterId() != 0 && dataCenterId < bitsAllocator.getMaxDataCenterId(), "dataCenterId is too big");
LOGGER.info("Initialized bits dataCenterBits:{}, workerBits:{}, seqBits:{}", dataCenterIdBits, workerBits, seqBits);
LOGGER.info("Initialized nodes, workerId:{}, dataCenterId:{}", workerId, dataCenterId);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment