public class DefaultSequenceImpl extends Object implements SequenceLifecycle, Sequence
| Constructor and Description |
|---|
DefaultSequenceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
init()
初始化
|
long |
nextValue(int size)
返回 size 大小后的值,比如针对 batch 拿到 size 大小的值,自己内存中顺序分配
|
long |
nextValue(Object... params)
生成下一个序列值
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroypublic void init()
SequenceLifecycleinit in interface SequenceLifecyclepublic long nextValue(Object... params) throws SequenceException
SequencenextValue in interface Sequenceparams - 可选参数(由具体的实现类决定是否需要)SequenceException - 序列异常信息public long nextValue(int size)
throws SequenceException
Sequence举例: 1. 一次性申请 size = 500 个序列 2. 返回 2500 3. 那么序列值可以使用的范围为:2001 ~ 2500
nextValue in interface Sequencesize - 一次性获取多少个序列SequenceException - 序列异常信息Copyright © 2018–2020. All rights reserved.