singhvishalkr opened a new pull request, #1121:
URL: https://github.com/apache/pulsar-site/pull/1121

   ## Motivation
   
   Fixes #24086.
   
   `pulsar-admin topics truncate` has been shipping for years, but the 
operator-facing docs page 
[admin-api-topics](https://pulsar.apache.org/docs/4.2.x/admin-api-topics/) 
doesn't mention it anywhere. This leaves users to discover the command only via 
`pulsar-admin topics --help` or by reading source code, and the companion Java 
admin API (`Topics#truncate`) / REST endpoint (`DELETE .../truncate`) get no 
exposure either.
   
   ## Modifications
   
   Add a new `### Truncate topic` subsection in `docs/admin-api-topics.md`, 
slotted between the existing **Unload topic** and **Get stats** sections, with 
the same three-tab layout (`pulsar-admin` / `REST API` / `Java`) used by the 
rest of the page.
   
   The description is taken verbatim from the canonical sources so it stays 
accurate as the impl evolves:
   
   - CLI: 
[`CmdTopics.TruncateCmd`](https://github.com/apache/pulsar/blob/master/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java)
 — `"Truncate a topic. The truncate operation will move all cursors to 
the end of the topic and delete all inactive ledgers."`
   - REST: 
[`PersistentTopics#truncateTopic`](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/PersistentTopics.java)
 — same notes string.
   - Java: 
[`Topics#truncate(String)`](https://github.com/apache/pulsar/blob/master/pulsar-client-admin-api/src/main/java/org/apache/pulsar/client/admin/Topics.java).
   
   I rephrased the docs line slightly from _"will move ... and delete"_ to 
_"moves ... and deletes ... freeing the storage used by messages that have 
already been consumed"_ so it reads like the rest of the page (present tense, 
user-facing).
   
   ## Verifying this change
   
   This change is a docs-only addition and should be verified by docs preview:
   
   - [ ] `### Truncate topic` renders between **Unload topic** and **Get 
stats** on `docs/admin-api-topics`.
   - [ ] Swagger block resolves to `PersistentTopics_truncateTopic`.
   - [ ] All three tabs (pulsar-admin / REST / Java) show the expected snippet.
   
   No code paths changed; no tests affected.
   
   ## Does this pull request potentially affect one of the following parts:
   
   - [x] `The docs`
   - [ ] Dependencies (does it add or upgrade a dependency)
   - [ ] The public API
   - [ ] The schema
   - [ ] The default values of configurations
   - [ ] The threading model
   - [ ] The binary protocol
   - [ ] The REST endpoints
   - [ ] The admin CLI options
   - [ ] The metrics
   - [ ] Anything that affects deployment
   
   ## Documentation
   
   - [ ] `doc-required`
   - [x] `doc-not-needed` — this PR **is** the docs change.
   - [ ] `doc`
   - [ ] `doc-complete`
   
   ## Matching PR in forked repository
   
   PR in forked repository: apache/pulsar-site#_(filled automatically)_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to