public class SnowflakeIDGenerator extends Object implements IDGenerator
| Constructor and Description |
|---|
SnowflakeIDGenerator(long datacenterId) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
getDatacenterId() |
long |
getId()
Return the next unique id for the type with the given name using the generator's id generation strategy.
|
void |
shutdown()
Shut down this id generator, performing any cleanups that might be necessary.
|
protected long |
tilNextMillis(long lastTimestamp) |
protected long tilNextMillis(long lastTimestamp)
protected long getDatacenterId()
throws SocketException,
UnknownHostException
SocketExceptionUnknownHostExceptionpublic long getId()
getId in interface IDGeneratorpublic void shutdown()
shutdown in interface IDGeneratorCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.