Class RedisKeys
java.lang.Object
tech.skworks.tachyon.service.infra.RedisKeys
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringHot read cache of the last known profile.static final intTTL (seconds) of the read cache.static final StringSave-in-progress guard: blocks a concurrent pull while data is being persisted.static final intTTL (seconds) of the dirty guard.static final StringCross-server ownership lock: setNX EXon pull, renewed by heartbeats.static final intTTL (seconds) of the ownership lock — MUST match the heartbeat renewal delay. -
Method Summary
-
Field Details
-
STATE_PREFIX
Cross-server ownership lock: setNX EXon pull, renewed by heartbeats.- See Also:
-
DIRTY_PREFIX
Save-in-progress guard: blocks a concurrent pull while data is being persisted.- See Also:
-
CACHE_PREFIX
-
STATE_TTL_SECONDS
public static final int STATE_TTL_SECONDSTTL (seconds) of the ownership lock — MUST match the heartbeat renewal delay.- See Also:
-
DIRTY_TTL_SECONDS
public static final int DIRTY_TTL_SECONDSTTL (seconds) of the dirty guard.- See Also:
-
CACHE_TTL_SECONDS
public static final int CACHE_TTL_SECONDSTTL (seconds) of the read cache.- See Also:
-
-
Method Details
-
state
-
dirty
-
cache
-