Class GeneratorInfo

java.lang.Object
me.ahoo.cosid.observe.GeneratorInfo

public final class GeneratorInfo extends Object
What CosIdRuntime.describe() tells about a generator; replaces the 4.x Stat types. Immutable; built with builder(String, String), the only way to create one, so fields can be added with a default (api-freeze.md ยง4).

The details() keys by strategy (R1-core-17):

details keys
strategykeys
snowflake, cosid80epoch unit timeBits nodeBits seqBits lastIssuedMillis slot floor ceiling slotValid node machine machineNamespace (node is the slot plus the slot offset, the node the ids carry)
segmentkey step maxBatch lookahead reserveTimeout batch held
periodic-segmentthose of segment, and zone prewarm sealAfter period
customclass
uuidv7version text
anygenerated while counting (RuntimeOptions.countGenerated); a disabled generator has disabled alone
A listed key is never renamed nor removed; a minor version may add keys. The values are only String, Number and Boolean.
  • Method Details

    • builder

      public static GeneratorInfo.Builder builder(String name, String strategy)
      A builder of a generator description.
      Parameters:
      name - the generator name
      strategy - snowflake, cosid80, segment, periodic-segment, custom or uuidv7
      Returns:
      the builder
    • name

      public String name()
      The generator name.
      Returns:
      the name
    • strategy

      public String strategy()
      The strategy: snowflake, cosid80, segment, periodic-segment, custom or uuidv7.
      Returns:
      the strategy
    • store

      public String store()
      The store name.
      Returns:
      the store name; empty (the default) for time-based, custom and uuidv7 generators
    • details

      public Map<String,Object> details()
      Layout, slot, window, ready range headroom, batch size and the like.
      Returns:
      the details, unmodifiable; default none
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object