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

OAK-11085: Use a single definition of MAX_SEGMENT_SIZE in Segment #1702

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

JeonDaehong
Copy link

Description

This PR addresses an issue where MAX_SEGMENT_SIZE was defined in both Segment and SegmentDataUtils with the same value, leading to redundancy. To resolve this:

  • MAX_SEGMENT_SIZE in Segment.java has been made public.
  • In SegmentDataUtils.java, the static import import static org.apache.jackrabbit.oak.segment.Segment.MAX_SEGMENT_SIZE; was added to utilize the constant defined in Segment.java.
  • The redundant definition of MAX_SEGMENT_SIZE in SegmentDataUtils has been removed.

Motivation

Having the constant defined in two places created potential maintenance issues and inconsistency risks. By consolidating the definition in Segment.java, the code becomes cleaner, more maintainable, and reduces the possibility of errors in future updates.

Impact

  • No functionality change, purely a refactor.
  • This change should not impact existing functionality but reduces code duplication.

Please review and merge this PR to streamline the constant usage in both classes.

- Changed MAX_SEGMENT_SIZE in Segment.java to be public.
- Updated SegmentDataUtils.java to use the MAX_SEGMENT_SIZE from Segment by importing it statically.
- Removed the redundant definition of MAX_SEGMENT_SIZE in SegmentDataUtils to avoid duplication.
@JeonDaehong
Copy link
Author

Jira Link
https://issues.apache.org/jira/browse/OAK-11085

@JeonDaehong
Copy link
Author

I successfully ran clean install and clean install -PintegrationTesting with all tests passing

@JeonDaehong JeonDaehong changed the title Refactor: Use a single definition of MAX_SEGMENT_SIZE in Segment OAK-11085: Use a single definition of MAX_SEGMENT_SIZE in Segment Sep 8, 2024
@Nicolapps
Copy link
Contributor

Hey @JeonDaehong, thank you for your PR! Sorry, I should have made it clear on the Jira issue, but I’ve already created a PR for this task:

@JeonDaehong
Copy link
Author

It's very unfortunate... It was my first PR, so I really wanted to be a part of it. Is there perhaps another good opportunity...?

@Nicolapps
Copy link
Contributor

I’m only contributing occasionally to this project so I don’t have a good overview of tasks that could be interesting to solve, but maybe Jira gives you some ideas. Thanks for your interest in this project!

@JeonDaehong
Copy link
Author

JeonDaehong commented Sep 8, 2024

Thank you for kindly explaining. Thanks to this issue, I was able to take my first step in contributing to open source. I will continue to show interest and contribute more in the future.

I followed you because I want to learn a lot from you in the future. Thank you!

Have a great day!

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