Skip to content
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

HDDS-10262. Encapsulate SnapshotCache inside OmSnapshotManager #6135

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

Cyrill
Copy link
Contributor

@Cyrill Cyrill commented Jan 31, 2024

HDDS-10262. Encapsulate SnapshotCache inside OmSnapshotManager

Changes made:
SnapshotCache is now used purely in OmSnapshotManager and not exposed outside.
Previous calls to SnapshotCache are now changed to OmSnapshotManager.
Explicit parameter "skipActiveCheck" was removed, active state check is done implicitly.
Also changed the generics in snapshot's ReferenceCounted returned value to get rid of type casts all over the codebase.
Removed unused parameter from ReferenceCounted class.

Reasoning
SnapshotCache is now hidden from the world and any further refactoring to it should be easier.

What is the link to the Apache JIRA

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

How was this patch tested?

Existing unit tests. There was no new functionality added.

@Cyrill
Copy link
Contributor Author

Cyrill commented Jan 31, 2024

@hemantk-12 please take a look at this PR

@hemantk-12 hemantk-12 requested a review from smengcl January 31, 2024 19:07
@hemantk-12 hemantk-12 added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Jan 31, 2024
Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @Cyrill for the improvements.

Overall looks good to me. Left some inline comment.

@hemantk-12
Copy link
Contributor

@smengcl can you please also take a look?

# Conflicts:
#	hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java
@Cyrill Cyrill requested a review from hemantk-12 February 6, 2024 12:22
Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

LGTM.

@smengcl and @aswinshakil, please take a look as well.

Copy link
Member

@aswinshakil aswinshakil left a comment

Choose a reason for hiding this comment

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

Thanks @Cyrill for this effort of refactoring. Most of the changes looks good to me. I have a comment inline.

/**
* Parent instance whose callback will be triggered upon this RC closure.
*/
private final U parentWithCallback;
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should remove this. Though we don't use it right now. There is an upcoming patch which is using this callback. Please take a look at #6024. So we don't have to remove this and add it again in #6024 .

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm fine with leaving the unused field, though I strongly believe the callback should not be a part of the class generics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Returned back the field.

@Cyrill Cyrill requested a review from aswinshakil February 8, 2024 10:02
@Cyrill
Copy link
Contributor Author

Cyrill commented Feb 9, 2024

Are we okay to merge this pr? Who should I ask to do that?

Copy link
Contributor

@hemantk-12 hemantk-12 left a comment

Choose a reason for hiding this comment

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

Thanks @Cyrill for the refactoring and clean up.

@hemantk-12 hemantk-12 merged commit 2f2234c into apache:master Feb 9, 2024
35 checks passed
@Cyrill Cyrill deleted the HDDS-10262 branch February 11, 2024 14:36
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 17, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 18, 2024
xichen01 pushed a commit to xichen01/ozone that referenced this pull request Jul 18, 2024
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