public class ClientFlakeIdGeneratorConfig extends Object
ClientFlakeIdGeneratorConfig
contains the configuration for the client
regarding Flake ID Generator
.Constructor and Description |
---|
ClientFlakeIdGeneratorConfig(ClientFlakeIdGeneratorConfig other)
Copy-constructor
|
ClientFlakeIdGeneratorConfig(String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
String |
getName()
Returns the configuration name.
|
int |
getPrefetchCount() |
long |
getPrefetchValidityMillis() |
int |
hashCode() |
void |
setName(String name)
Sets the name or name pattern for this config.
|
ClientFlakeIdGeneratorConfig |
setPrefetchCount(int prefetchCount)
Sets how many IDs are pre-fetched on the background when one call to
FlakeIdGenerator.newId() is made. |
ClientFlakeIdGeneratorConfig |
setPrefetchValidityMillis(long prefetchValidityMs)
Sets for how long the pre-fetched IDs can be used.
|
String |
toString() |
public ClientFlakeIdGeneratorConfig(String name)
public ClientFlakeIdGeneratorConfig(ClientFlakeIdGeneratorConfig other)
public String getName()
public void setName(String name)
ClientConfig
.public int getPrefetchCount()
setPrefetchCount(int)
public ClientFlakeIdGeneratorConfig setPrefetchCount(int prefetchCount)
FlakeIdGenerator.newId()
is made. Default is 100.prefetchCount
- the desired prefetch count, in the range 1..100,000.public long getPrefetchValidityMillis()
setPrefetchValidityMillis(long)
public ClientFlakeIdGeneratorConfig setPrefetchValidityMillis(long prefetchValidityMs)
The IDs contain timestamp component, which ensures rough global ordering of IDs. If an ID is assigned to an object that was created much later, it will be much out of order. If you don't care about ordering, set this value to 0.
prefetchValidityMs
- the desired ID validity or unlimited, if <=0Copyright © 2018 Hazelcast, Inc.. All rights reserved.