Repository navigation
DOC-7293 Add a Jedis set member expiration example to the sets page - #4526
andy-stark-redis wants to merge 1 commit into
Conversation
🧠 Redis MemoryFound 9 related items from repository history (4 new this commit):
Memory updated at 3453f0c |
…4662) Adds a `member_expiration` step to the PHP `sets_tutorial` example (SADDEX with a 900-second TTL, SADD, STTL) and adds PHP to the existing step's `lang_filter` on the sets page. Node.js already had this step and this mirrors it. Run-verified with the example harness on redis:8.12-rc2 (the server reports 8.11.241) against Predis v3.8.0. The step prints 1, 1, [900,900,-1] and the whole DtSetsTest passes. The example passes the SADDEX condition and TTL modifier as the string literals '' and 'ex' instead of SADDEX::COND_NULL and SADDEX::TTL_EX, so the step needs no `use` import outside the step markers. Learned: the harness only runs composer require when vendor/predis is missing, so work/php can sit on an old Predis Directive: if the PHP step fails with "Command SADDEX is not a registered Redis command", run composer update predis/predis in build/example-test-harness/work/php Gaps: the page was not built with Hugo locally; the other member expiration redis-cli blocks have no PHP steps Recheck: when parked #4526 (Jedis) merges, its lang_filter edit on the same line needs a one-line merge Ticket: DOC-7345 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Adds a member_expiration step to the sets_tutorial Jedis example (SADDEX with SAddExParams, SADD, STTL) and adds Java-Sync to the lang_filter of the matching redis-cli block in the Member expiration section of sets.md. Bumps the harness pom-jedis.xml pin from 8.0.2 to 8.1.0, which is the first release with the API. Unparked after Jedis 8.1.0 shipped. The park snapshot was right about the identifiers: saddex(String, SAddExParams, String...), SAddExParams.sAddExParams().ex(long), sadd and sttl(String, String...) all exist unchanged in 8.1.0, and the step printed 1, 1, [900, 900, -1] as predicted. The example was run with the harness (sets_tutorial jedis) on Jedis 8.1.0 against the local redis:8.12-rc2 server, which reports 8.11.241. The same commands were then checked in redis-cli on redis:8.12 GA (8.12.0) and gave the page's output, but the Java example itself was not run on GA. The PR was built on feature-oss-8.12, which main already contains as a squash, so a rebase would have replayed those commits. This branch is a fresh one from origin/main with only the DOC-7293 commit cherry-picked. main had since added lang_filter "Node.js,PHP" to the same step line, so the conflict was resolved by merging the lists. Other clients stay out of the allowlist unless their support has shipped. A step that is missing for a client renders the whole file for it, so add a client to lang_filter only together with its example. The existing srem step prints res18 after assigning res19 and was left alone. examples/ is gitignored build output, so only local_examples/ changes. Learned: A missing step for a client renders the whole example file, so lang_filter must list exactly the clients that have the step. Constraint: lang_filter on member_expiration must match the clients that have the step in their sets_tutorial file. Directive: Keep fidelity/pom-jedis.xml and the run.sh comment about 8.0.2 in mind; only pom-jedis.xml was bumped here. Gaps: The Java example ran on redis:8.12-rc2 (8.11.241), not on the GA image; only the redis-cli commands were checked on GA. Reversibility: clean Ticket: DOC-7293 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
7f5ec33 to
3453f0c
Compare
Adds a
member_expirationstep to thesets_tutorialJedis example (SADDEXwithSAddExParams,SADD,STTL) and wraps the matching redis-cli block in the Member expiration section ofsets.mdin aclients-exampleshortcode (lang_filter="Java-Sync").Warning
Do not merge yet. This PR documents client APIs that are on the clients' default branches but in no stable release. Base is
feature-oss-8.12(the 8.12 release branch), notmain.Run-verified on
redis:8.12-rc2(the server reportsredis_version:8.11.241, the rc2 version string; upstream tests gate at8.11.240). The wholeSetsExampleran against Jedis master c701a365 with its assertions; the new step printed1,1,[900, 900, -1].Park manifest
Ticket: DOC-7293
Parked at: 2026-11-10
Trigger to pick up: jedis#4828 merge commit e7c37d3d3d5e is an ancestor of a non-prerelease Jedis tag (
gh api repos/redis/jedis/compare/e7c37d3d3d5e...<tag>, expectingbehind_by: 0), and Redis 8.12 is GA.Labels: parked, do not merge yet
Pinned sources (state observed at park time, 2026-11-10)
8.12branch[Experimental]under SER011; integration PR #3343 openRe-fetch:
gh api repos/redis/jedis/pulls/4828 --jq '{state, merged, merge: .merge_commit_sha}'.Observed shape the page assumes
Confidence: MEDIUM for semantics (set members get a per-member TTL,
STTLreturns-1for no expiry); LOW for identifiers, which are unreleased.Identifiers the step uses, all on Jedis master (
SetCommands.java,params/SAddExParams.java):SAddExParams.sAddExParams().ex(long), inheritedexfromBaseSetExParamslong saddex(String key, SAddExParams params, String... members)long sadd(String, String...)List<Long> sttl(String key, String... members)Expected values:
1,1,[900, 900, -1].Re-check checklist
redis:8.12-rc2, 2026-11-10. Repeat on the GA image and the released Jedis.run.shsets_tutorial:jedis) must be bumped, or this step won't compile there.lang_filterallowlist only once its set-expiry API ships: lettuce (docs: remove duplicate 'the' in Redis Cloud SAML SSO guides #3991 merged), predis (Improve heading 3 and heading 4 styles for better visual hierarchy #1749 merged), redis-py/go-redis/node-redis (support unconfirmed, I did not read their source), SE.Redis (DEV: (cmds) update FT.PROFILE and FT.HYBRID commands #3340, experimental), redis-rb (unknown).SPEXPIRE/SPTTL/SPERSIST,SEXPIREAT/SEXPIRETIME) get steps too.sremstep printsres18after assigningres19; pre-existing, left alone.On unpark, then
Run
/unparkwith this PR's number./unparkSteps 4–5 own the closing sequence;/finalizeis deferred until then.Note
Low Risk
Documentation and example-test changes only; no production runtime impact beyond pinning a newer Jedis version in the example harness.
Overview
Adds Java (Jedis) coverage for set member expiration on the sets data-type page and wires it into the runnable example harness.
The Member expiration
clients-exampleshortcode insets.mdnow includesJava-Syncalongside Node.js and PHP.SetsExample.javagains amember_expirationstep that mirrors the redis-cli flow:DEL,SADDEXwithSAddExParams.ex(900),SADD, andSTTL, plus assertions for expected counts and TTLs[900, 900, -1].The Jedis test harness POM is bumped from 8.0.2 → 8.1.0 so the new
saddex/SAddExParamsAPIs compile in CI.Reviewed by Cursor Bugbot for commit 3453f0c. Bugbot is set up for automated code reviews on this repo. Configure here.