-
Notifications
You must be signed in to change notification settings - Fork 112
Add support for detailed file info in the LuceneMetadata operation. Make metadata class API.EXPERIMENT #3555
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
Add support for detailed file info in the LuceneMetadata operation. Make metadata class API.EXPERIMENT #3555
Conversation
…ake metadata class API.EXPERIMENTAL. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
@Nullable | ||
private final Collection<LuceneFileInfo> detailedFileInfos; | ||
|
||
@Deprecated(forRemoval = true) |
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.
There was some discussion about it, and I think that @API(API.Status.DEPRECATED)
is preferred.
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.
Right. I was trying to get Teamscale to not mark it as a test gap, but that didn't work.
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.
Done.
final int fieldInfoCount, | ||
@Nonnull final Collection<LuceneFileInfo> detailedFileInfos) { | ||
this.documentCount = documentCount; | ||
this.files = detailedFileInfos.stream().map(LuceneFileInfo::getName).collect(Collectors.toList()); |
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 "files" here have a null assingment, and getFiles
below be something like:
if (files == null && detailedFileInfos != null) {
return detailedFileInfos.stream().map(LuceneFileInfo::getName).collect(Collectors.toList());
}
// else return an error...
?
I assume that since files
is private, the callers will always use the getFiles
function to access this data.
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.
Yes, we can do that, but then we will recompute the derivation every time instead of once.
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.
if (files == null && detailedFileInfos != null) {
files = detailedFileInfos.stream().map(LuceneFileInfo::getName).collect(Collectors.toList());
return files;
}
?
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.
I think this is exactly what constructors are doing - except that this way the class is immutable: First constructor has populates files
and second constructor has files==null
and detailedFileInfos != null
and is therefore exactly what you have in your comment.
Since the files
field is deprecated (to be removed once usage is gone), then we will be left with a simple constructor initialization.
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.
I changed the constructor to take a list and added unmodifieableList
to the constructor. This allows the equals
method to work properly.
Add more info to the Lucene Index Operation metadata (file ID and size)
Make the
LuceneGetMetadataInfo
classEXPERIMENTAL
(it is used from outside the RL).Deprecate the metadata's file name list (users can substitute the new field to get access to the file names).
Resolves #3554