public class FlakeIdGeneratorConfigReadOnly extends FlakeIdGeneratorConfig
DEFAULT_PREFETCH_COUNT, DEFAULT_PREFETCH_VALIDITY_MILLIS, MAXIMUM_PREFETCH_COUNT| Modifier and Type | Method and Description |
|---|---|
FlakeIdGeneratorConfig |
setIdOffset(long idOffset)
Deprecated.
Sets the offset that will be added to the returned IDs.
|
void |
setName(String name)
Deprecated.
Sets the name or name pattern for this config.
|
FlakeIdGeneratorConfig |
setNodeIdOffset(long nodeIdOffset)
Deprecated.
Sets the offset that will be added to the node ID assigned to cluster member for this generator.
|
FlakeIdGeneratorConfig |
setPrefetchCount(int prefetchCount)
Deprecated.
Sets how many IDs are pre-fetched on the background when one call to
FlakeIdGenerator.newId() is made. |
FlakeIdGeneratorConfig |
setPrefetchValidityMillis(long prefetchValidityMs)
Deprecated.
Sets for how long the pre-fetched IDs can be used.
|
FlakeIdGeneratorConfig |
setStatisticsEnabled(boolean statisticsEnabled)
Deprecated.
Enables or disables statistics gathering of
LocalFlakeIdGeneratorStats. |
equals, getAsReadOnly, getFactoryId, getId, getIdOffset, getName, getNodeIdOffset, getPrefetchCount, getPrefetchValidityMillis, hashCode, isStatisticsEnabled, readData, toString, writeDatapublic void setName(String name)
FlakeIdGeneratorConfigConfig.setName in class FlakeIdGeneratorConfigpublic FlakeIdGeneratorConfig setPrefetchCount(int prefetchCount)
FlakeIdGeneratorConfigFlakeIdGenerator.newId() is made. Default is 100.
This setting pertains only to newId calls made on the member
that configured it.
setPrefetchCount in class FlakeIdGeneratorConfigprefetchCount - the desired prefetch count, in the range 1..100,000.public FlakeIdGeneratorConfig setPrefetchValidityMillis(long prefetchValidityMs)
FlakeIdGeneratorConfigThe 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.
This setting pertains only to newId calls made on the member
that configured it.
setPrefetchValidityMillis in class FlakeIdGeneratorConfigprefetchValidityMs - the desired ID validity or unlimited, if configured to 0.public FlakeIdGeneratorConfig setIdOffset(long idOffset)
FlakeIdGeneratorConfigIdGenerator, default value works for all green-field projects.
For example: Largest ID returned from IdGenerator is 150. FlakeIdGenerator now
returns 100. If you configure idOffset of 50 and stop using the IdGenerator, the next
ID from FlakeIdGenerator will be 151 or larger and no duplicate IDs will be generated.
In real-life, the IDs are much larger. You also need to add a reserve to the offset because the IDs from
FlakeIdGenerator are only roughly ordered. Recommended reserve is 1<<38,
that is 274877906944.
Negative values are allowed to increase the lifespan of the generator, however keep in mind that the generated IDs might also be negative.
setIdOffset in class FlakeIdGeneratorConfigidOffset - the value added to each generated IDpublic FlakeIdGeneratorConfig setNodeIdOffset(long nodeIdOffset)
FlakeIdGeneratorConfigsetNodeIdOffset in class FlakeIdGeneratorConfignodeIdOffset - the value added to the node idfor the node id logicpublic FlakeIdGeneratorConfig setStatisticsEnabled(boolean statisticsEnabled)
FlakeIdGeneratorConfigLocalFlakeIdGeneratorStats.setStatisticsEnabled in class FlakeIdGeneratorConfigstatisticsEnabled - true if statistics gathering is enabled
(which is also the default), false otherwiseCopyright © 2018 Hazelcast, Inc.. All Rights Reserved.