feat: GETRANGE, SETRANGE, SUBSTR string commands#259
Merged
Conversation
adds two new Keyspace methods: - getrange: substring extraction with negative index support - setrange: partial overwrite with zero-padding, TTL preservation
adds Command::GetRange and Command::SetRange variants with parse functions. SUBSTR aliases to the same parser as GETRANGE.
completes the full vertical slice: - shard dispatch for GetRange (read-only) and SetRange (write) - AOF persistence for SETRANGE with TAG_SETRANGE=32 - recovery replay with zero-padding logic - replication mapping - sharded + concurrent connection handlers - cluster slot checking - CLI help entries for GETRANGE, SETRANGE, SUBSTR
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
full vertical slice for three string range commands:
new AOF record type
SetRange(TAG=32) for persistence. GETRANGE and SUBSTR are read-only so no AOF needed.what was tested
cargo test -p emberkv-core— 64 string tests including 12 new getrange/setrange edge case testscargo test -p ember-protocol— 406 parser tests passcargo test -p ember-persistence— AOF round-trip tests passcargo test -p emberkv-cli— help ordering test passescargo build— clean compilationcluster_delslots,cluster_redirect_followthrough) fail with connection reset — pre-existing, unrelated to this changedesign considerations
Value::String(Bytes)via the existingResponseTag::Getpath — no new response tags neededResponseTag::LenResultOomsince it can trigger OOM on zero-padding expansion