com.hazelcast.config

## Class FlakeIdGeneratorConfigReadOnly

- java.lang.Object
- - com.hazelcast.config.FlakeIdGeneratorConfig
  - - com.hazelcast.config.FlakeIdGeneratorConfigReadOnly

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable

  Deprecated.
  this class will be removed in 4.0; it is meant for internal usage only.

      public class FlakeIdGeneratorConfigReadOnly
      extends FlakeIdGeneratorConfig

  See `FlakeIdGeneratorConfig`

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.config.FlakeIdGeneratorConfig

      `DEFAULT_PREFETCH_COUNT, DEFAULT_PREFETCH_VALIDITY_MILLIS, MAXIMUM_PREFETCH_COUNT`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    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`.

    - ### Methods inherited from class com.hazelcast.config.FlakeIdGeneratorConfig

      `equals, getAsReadOnly, getFactoryId, getId, getIdOffset, getName, getNodeIdOffset, getPrefetchCount, getPrefetchValidityMillis, hashCode, isStatisticsEnabled, readData, toString, writeData`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### setName

          public void setName(String name)

      Deprecated.
      Description copied from class: `FlakeIdGeneratorConfig`
      Sets the name or name pattern for this config. Must not be modified after this instance is added to `Config`.
      Overrides:
        `setName` in class `FlakeIdGeneratorConfig`

    - #### setPrefetchCount

          public FlakeIdGeneratorConfig setPrefetchCount(int prefetchCount)

      Deprecated.
      Description copied from class: `FlakeIdGeneratorConfig`
      Sets how many IDs are pre-fetched on the background when one call to `FlakeIdGenerator.newId()` is made. Default is 100.

      This setting pertains only to `newId` calls made on the member that configured it.

      Overrides:
        `setPrefetchCount` in class `FlakeIdGeneratorConfig`
      Parameters:
        `prefetchCount` - the desired prefetch count, in the range 1..100,000.
      Returns:
        this instance for fluent API

    - #### setPrefetchValidityMillis

          public FlakeIdGeneratorConfig setPrefetchValidityMillis(long prefetchValidityMs)

      Deprecated.
      Description copied from class: `FlakeIdGeneratorConfig`
      Sets for how long the pre-fetched IDs can be used. If this time elapses, a new batch of IDs will be fetched. Time unit is milliseconds, default is 600,000 (10 minutes).

      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.

      This setting pertains only to `newId` calls made on the member that configured it.

      Overrides:
        `setPrefetchValidityMillis` in class `FlakeIdGeneratorConfig`
      Parameters:
        `prefetchValidityMs` - the desired ID validity or unlimited, if <=0
      Returns:
        this instance for fluent API

    - #### setIdOffset

          public FlakeIdGeneratorConfig setIdOffset(long idOffset)

      Deprecated.
      Description copied from class: `FlakeIdGeneratorConfig`
      Sets the offset that will be added to the returned IDs. Default value is 0. Setting might be useful when migrating from `IdGenerator`, 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.

      Overrides:
        `setIdOffset` in class `FlakeIdGeneratorConfig`
      Parameters:
        `idOffset` - the value added to each generated ID
      Returns:
        this instance for fluent API

    - #### setNodeIdOffset

          public FlakeIdGeneratorConfig setNodeIdOffset(long nodeIdOffset)

      Deprecated.
      Description copied from class: `FlakeIdGeneratorConfig`
      Sets the offset that will be added to the node ID assigned to cluster member for this generator. Might be useful in A/B deployment scenarios where you have cluster A which you want to upgrade. You create cluster B and for some time both will generate IDs and you want to have them unique. In this case, configure node ID offset for generators on cluster B.
      Overrides:
        `setNodeIdOffset` in class `FlakeIdGeneratorConfig`
      Parameters:
        `nodeIdOffset` - the value added to the node id
      Returns:
        this instance for fluent API
      See Also:
        `for the node id logic`

    - #### setStatisticsEnabled

          public FlakeIdGeneratorConfig setStatisticsEnabled(boolean statisticsEnabled)

      Deprecated.
      Description copied from class: `FlakeIdGeneratorConfig`
      Enables or disables statistics gathering of `LocalFlakeIdGeneratorStats`.
      Overrides:
        `setStatisticsEnabled` in class `FlakeIdGeneratorConfig`
      Parameters:
        `statisticsEnabled` - `true` if statistics gathering is enabled (which is also the default), `false` otherwise
      Returns:
        this instance for fluent API

Copyright © 2019. All rights reserved.