mikemccand commented on code in PR #15885:
URL: https://github.com/apache/lucene/pull/15885#discussion_r3015574600
##########
lucene/core/src/java/org/apache/lucene/index/SegmentCommitInfo.java:
##########
@@ -349,7 +349,21 @@ void setSoftDelCount(int softDelCount) {
/** Returns a description of this segment. */
public String toString(int pendingDelCount) {
- String s = info.toString(delCount + pendingDelCount);
+ return info.toString(delCount + pendingDelCount);
+ }
+
+ /** Returns a description of this segment. */
+ @Override
+ public String toString() {
+ return info.toString();
+ }
+
+ /** Returns a more verbose description of this segment for use in infostream
logging */
+ String toStringVerbose() {
+ String s = info.toStringVerbose();
+ if (this.id != null) {
+ s += " :id=" + StringHelper.idToString(id);
Review Comment:
Hmm is this duplicative (line 366/380 below)?
##########
lucene/core/src/java/org/apache/lucene/index/SegmentInfo.java:
##########
@@ -211,31 +211,38 @@ public Set<String> files() {
return Collections.unmodifiableSet(setFiles);
}
- @Override
- public String toString() {
- return toString(0);
- }
-
/**
* Used for debugging. Format may suddenly change.
*
- * <p>Current format looks like <code>_a(3.1):c45/4:[sorter=<long:
"timestamp">!]</code>,
- * which means the segment's name is <code>_a</code>; it was created with
Lucene 3.1 (or '?' if
- * it's unknown); it's using compound file format (would be <code>C</code>
if not compound); it
- * has 45 documents; it has 4 deletions (this part is left off when there
are no deletions); it is
- * sorted by the timestamp field in descending order (this part is omitted
for unsorted segments).
+ * <p>Current format looks like <code>_a(3.1):c45/4</code>, which means the
segment's name is
+ * <code>_a</code>; it was created with Lucene 3.1 (or '?' if it's unknown);
it's using compound
+ * file format (would be <code>C</code> if not compound); it has 45
documents; it has 4 deletions
+ * (this part is left off when there are no deletions).
Review Comment:
Maybe explain the existence of `toStringVerbose` and link here?
##########
lucene/CHANGES.txt:
##########
@@ -322,6 +317,8 @@ Other
* GITHUB#15867: Use IllegalCallerException to signal wrong caller in internal
classes
(VectorizationProvider, TestSecrets). (Uwe Schindler)
+* GITHUB#15885: Slenderize SegmentInfo.toString() and use beefy version in
infostream only once
Review Comment:
Wow, I never came across verb form of the word slender!
##########
lucene/core/src/test/org/apache/lucene/index/TestInfoStream.java:
##########
@@ -86,4 +90,48 @@ protected boolean isEnableTestPoints() {
dir.close();
assertTrue(seenTestPoint.get());
}
+
+ public void testMergeSmallIndex() throws Exception {
Review Comment:
Thank you! Poor `InfoStream` otherwise doesn't have great test love...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]