Skip to content

Add arbitrary-timestamp ID generation to DistributedUniqueTimeProvider#720

Draft
yossarin wants to merge 1 commit into
OpenHFT:eafrom
yossarin:feature/custom-epoch-and-timestamp-id-generation
Draft

Add arbitrary-timestamp ID generation to DistributedUniqueTimeProvider#720
yossarin wants to merge 1 commit into
OpenHFT:eafrom
yossarin:feature/custom-epoch-and-timestamp-id-generation

Conversation

@yossarin

@yossarin yossarin commented Apr 13, 2026

Copy link
Copy Markdown

Summary

  • Arbitrary-timestamp ID generation: new uniqueIdForNanos(long) and uniqueIdForMicros(long) methods that generate unique IDs based on a caller-supplied timestamp instead of the current wall-clock time — useful for event replay, back-filling, or importing historical data.
  • Preserves the existing CAS-based uniqueness and monotonicity guarantees via the shared memory-mapped file.
  • New tests covering unique ID generation from custom timestamps (monotonicity, past-timestamp advancement, multi-host uniqueness).

Test plan

  • All existing + new tests pass (mvn test -Dtest=DistributedUniqueTimeProviderTest)
  • Benchmark uniqueIdForNanos performance under contention

@yossarin yossarin force-pushed the feature/custom-epoch-and-timestamp-id-generation branch from 628e94e to 79f65c2 Compare April 13, 2026 12:28
Add uniqueIdForNanos() and uniqueIdForMicros() methods that generate
unique, monotonically increasing IDs for a given timestamp rather than
the current wall-clock time. Useful for producing identifiers for
events that occurred at a known time.
@yossarin yossarin force-pushed the feature/custom-epoch-and-timestamp-id-generation branch from 79f65c2 to 1f0c2d1 Compare April 14, 2026 08:30
@yossarin yossarin marked this pull request as draft April 14, 2026 08:49
@yossarin yossarin changed the title Add custom epoch and arbitrary-timestamp ID generation Add arbitrary-timestamp ID generation to DistributedUniqueTimeProvider Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants