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

Unification Extended-key format in Java FilerClient #5490

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

Conversation

stillmoon
Copy link

What problem are we solving?

When using Filer Http to process files, setting Extended-key must carry the "Seaweed-" prefix, and the prefix will be persisted to the file.
When using Java FilerClient to process files, setting Extended-key does not force the "Seaweed-" prefix.
Therefore, the format of Extended-key for the files processed in the two ways is not uniform.
Therefore, when dealing with Entry in Client, it is necessary to distinguish between the two formats of Extended-key, but it is obviously unrealistic to require users to pay extra attention to the two formats of Extended-key when using FilerClient, and it is necessary to unify the format of Extended-key in Client.

How are we solving the problem?

Refer to the implementation of S3, add a certain prefix to the user-defined metadata, and erase the prefix when querying.
Add a utility class to add and remove "Seaweed-" prefixes for Extended-key.
The "Seaweed-" prefix is automatically appended when the Entry is submitted, and the "Seaweed-" prefix is automatically removed when the Entry is pulled.
Achieve the unification of Extended-key format, that is, the Extended-key of Entry will carry the "Seaweed-" prefix, but the user will not display the "Seaweed-" prefix when obtaining Entry (such as lookUpEntry).
Therefore, when using Client, users are completely unaware of the "Seaweed-" prefix, but the format of Extended is unified.

How is the PR tested?

add Unit test in SeaweedFilerTest

Checks

  • [ √] I have added unit tests if possible.
  • [ √] I will add related wiki document changes and link to this PR after merging.

@chrislusf
Copy link
Collaborator

But with this, a user would not be able to set the S3 specific headers with Java FilerClient.

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.

None yet

2 participants