Class RedisKeys

java.lang.Object
tech.skworks.tachyon.service.infra.RedisKeys

public final class RedisKeys extends Object
Project Tachyon Class RedisKeys

Single source of truth for the player-lifecycle Redis keys and their TTLs.

These prefixes and durations used to be duplicated as literals across PlayerDataGrpcService, PlayerSessionGrpcService and PlayerDataStreamWorker. Centralizing them guarantees the cross-server ownership lock (STATE_PREFIX) is renewed by the heartbeat with the exact same TTL it is acquired with — the invariant the anti-duplication guarantee depends on.

Since:
1.0.0-SNAPSHOT
Version:
1.0
Author:
Jimmy (vSKAH)
  • Field Details

    • STATE_PREFIX

      public static final String STATE_PREFIX
      Cross-server ownership lock: set NX EX on pull, renewed by heartbeats.
      See Also:
    • DIRTY_PREFIX

      public static final String DIRTY_PREFIX
      Save-in-progress guard: blocks a concurrent pull while data is being persisted.
      See Also:
    • CACHE_PREFIX

      public static final String CACHE_PREFIX
      Hot read cache of the last known profile.
      See Also:
    • STATE_TTL_SECONDS

      public static final int STATE_TTL_SECONDS
      TTL (seconds) of the ownership lock — MUST match the heartbeat renewal delay.
      See Also:
    • DIRTY_TTL_SECONDS

      public static final int DIRTY_TTL_SECONDS
      TTL (seconds) of the dirty guard.
      See Also:
    • CACHE_TTL_SECONDS

      public static final int CACHE_TTL_SECONDS
      TTL (seconds) of the read cache.
      See Also:
  • Method Details