public class ClientFlakeIdGeneratorProxy extends ClientProxy implements FlakeIdGenerator
FlakeIdGenerator
.name
Constructor and Description |
---|
ClientFlakeIdGeneratorProxy(String serviceName,
String objectName,
ClientContext context) |
Modifier and Type | Method and Description |
---|---|
long |
newId()
Generates and returns a cluster-wide unique ID.
|
String |
toString() |
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onInitialize, onShutdown, postDestroy, preDestroy, registerListener, toData, toObject
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getName, getPartitionKey, getServiceName
public ClientFlakeIdGeneratorProxy(String serviceName, String objectName, ClientContext context)
public long newId()
FlakeIdGenerator
Operation on member is always local, if the member has valid node ID, otherwise it's remote. On
client, this method goes to a random member and gets a batch of IDs, which will then be returned
locally for limited time. The pre-fetch size and the validity time can be configured for
each client and member, see here
for member config and see ClientConfig.addFlakeIdGeneratorConfig()
for client config.
Note: Values returned from this method may be not strictly ordered.
newId
in interface FlakeIdGenerator
Copyright © 2019 Hazelcast, Inc.. All rights reserved.