docs: Java API ref, C++/Java GSG variants, DB_TXN_SNAPSHOT_SAFE - #132
Merged
Conversation
Coccinelle convention checksNo new violations. ✅ Resolved since baseline (2) -- update dist/cocci/baseline.txt to lock these in. |
The lang/java binding is supported (com.sleepycat.db/bind/collections/persist, 337 sources) but the old DocBook migration left the Java API undocumented. Add a build_java_api() step to docs_src/build.py that runs javadoc over the public com.sleepycat.* packages into docs-build/html/java-api/ (a generated artifact, gitignored) so the Java reference always matches the current code rather than the frozen 2013 HTML. - javadoc scope = the historical public package set (excludes bundled ASM, compat shims, db.internal/persist.impl/util.keyrange internals); -sourcepath spans all of lang/java/src so referenced internals still resolve. - -Xdoclint:none keeps the 2005-era doc-comment HTML warnings-only under javadoc 21; version-stamped -windowtitle/-doctitle; -notimestamp for reproducible output; guarded on javadoc availability (skip-with-note like the PDF path). - flake devShell gains pkgs.jdk so CI's nix develop has javadoc. - index.md links the generated tree under API reference, noted as javadoc-generated (not part of the Markdown no-loss gate). make docs / ninja docs / docs.yml all drive build.py, so the javadoc step is wired automatically.
The three Getting-Started guides (gsg, gsg_txn, gsg_db_rep) were migrated C-variant-only. Extract the CXX and JAVA variants from the gh-pages DocBook archive with the proven docs_src/_migrate/extract.py into cxx/ and java/ subdirs, each with its own _meta.toml (reading order derived from the source index.html TOC). The guide landings become C/C++/Java language pickers and docs_src/index.md links all three variants; each variant index reciprocates. Retention (verify.py vs gh-pages source, --threshold 0.99): guide variant pages word-retention hard-drops gsg C++ 37 100.00% 0 gsg Java 62 100.00% 0 gsg_txn C++ 38 100.00% 0 gsg_txn Java 39 100.00% 0 gsg_db_rep C++ 26 100.00% 0 gsg_db_rep Java 25 100.00% 0 gsg_txn's 7 diagram JPEGs are copied into each variant's img/ (build.py flattens img/ into the page dir, as for the C variant). Per-language code samples are preserved verbatim. build.py picks up the .md automatically; each variant subdir's titled _meta.toml also yields its own PDF book. The javadoc-generated java-api/ tree carries doc-comment cross-links to the old DocBook layout that dangle here; it is a build artifact outside the no-loss gate, so docs.yml's lychee link-check excludes it via --exclude-path. Internal link check: 0 errors across the full site (java-api excluded).
DB_TXN_SNAPSHOT_SAFE (0x800) is our SSI addition -- snapshot isolation plus Cahill serializable conflict detection -- but was undocumented. Document it wherever DB_TXN_SNAPSHOT is documented, with wording verified against the engine (src/txn/txn.c, src/lock/lock.c, src/env/env_method.c): - api/c/txnbegin.md: DB_TXN_SNAPSHOT_SAFE flag entry -- implies DB_TXN_SNAPSHOT, layers serializable conflict detection, may abort with DB_SNAPSHOT_UNSAFE / DB_SNAPSHOT_CONFLICT, and cannot be prepared for 2PC (DB_TXN->prepare returns EINVAL). Also documented DB_TXN_FAMILY, the one other txn_begin flag that was missing. - api/c/envset_flags.md: note that SSI is per-transaction only -- the env OK_FLAGS mask accepts DB_TXN_SNAPSHOT but not _SAFE. - guides/gsg_txn/isolation.md + guides/programmer_reference/transapp_read.md: a Serializable Snapshot Isolation subsection (SI vs SSI, the return codes, the 2PC restriction). - guides/programmer_reference/program_errorret.md: the DB_SNAPSHOT_UNSAFE (-30967) and DB_SNAPSHOT_CONFLICT (-30968) return codes. FLAG RECONCILE (docs_src/_migrate/flag-reconcile.md): diffed the public txn/env flag surfaces (txn.c __db_fchk mask, env OK_FLAGS) against the api docs. Every txn_begin flag is now documented. DB_READ_COMMITTED/DB_READ_UNCOMMITTED/ DB_MPOOL_AIO were already documented. DB_DATABASE_LOCKING and DB_NOFLUSH remain undocumented set_flags flags, but they are pre-existing non-SSI gaps and left out of this SSI-focused pass. There is no DB_TXN_SNAPSHOT_UNSAFE flag -- DB_SNAPSHOT_UNSAFE is a return code. Baselined the verbatim legacy typos the new GSG C++/Java variants carried over from DocBook (matching the C variant's existing baseline entries) and trimmed one stale baseline entry for the removed csharp.md.
ABI diff vs
|
gburd
force-pushed
the
docs/java-gsg-ssi
branch
from
August 3, 2026 17:58
bbbdc57 to
565b696
Compare
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.
Completes the libdb documentation set the DocBook migration left out: the Java
API reference, the C++/Java Getting-Started guide variants, and the SSI flag
docs + a flag reconcile. All work flows through the existing docs pipeline
(
docs_src/build.py, version single-sourced at 5.3.33) and the docs.yml gates.Task 1 — Java API reference (regenerated from source)
lang/javais a supported binding but the olddocs/java/Javadoc was nevermigrated. Rather than extract the frozen 2013 HTML, this regenerates it
from
lang/java/src/so it always matches the current code.build_java_api()indocs_src/build.pyruns javadoc over the publiccom.sleepycat.*packages (the historical published set; excludes bundledASM, compat shims, and
db.internal/persist.impl/util.keyrangeinternals —
-sourcepathspans all oflang/java/srcso references stillresolve) into
docs-build/html/java-api/(a gitignored build artifact).-Xdoclint:nonekeeps the 2005-era doc-comment HTML warnings-only underjavadoc 21; version-stamped
-windowtitle/-doctitle;-notimestamp.Guarded on javadoc availability (skip-with-note, like the PDF path).
flakedevShell gainspkgs.jdkso CI'snix develophas javadoc.index.mdlinks it under API reference, noted as javadoc-generated (notpart of the Markdown no-loss gate).
make docs/ninja docs/ docs.yml all drivebuild.py.Spot-check:
docs-build/html/java-api/index.htmllistscom.sleepycat.db;Database.html,Environment.html,Transaction.htmlrender with methods(e.g. Transaction:
abort,commit,prepare). 237 class pages.Task 2 — C++/Java Getting-Started guide variants
The three GSG guides were migrated C-only. The CXX/JAVA variants are extracted
from the gh-pages DocBook archive with the proven
extract.pyintocxx/andjava/subdirs (each with its own_meta.toml, order from the source TOC).Guide landings become C/C++/Java language pickers;
index.mdlinks all three.Retention (
verify.pyvs gh-pages source,--threshold 0.99):gsg_txn's 7 diagram JPEGs are copied into each variant's
img/; per-languagecode samples preserved verbatim. Each variant's titled
_meta.tomlalso yieldsits own PDF book (19 books total now, all validated).
The generated
java-api/tree carries doc-comment cross-links to the oldDocBook layout that dangle here; it's a build artifact outside the no-loss
gate, so docs.yml's lychee link-check excludes it via
--exclude-path.Task 3 — DB_TXN_SNAPSHOT_SAFE + flag reconcile
DB_TXN_SNAPSHOT_SAFE(0x800) is our SSI addition (SI + Cahill serializableconflict detection), undocumented until now. Wording verified against the
engine (
src/txn/txn.c,src/lock/lock.c,src/env/env_method.c):api/c/txnbegin.md— the flag: impliesDB_TXN_SNAPSHOT, layersserializable conflict detection, may abort with
DB_SNAPSHOT_UNSAFE/DB_SNAPSHOT_CONFLICT, and cannot be prepared for 2PC (prepare→ EINVAL).Also documented
DB_TXN_FAMILY(the one other missingtxn_beginflag).api/c/envset_flags.md— SSI is per-transaction only (envOK_FLAGSaccepts
DB_TXN_SNAPSHOTbut not_SAFE).guides/gsg_txn/isolation.md+guides/programmer_reference/transapp_read.md— a Serializable Snapshot Isolation subsection (SI vs SSI, the return codes,
the 2PC restriction).
guides/programmer_reference/program_errorret.md— theDB_SNAPSHOT_UNSAFE(-30967) andDB_SNAPSHOT_CONFLICT(-30968) codes.Flag reconcile (
docs_src/_migrate/flag-reconcile.md): everytxn_beginflag is now documented;
DB_READ_COMMITTED/DB_READ_UNCOMMITTED/DB_MPOOL_AIOwere already documented.
DB_DATABASE_LOCKINGandDB_NOFLUSHremainundocumented
set_flagsflags but are pre-existing non-SSI gaps, left out ofthis SSI-focused pass. There is no
DB_TXN_SNAPSHOT_UNSAFEflag —DB_SNAPSHOT_UNSAFEis a return code.Validation
build.py: 1690 HTML + 789 man + Java API + 19 PDF books, all v5.3.33.build.py --selfcheck: OK.man_coverage.py --ci): PASS (all public functionsdocumented; SNAPSHOT_SAFE is a flag, not a method — method gate unaffected).
matching the C variant; one stale
csharp.mdbaseline entry trimmed).api/c(470 pages, 100%) and gsg C-variant (37 pages,100%) against gh-pages: no regression (extract.py untouched).
No
src/engine changes (Task 3 is docs about the flag). No AWS / otherworkflows touched except docs.yml (java-api link-check exclude).