public class RequestIdGenerator extends Object
目前是 currentTimeMillis * (2^20) + offset.incrementAndGet()
通过 requestId / (2^20 * 1000) 能够得到秒
| Modifier and Type | Field and Description |
|---|---|
protected static int |
BITS |
protected static long |
MAX_COUNT_PER_MILLIS |
protected static AtomicLong |
offset |
| Constructor and Description |
|---|
RequestIdGenerator() |
| Modifier and Type | Method and Description |
|---|---|
static long |
getRequestId()
获取 requestId
|
static long |
getRequestIdFromClient() |
protected static final AtomicLong offset
protected static final int BITS
protected static final long MAX_COUNT_PER_MILLIS
Copyright © 2019. All rights reserved.