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

Introduce a ResolvedBucketName type to avoid temporal coupling (and e… #1754

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

Conversation

mbaechler
Copy link
Member

…nhance readability)

}

private boolean isNameSpace(BucketName bucketName) {
return namespace
.map(existingNamespace -> existingNamespace.equals(bucketName))
.map(existingNamespace -> existingNamespace.asString().equals(bucketName.asString()))
Copy link
Contributor

Choose a reason for hiding this comment

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

💭 thought: the namespace term is also called defaultBucketName in other places ( it is called namespace in the configuration file, the configuration builder accepts a namespace setter but when building the actual configuration object it injects the namespace into a field named defaultBucketName a similarly named field is also exposed by the S3 dao but in the bucketname resolver it is again called namespace. It is unclear to me what this concept is supposed to represent and how it is different from bucketPrefix (whose name is fairly stable throughout the code)
I don't expect an action on this MR but seeing the name here reminded me of this thought.

Copy link
Contributor

Choose a reason for hiding this comment

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

❔ question: ‏why change the equality from BucketName#equals to asString().equals I agree that the result is identical but don't think this change makes the code clearer

I understand why it is necessary in the overload of isNameSpace that compares a ResolvedBucketName and a BucketName.


import java.util.Objects;

public final class ResolvedBucketName {
Copy link
Contributor

Choose a reason for hiding this comment

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

This POJO is defined in the API but only used in blob-s3.

I think introducing it is a good idea, but we should avoid poluting the API and move it into blob-s3.

Copy link
Member

Choose a reason for hiding this comment

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

Hi @chibenwa ,
Do you have a plan to migrate to Java 14 (or 16), this will prevent from lot of code like this one.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we upgrade better a LTS version, so 17 (or even 21 would be better, but maybe too big of a jump?)

I would support such a migration, but I'm not sure the all community is ready to upgrade their java version :)

Could perhaps start a thread on the ML though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @chibenwa ,
Do you have a plan to migrate to Java 14 (or 16), this will prevent from lot of code like this one.

You is out of place, as a community we should embrasse a we.

I would personnalyy support a switch to Java 17 or even 21.

Do you think you can pull off a mail on this topic on the mailing lists?

@Arsnael
Copy link
Contributor

Arsnael commented Oct 16, 2023

09:19:04,821 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.3.0:check (check-style) on project blob-api: You have 2 Checkstyle violations. -> [Help 1]

@Arsnael
Copy link
Contributor

Arsnael commented Nov 6, 2023

@mbaechler status on this? any plan on fixing soon checkstyle issues and answering comments? :)

@mbaechler
Copy link
Member Author

@mbaechler status on this? any plan on fixing soon checkstyle issues and answering comments? :)

I apologize for dropping PRs without a proper follow-up plan.
I will try this week.

@Arsnael
Copy link
Contributor

Arsnael commented Nov 28, 2023

https://ci-builds.apache.org/job/james/job/ApacheJames/job/PR-1754/4/testReport/

I think the errors in BucketNameResolverTest are related

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.

5 participants