Skip to content

HDDS-13755. Add doc for ozone sh snapshot listDiff command#9238

Merged
jojochuang merged 2 commits intoapache:masterfrom
rich7420:HDDS-13755
Nov 2, 2025
Merged

HDDS-13755. Add doc for ozone sh snapshot listDiff command#9238
jojochuang merged 2 commits intoapache:masterfrom
rich7420:HDDS-13755

Conversation

@rich7420
Copy link
Contributor

@rich7420 rich7420 commented Nov 2, 2025

What changes were proposed in this pull request?

follow the requirements from this issue:

  1. demonstrate --all-status option.
  2. clarify the difference between -all-status and -all, the latter tunes pagination limit, not snapdiff job status

I noticed dataflow in this part is like:

CLI Command
  ↓
ListSnapshotDiffHandler.execute()
  ↓ Parse Options:
    • --all-status → listAllStatus (boolean)
    • --job-status → jobStatus (String, default: "in_progress")
    • listOptions.getStartItem() → prevSnapshotDiffJob
    • listOptions.getLimit() → limit (used later for output)
  ↓
ObjectStore.listSnapshotDiffJobs()
  ↓ Creates SnapshotDiffJobIterator
  ↓ When iterator needs data → RPC Call:
    in [Client] part RpcClient → OzoneManagerProtocolClientSideTranslatorPB
      → Builds Protobuf Request (ListSnapshotDiffJobRequest)
      → OmTransport.submitRequest() (gRPC/Hadoop RPC)
    in [Network] part gRPC/Protobuf RPC transmission
    in [Server] part OzoneManagerProtocolServerSideTranslatorPB
      → OzoneManagerRequestHandler
      → OzoneManager.listSnapshotDiffJobs() (ACL checks, metrics)
      → OmSnapshotManager.getSnapshotDiffList() (validation)
      → SnapshotDiffManager.getSnapshotDiffJobList()
        • Filters by volumeName, bucketName
        • Filters by status (if listAllStatus=true: all jobs, else: match jobStatus)
        • Limits by maxEntries (server-side pagination)
        • Returns ListSnapshotDiffJobResponse
  ↓
Response flows back → SnapshotDiffJobIterator
  ↓ Converts to Iterator<OzoneSnapshotDiff> and Stores continuation token for next page
  ↓
printAsJsonArray(iterator, limit)

What is the link to the Apache JIRA

HDDS-13755

How was this patch tested?

none

@jojochuang jojochuang requested a review from Copilot November 2, 2025 03:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the snapshot documentation by adding detailed usage instructions for the listDiff command. The update provides comprehensive guidance on filtering snapshot diff jobs by status and clarifies the distinction between status filtering and pagination options.

Key Changes

  • Added documentation for the listDiff command with multiple usage examples
  • Documented the --job-status and --all-status flags for filtering snapshot diff jobs
  • Clarified the difference between --all-status (status filtering) and -all/-a (pagination) options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rich7420
Copy link
Contributor Author

rich7420 commented Nov 2, 2025

I'm not sure if this is the right place to put the section. plz feel free to correct me!

# List all jobs regardless of status, with pagination limit removed
ozone sh snapshot listDiff /vol1/bucket1 --all-status -all
# Or limit results to 10 items
ozone sh snapshot listDiff /vol1/bucket1 --all-status -l 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine to not mention it since it's too detailed. The pagination limit default is also applicable to other commands so mentioning it here isn't appropriate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jojochuang thanks for the feedback!

Copy link
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jojochuang jojochuang merged commit 1de5c2f into apache:master Nov 2, 2025
15 checks passed
@rich7420
Copy link
Contributor Author

rich7420 commented Nov 3, 2025

@jojochuang thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants