Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client: Java ID generator helper #1347

Merged
merged 10 commits into from
Jan 22, 2024
Merged

Client: Java ID generator helper #1347

merged 10 commits into from
Jan 22, 2024

Commits on Dec 11, 2023

  1. java: Uint128.ULID (wip)

    kprotty committed Dec 11, 2023
    Configuration menu
    Copy the full SHA
    14097f5 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Configuration menu
    Copy the full SHA
    f0c14bf View commit details
    Browse the repository at this point in the history
  2. java: fix ULID test + add thread test

    The ULID spec notes that IDs within the same millisecond dont need to be
    ordered: https://github.com/ulid/spec?tab=readme-ov-file#sorting
    kprotty committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    61483e6 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2023

  1. java: ULID random overflow from absolute increment

    Overflow should happen relative to the 80-bit random generated at the
    timestamp rather than relative to a separate counter at the timestamp
    which is applied to the random.
    
    This provides sort order guarantee using the recommended approach from
    the spec: https://github.com/ulid/spec?tab=readme-ov-file#monotonicity
    kprotty committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    744cf77 View commit details
    Browse the repository at this point in the history

Commits on Dec 14, 2023

  1. java: explicitly use zig.exe when on windows

    For setups which download both `zig/zig` and `zig/zig.exe` for convenience
    (i.e. windows WSL), this ensures the Java CI uses the correct one instead of
    relying on shell to append `.exe` (which doesn't happen since non `.exe`
    version exists).
    kprotty committed Dec 14, 2023
    Configuration menu
    Copy the full SHA
    a7361b7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1ac5e48 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2024

  1. java: switch from ULID to unique little-endian IDs

    ULID spec requires storing the values as big endian which means, when interpreted
    by a replica on the Zig side, the `u128` ID is no longer monotonically incrementing.
    This resorts in unique but effectively randomly-ordered IDs which doesn't take
    advantage of data/lookup optimizations in the storage engine.
    
    Instead, the Java client now exposes a generic `ID()` helper (instead of specifically `ULID`)
    which allows us to return u128 bytes in little-endian format while still using the core
    ideas around uniqueness & monotonicity from ULID underneath.
    kprotty committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    fd75ed2 View commit details
    Browse the repository at this point in the history
  2. java: Use contiguous 48bit timestamp & update docs

    Switches to using the 48 LSB of timestamp instead of 16 LSB and 32 MSB. Also updates the data-modeling
    documentation to give note about storing ULID fields in little endian.
    kprotty committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    f3c3ebc View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2024

  1. java: cleanup ID() comments & literals

    Standardize upper-case hex literals and refer to ULID spec as `ID()`'s inspiration.
    kprotty committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    44ad375 View commit details
    Browse the repository at this point in the history

Commits on Jan 22, 2024

  1. java: mvn format

    kprotty committed Jan 22, 2024
    Configuration menu
    Copy the full SHA
    74cb305 View commit details
    Browse the repository at this point in the history