Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
74a67b85
Commit
74a67b85
authored
Apr 12, 2018
by
zhiguo.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 发号器去掉测试打印
parent
242783f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
DefaultUidGenerator.java
.../java/cn/quantgroup/tech/util/id/DefaultUidGenerator.java
+1
-2
No files found.
commons-spring/src/main/java/cn/quantgroup/tech/util/id/DefaultUidGenerator.java
View file @
74a67b85
...
...
@@ -143,8 +143,6 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
return
String
.
format
(
"{\"UID\":\"%d\",\"timestamp\":\"%s\",\"dataCenterId\":\"%d\",\"workerId\":\"%d\",\"sequence\":\"%d\"}"
,
uid
,
thatTimeStr
,
dataCenterId
,
workerId
,
sequence
);
}
else
{
BigInteger
workerBig
=
getBigIntegerFromLength
(
workerIdBits
).
shiftLeft
((
int
)
sequenceBits
).
and
(
bigInteger
);
System
.
out
.
println
(
workerBig
);
long
sequence
=
getBigIntegerFromLength
(
sequenceBits
).
and
(
bigInteger
).
longValue
();
long
workerId
=
getBigIntegerFromLength
(
workerIdBits
).
and
(
bigInteger
.
shiftRight
((
int
)
sequenceBits
)).
longValue
();
long
dataCenterId
=
getBigIntegerFromLength
(
dataCenterIdBits
).
and
(
bigInteger
.
shiftRight
((
int
)
sequenceBits
+
(
int
)
workerIdBits
)).
longValue
();
...
...
@@ -240,4 +238,5 @@ public class DefaultUidGenerator implements UidGenerator, InitializingBean {
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment