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
1947c464
Commit
1947c464
authored
Apr 12, 2018
by
zhiguo.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 新 ID 生成器支持不设置 data.center.id
parent
609c9ef6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
DefaultUidGenerator.java
.../java/cn/quantgroup/tech/util/id/DefaultUidGenerator.java
+1
-1
No files found.
commons-spring/src/main/java/cn/quantgroup/tech/util/id/DefaultUidGenerator.java
View file @
1947c464
...
...
@@ -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
);
}
...
...
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