Module org.apache.lucene.core
Package org.apache.lucene.index
Record Class IndexWriter.IndexWriterMergeSource
java.lang.Object
java.lang.Record
org.apache.lucene.index.IndexWriter.IndexWriterMergeSource
- All Implemented Interfaces:
MergeScheduler.MergeSource
- Enclosing class:
IndexWriter
private static record IndexWriter.IndexWriterMergeSource(IndexWriter writer)
extends Record
implements MergeScheduler.MergeSource
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IndexWriter
The field for thewriter
record component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
IndexWriterMergeSource
(IndexWriter writer) Creates an instance of aIndexWriterMergeSource
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.TheMergeScheduler
calls this method to retrieve the next merge requested by the MergePolicyfinal int
hashCode()
Returns a hash code value for this object.boolean
Expert: returns true if there are merges waiting to be scheduled.void
merge
(MergePolicy.OneMerge merge) Merges the indicated segments, replacing them in the stack with a single segment.void
Does finishing for a merge.toString()
Returns a string representation of this record class.writer()
Returns the value of thewriter
record component.
-
Field Details
-
writer
The field for thewriter
record component.
-
-
Constructor Details
-
IndexWriterMergeSource
Creates an instance of aIndexWriterMergeSource
record class.- Parameters:
writer
- the value for thewriter
record component
-
-
Method Details
-
getNextMerge
Description copied from interface:MergeScheduler.MergeSource
TheMergeScheduler
calls this method to retrieve the next merge requested by the MergePolicy- Specified by:
getNextMerge
in interfaceMergeScheduler.MergeSource
-
onMergeFinished
Description copied from interface:MergeScheduler.MergeSource
Does finishing for a merge.- Specified by:
onMergeFinished
in interfaceMergeScheduler.MergeSource
-
hasPendingMerges
public boolean hasPendingMerges()Description copied from interface:MergeScheduler.MergeSource
Expert: returns true if there are merges waiting to be scheduled.- Specified by:
hasPendingMerges
in interfaceMergeScheduler.MergeSource
-
merge
Description copied from interface:MergeScheduler.MergeSource
Merges the indicated segments, replacing them in the stack with a single segment.- Specified by:
merge
in interfaceMergeScheduler.MergeSource
- Throws:
IOException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
writer
Returns the value of thewriter
record component.- Returns:
- the value of the
writer
record component
-