Commit 74a67b85 authored by zhiguo.liu's avatar zhiguo.liu

# 发号器去掉测试打印

parent 242783f5
...@@ -143,8 +143,6 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean { ...@@ -143,8 +143,6 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
return String.format("{\"UID\":\"%d\",\"timestamp\":\"%s\",\"dataCenterId\":\"%d\",\"workerId\":\"%d\",\"sequence\":\"%d\"}", return String.format("{\"UID\":\"%d\",\"timestamp\":\"%s\",\"dataCenterId\":\"%d\",\"workerId\":\"%d\",\"sequence\":\"%d\"}",
uid, thatTimeStr, dataCenterId, workerId, sequence); uid, thatTimeStr, dataCenterId, workerId, sequence);
} else { } else {
BigInteger workerBig = getBigIntegerFromLength(workerIdBits).shiftLeft((int) sequenceBits).and(bigInteger);
System.out.println(workerBig);
long sequence = getBigIntegerFromLength(sequenceBits).and(bigInteger).longValue(); long sequence = getBigIntegerFromLength(sequenceBits).and(bigInteger).longValue();
long workerId = getBigIntegerFromLength(workerIdBits).and(bigInteger.shiftRight((int) sequenceBits)).longValue(); long workerId = getBigIntegerFromLength(workerIdBits).and(bigInteger.shiftRight((int) sequenceBits)).longValue();
long dataCenterId = getBigIntegerFromLength(dataCenterIdBits).and(bigInteger.shiftRight((int) sequenceBits + (int) workerIdBits)).longValue(); long dataCenterId = getBigIntegerFromLength(dataCenterIdBits).and(bigInteger.shiftRight((int) sequenceBits + (int) workerIdBits)).longValue();
...@@ -240,4 +238,5 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean { ...@@ -240,4 +238,5 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
} }
} }
} }
} }
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