Merged
Conversation
add three convenience commands that client libraries and Redis-compatible tools occasionally probe for. none of these touch the hot path. - RANDOMKEY: returns a random key from the database, or nil if empty. broadcasts across all shards and picks a random result. - TOUCH key [key ...]: updates last access time for given keys, returns count of keys that existed. uses the same multi_key_bool fan-out pattern as DEL/EXISTS. - SORT key [ASC|DESC] [ALPHA] [LIMIT offset count] [STORE dest]: sorts a list, set, or sorted set. STORE variant does two-phase sort+rpush. BY/GET patterns intentionally deferred (rarely used, adds complexity).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
adds three convenience commands from the audit backlog (#20) that client libraries and Redis-compatible tools occasionally probe for. none touch the hot path — zero impact on GET/SET throughput.
engine.broadcast()and picks a random result using reservoir sampling.multi_key_bool+route_multifan-out pattern as DEL/EXISTS.~80 LOC new logic, ~40 LOC modified across 6 files (plus tests and CLI metadata).
what was tested
cargo fmt --all --check— cleancargo clippy --workspace -- -D warnings— cleancargo test -p ember-protocol— 406 passedcargo test -p emberkv-core— 401 passedcargo test -p ember-server— 134 passedcargo test -p ember-integration-tests— 79 passeddesign considerations
route!macro for batch dispatch efficiency; SORT with STORE falls through toexecute()for two-phase inline handling (sort on source shard → del+rpush on dest shard)READ | KEYSPACE | FAST(matching Redis), not as a write — it only updates LRU metadata, not user-visible stateexists()for TOUCH (no last_access tracking in DashMap entries)