public interface LightIdProvider
| Modifier and Type | Interface and Description |
|---|---|
static interface |
LightIdProvider.Loader
LightId 加载器,通过Segment实现
|
static class |
LightIdProvider.Segment
LightId 片段
|
| Modifier and Type | Method and Description |
|---|---|
default long |
next(@NotNull String name,
int block)
根据区块和名字获得 LightId,默认5秒超时。
|
long |
next(@NotNull String name,
int block,
long timeout)
根据区块和名字获得 LightId
|
default long next(@NotNull
@NotNull String name,
int block)
name - Id名字block - 区块编号,生产中心,分库关键NoSuchElementException - name不存在。IllegalArgumentException - block超出范围。IllegalStateException - sequence超出范围,或者内部状态错误。TimeoutRuntimeException - 超时异常,默认1秒long next(@NotNull
@NotNull String name,
int block,
long timeout)
name - Id名字block - 区块编号,生产中心,分库关键timeout - 超时毫秒数,建议不要设置(0:无限等),尽量符合业务性能要求。NoSuchElementException - name不存在。IllegalArgumentException - block超出范围IllegalStateException - sequence超出范围,或者内部状态错误。TimeoutRuntimeException - 超时异常Copyright © 2020. All rights reserved.