All Classes and Interfaces
Class
Description
Which step of the slot choice (05-machine-lease.md §2.1) gave the slot; the store reports it, for observation only.
A slot was acquired.
Builds an
AcquireResult.Acquired.Every slot below the limit is held.
Fills the
CosId field of an entity (07-runtime-and-spring.md §3).How a
SegmentGenerator reserves ranges (04-segment.md §2).Builds a
BatchPolicy; BatchPolicy.Builder.build() checks the fields.Sizes reservations by a time budget (04-segment.md §2):
min(maxBatch, roundUpToStep(rate * lookahead)), at
least step.Resolves a custom codec reference as a class name: a public
IdCodec with a public no-argument constructor.The clock went back further than the
ClockRegressionPolicy allows (03-core-model.md §4).What a time-based generator does when the clock goes back (03-core-model.md §4): up to
borrowUpTo it keeps
issuing in the last time unit (borrowing from the future), up to waitUpTo it waits, beyond that it throws
ClockBackwardsException.Builds the codecs of a runtime from their specs (07-runtime-and-spring.md §4.1): a codec list applies in order, its
first item turns the id into text and the rest decorate the text.
An item of a generator's codec list (07-runtime-and-spring.md §4.1).
A user codec, by class name or (in Spring) bean name, resolved through
RuntimeOptions.codecs().me.ahoo.cosid.codec.DatePrefix.me.ahoo.cosid.codec.Friendly; time-based generators only.A codec instance, for specs built in code.
A text prefix.
me.ahoo.cosid.codec.Radix.A text suffix.
Marks the id field
IdFiller fills (07-runtime-and-spring.md §3).The root of the CosId exceptions.
The one registry and lifecycle owner of stores, the machine slot and generators (07-runtime-and-spring.md §1).
A date prefix, such as
20261026-, put before the text of another codec (03-core-model.md §1).Where the date of the prefix comes from.
A cursor with a deadline, for
BatchPolicy.rangeTtl (04-segment.md §2): past it the rest of the range is
dropped.Encodes a time-based id as readable text,
yyyyMMddHHmmssSSS-<node>-<seq>, from Layout.unpack(long);
the time zone is always explicit (03-core-model.md §1).The generator is disabled by configuration (D24, 07-runtime-and-spring.md §4.1).
A generator of a runtime with the views its lookups hand out: its
long, int, parts or grouped ids, its
codec, its text ids and the generator itself.What
CosIdRuntime.describe() tells about a generator; replaces the 4.x Stat types.Builds a
GeneratorInfo.Generator, lease and store events (07-runtime-and-spring.md §2).
A generator of a
RuntimeSpec, by strategy.A time-based generator wider than a
long (Layout.COSID_80 by default), issuing parts and text
only.Builds a
GeneratorSpec.CosId80.A user
long generator by reference, for configuration: CosIdRuntime.start resolves the reference
through RuntimeOptions.generators() and fails when it resolves to nothing.Builds a
GeneratorSpec.Custom.A declared generator that is not created (D24, 07-runtime-and-spring.md §4.1): looking it up throws
GeneratorDisabledException.A user
long generator instance, for specs built in code.Builds a
GeneratorSpec.Instance.A periodic segment generator.
Builds a
GeneratorSpec.PeriodicSegment.A segment generator.
Builds a
GeneratorSpec.Segment.A time-based generator packing
long ids.Builds a
GeneratorSpec.Snowflake.UUIDv7 ids (D46, RFC 9562 §5.7, a 16-bit counter):
UuidV7Generator, ordered within
the instance and unique without coordination.Builds a
GeneratorSpec.UuidV7; it has no settings yet, and may gain some with defaults.The codec of a
GeneratorSpec.PeriodicSegment generator.GroupedCodec.datePrefix(me.ahoo.cosid.segment.Period, String, me.ahoo.cosid.codec.IdCodec, java.util.function.UnaryOperator): the period key, the delimiter, then the value; outer decorates the
whole, so with a prefix in it the period follows a business prefix (the 4.x group-prefix.before-prefix).A codec instance, for specs built in code.
GroupedCodec.valueOnly(me.ahoo.cosid.codec.IdCodec): the text holds the value alone, without its period (the 4.x
group-prefix.enabled = false); such text cannot be decoded.An id of a periodic segment: the period it belongs to and its value within the period (04-segment.md §3).
Generates ids grouped by period; implemented by
PeriodicSegmentGenerator, and the view
of a periodic-segment generator.Resolves the host part of a derived owner key (07-runtime-and-spring.md §1.1); Spring Cloud supplies one backed by
InetUtils.Turns a
long id into text and back (03-core-model.md §1).Fills the
CosId field of an entity when it is not set yet (<= 0 or empty); long/Long,
int/Integer (range checked) and String fields: the generator's text, as text(name)
gives it (its codec, the 80-bit or periodic text, the canonical UUIDv7 form)
(07-runtime-and-spring.md §3).Generates
long ids.Small combinators that replace the 4.x generator classes of the same purpose (03-core-model.md §5).
An id does not fit where it goes (03-core-model.md §5): the narrower type it is converted to, or the bits left
beside the random bits of
IdGenerators.uncertain(me.ahoo.cosid.IdGenerator, int, java.util.random.RandomGenerator).The parts of a time-based id (03-core-model.md §2).
Generates
int ids, see IdGenerators.toInt(IdGenerator).The bit layout of time-based ids,
time | node | seq from the high bits down: the one place of the bit
arithmetic (03-core-model.md §2).Holds the slot lease of a runtime (05-machine-lease.md §4.2): acquires it at
LeaseKeeper.start(), renews it every
ttl/3 with backoff, re-acquires a lost slot and publishes each holding as a SlotBinding.The local host name of a derived owner key (07-runtime-and-spring.md §1.1).
The machine slot of a runtime (D18, 05-machine-lease.md).
A slot leased from a store.
Builds a
MachineSpec.Leased.A slot the user keeps unique, with a local window file.
Builds a
MachineSpec.Static.A namespace was first used with another slot limit, tolerance or slot offset (06-stores.md §1): every client of a
namespace must use the same
bits, tolerance and slotOffset.The stores as the runtime hands them to its generators and lease keeper: every call that fails with a
StoreTimeoutException (itself or as a cause) is reported to GeneratorListener.onStoreTimeout(java.lang.String, java.lang.String) with the
store's name and the operation, then rethrown unchanged.Who holds a slot lease (05-machine-lease.md §2).
Encodes the parts of a time-based id as text; the only output of ids wider than 63 bits, such as
Layout.COSID_80 (D4).The codec of a
GeneratorSpec.CosId80 generator.A codec instance, for specs built in code.
Generates ids as their parts, for layouts wider than a
long such as the 80-bit CosId; implemented by
TimeBasedGenerator, and the view of a cosid80 generator.The preset periods: calendar years, months and days in a time zone, keyed by their
PatternPeriod.pattern().The period of a periodic segment (04-segment.md §3): presets
Period.YEAR, Period.YEAR_MONTH and
Period.YEAR_MONTH_DAY, or your own.How a
PeriodicSegmentGenerator moves between periods (04-segment.md §3).Builds a
PeriodicPolicy; PeriodicPolicy.Builder.build() checks the fields.Segments grouped by period (D5, 04-segment.md §3): at most two
SegmentGenerators, the current period's and
the next one's, at the store keys {key}/{period}.Encodes non-negative ids in base 2 to 62 with the digits
0-9A-Za-z; replaces the 4.x
ToStringIdConverter, Radix36IdConverter and Radix62IdConverter (03-core-model.md §1).A range reserved from a
RangeStore: [start, end) (04-segment.md §1).The range a segment generator issues from (04-segment.md §2.1): one atomic increment and one comparison per value.
A reservation would pass
Long.MAX_VALUE: ranges never wrap around (04-segment.md §1, S5).The range key is sealed: it never issues a range again (04-segment.md §1, S6).
Reserves ranges atomically, the segment primitive of a store (04-segment.md §1).
No range could be reserved within the reserve timeout, or a refill is backing off after a failure (04-segment.md §2.1).
Store options as a
toString shows them, without their secrets (R2-core-02): the value of a key whose
canonical form names a password, token, secret or credential is ***, and a URL loses the password of its
user info and its password= / pwd= parameters.What a
CosIdRuntime starts with besides its RuntimeSpec: everything that is not configuration.Builds
RuntimeOptions.What a runtime is made of, assembled in order (stores, the machine slot, generators) and closed in reverse
(07-runtime-and-spring.md §1, 05-machine-lease.md §4.3).
A
RuntimeSpec checked as a whole before anything starts (07-runtime-and-spring.md §1): every problem is
reported at once, and the codecs are built.A generator to create.
A machine to start.
Everything a
CosIdRuntime starts from (07-runtime-and-spring.md §1).Builds a
RuntimeSpec.Dispatches the runtime's events to the user's listener (07-runtime-and-spring.md §2): a listener that throws is
logged, never fails the generator, refill or renewal that raised the event.
Issues the values of ranges reserved from a
RangeStore (04-segment.md §2): one atomic increment on the hot
path, refills off the lock and single-flight, reservation size adapted to a time budget.One holding of a slot and its time window (05-machine-lease.md §4.1).
The machine slot of a runtime, shared by its time-based generators (D18, 05-machine-lease.md §4.1).
A lease of a time window
(floor, ceiling] on a slot (05-machine-lease.md §2).Builds a
SlotLease; SlotLease.Builder.build() checks the fields.Leases time windows on machine slots, the lease primitive of a store (05-machine-lease.md §2).
The machine slot binding a generator read was invalidated: its lease was lost (05-machine-lease.md §4.2).
The timestamp to issue lies beyond the ceiling of the slot window (05-machine-lease.md §3).
A slot the user keeps unique (manual or StatefulSet ordinal), with a time window from a local file
(05-machine-lease.md §4.4): the file holds the ceiling, written ahead and fsynced before use, so a crash followed by
a clock regression cannot repeat ids.
An open store: its range and slot lease primitives (06-stores.md §1).
What a
StoreProvider opens a store with (06-stores.md §1).Builds a
StoreConfig; StoreConfig.Builder.build() checks the fields.The keys every backend stores alike (R1-spi-02, 06-stores.md §1): namespaces, the names of generators and machines,
and the range and owner keys made from them.
The options of a store matched to the keys its provider declares (R1-spi-01, R1-spring-01): case,
- and
_ do not count, so an environment variable (..._OPTIONS_INITSCHEMA) and kebab-case
(init-schema) reach initSchema; any other key is a problem.Opens stores of one type (06-stores.md §1); found through
ServiceLoader or given to the runtime
(as a Spring bean, say), both along the same path.Finds the
StoreProvider of a store type (06-stores.md §1): the explicit providers (Spring beans or
RuntimeOptions.storeProviders) first, then those ServiceLoader finds.A store of a
RuntimeSpec, declared once and referred to by name.Builds a
StoreSpec.A store operation did not complete within
StoreConfig.timeout(): the backend's native timeout fired
(06-stores.md §1).An
IdGenerator paired with the IdCodec that turns its ids into text.Elapsed time for the schedules of the lease and window keepers: monotonic, unlike the wall clock the ids use, so a
clock step neither stalls nor rushes a renewal.
The time-based generator: Snowflake layouts and the 80-bit CosId alike (03-core-model.md §4).
The time of a time-based generator no longer fits the time bits of its layout (03-core-model.md §4); replaces 4.x
TimestampOverflowException.The sequencer of a time-based generator (03-core-model.md §4.1, 05-machine-lease.md §4.1).
The time every generator reads (03-core-model.md §3); tests inject a controllable one.
UUIDv7 ids (D46, RFC 9562 §5.7): a 48-bit Unix millisecond timestamp, version 7, a 16-bit counter (the 12 bits of
rand_a and the top 4 bits of rand_b), variant 0b10 and 58 random bits.The window file of a
StaticSlot (05-machine-lease.md §4.4): one ceiling, written to a temporary file,
fsynced, then moved over the old file atomically, so a crash leaves either the old or the new ceiling, never a torn
one.