Package me.ahoo.cosid.internal


package me.ahoo.cosid.internal
Not API. The implementation of the runtime, the generators and the codecs: not exported by the module, and anything here may change or go in any release, also within 5.x. Use the exported packages.
  • Class
    Description
    Fills the CosId field of an entity (07-runtime-and-spring.md §3).
    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.
    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.
    A cursor with a deadline, for BatchPolicy.rangeTtl (04-segment.md §2): past it the rest of the range is dropped.
    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.
    The local host name of a derived owner key (07-runtime-and-spring.md §1.1).
    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.
    The preset periods: calendar years, months and days in a time zone, keyed by their PatternPeriod.pattern().
    The range a segment generator issues from (04-segment.md §2.1): one atomic increment and one comparison per value.
    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 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.
    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.
    Finds the StoreProvider of a store type (06-stores.md §1): the explicit providers (Spring beans or RuntimeOptions.storeProviders) first, then those ServiceLoader finds.
    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 sequencer of a time-based generator (03-core-model.md §4.1, 05-machine-lease.md §4.1).
    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.