-
Notifications
You must be signed in to change notification settings - Fork 138
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
do not remove md in DelimeterFilter then add it by commonPrefixes; just keep it #188
Conversation
This PR is related to gaul/s3proxy#574 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you exercise this change with some test?
@@ -364,6 +364,9 @@ private SortedSet<StorageMetadata> extractCommonPrefixes(SortedSet<StorageMetada | |||
o = prefix + o; | |||
} | |||
md.setName(o + delimiter); | |||
if (!contents.contains(md)) { | |||
contents.add(md); | |||
} | |||
contents.add(md); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this add md
twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a typo and I removed it. Thanks!
I add a test |
contents.add(md); | ||
if (!contents.contains(md)) { | ||
contents.add(md); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contents
is a Set
so this is the same as before. Could you revert it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is reverted now. I thought that item will be replaced if I add
an existing item in Set
, but actually it will be ignored.
Thank you for your contribution @jixinchi! |
If the metadata ends with delimiter, it is removed in
DelimterFilter.apply
, then add it back by loopcommonPrefixes
. But many information in the metadata lost, such as lastModified time. My solution is keeping them in the DelimeterFilter.