Module me.ahoo.cosid.core
Package me.ahoo.cosid.segment
package me.ahoo.cosid.segment
Segment generators (04-segment.md): the store primitive
RangeStore, the batch
and period policies, and the plain and periodic segment generators.-
ClassDescriptionHow a
SegmentGeneratorreserves ranges (04-segment.md §2).Builds aBatchPolicy;BatchPolicy.Builder.build()checks the fields.The period of a periodic segment (04-segment.md §3): presetsPeriod.YEAR,Period.YEAR_MONTHandPeriod.YEAR_MONTH_DAY, or your own.How aPeriodicSegmentGeneratormoves between periods (04-segment.md §3).Builds aPeriodicPolicy;PeriodicPolicy.Builder.build()checks the fields.Segments grouped by period (D5, 04-segment.md §3): at most twoSegmentGenerators, the current period's and the next one's, at the store keys{key}/{period}.A range reserved from aRangeStore:[start, end)(04-segment.md §1).Reserves ranges atomically, the segment primitive of a store (04-segment.md §1).Issues the values of ranges reserved from aRangeStore(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.