Skip to content

HDDS-8049. [snapshot] Support snapshot generation through 'ozone freon'. #8483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jojochuang
Copy link
Contributor

What changes were proposed in this pull request?

HDDS-8049. [snapshot] Support snapshot generation through 'ozone freon'.

Please describe your PR in detail:

  • ozone freon snapshot-generator --volume --bucket --snapshots -- --files --dirs
  • Generated-by: GitHub Copilot o3-mini

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-8049

How was this patch tested?

TestSnapshotGenerator verifies that the expected number of snapshots are created.
https://github.com/jojochuang/ozone/actions/runs/15123732084

Change-Id: I3df34082617971d72934c2a8003f47a7d8a51f8a
@jojochuang jojochuang added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label May 19, 2025
@jojochuang jojochuang requested review from sadanand48 and smengcl May 20, 2025 20:05
for (int dirIndex = 1; dirIndex <= numDirs; dirIndex++) {
String dirName = String.format("dir-%d", dirIndex);
// Append "/" to denote a directory.
bucket.createKey(dirName + "/", 0).close();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can use bucket.createDirectory(String dirName) too

Copy link
Contributor

@sadanand48 sadanand48 left a comment

Choose a reason for hiding this comment

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

LGTM. Another improvement is to add renames , deletes and modify ops as specified so it would be useful to test snapdiff but perhaps we could do it in another jira.

Change-Id: I658e663d9e24681731278747ce836d787c551353
@Option(names = {"--dirs"},
description = "Number of directories to create after each snapshot", defaultValue = "5")
private int numDirs;

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the patch @jojochuang. Should we also have an option to generate keys --keys?

Comment on lines +84 to +85
// Snapshot creation: this is a placeholder call.
// Replace this call with the actual snapshot creation method supported in your environment.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Snapshot creation: this is a placeholder call.
// Replace this call with the actual snapshot creation method supported in your environment.
// Create snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
snapshot https://issues.apache.org/jira/browse/HDDS-6517
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants