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
SocketException
UnknownHostException
public long getId()
getId
in interface IDGenerator
public void shutdown()
shutdown
in interface IDGenerator
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.