Package org.apache.lucene.index
Class MergeScheduler
java.lang.Object
org.apache.lucene.index.MergeScheduler
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
ConcurrentMergeScheduler
,NoMergeScheduler
,SerialMergeScheduler
Expert:
IndexWriter
uses an instance implementing this interface to execute the merges
selected by a MergePolicy
. The default MergeScheduler is ConcurrentMergeScheduler
.- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Provides access to new merges and executes the actual merge -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
close()
Close this MergeScheduler.abstract void
merge
(MergeScheduler.MergeSource mergeSource, MergeTrigger trigger) Run the merges provided byMergeScheduler.MergeSource.getNextMerge()
.protected void
Outputs the given message - this method assumesverbose()
was called and returned true.protected boolean
verbose()
Returns true if infoStream messages are enabled.wrapForMerge
(MergePolicy.OneMerge merge, Directory in) Wraps the incomingDirectory
so that we can merge-throttle it usingRateLimitedIndexOutput
.
-
Field Details
-
infoStream
For messages about merge scheduling
-
-
Constructor Details
-
MergeScheduler
protected MergeScheduler()Sole constructor. (For invocation by subclass constructors, typically implicit.)
-
-
Method Details
-
merge
public abstract void merge(MergeScheduler.MergeSource mergeSource, MergeTrigger trigger) throws IOException Run the merges provided byMergeScheduler.MergeSource.getNextMerge()
.- Parameters:
mergeSource
- theIndexWriter
to obtain the merges from.trigger
- theMergeTrigger
that caused this merge to happen- Throws:
IOException
-
wrapForMerge
Wraps the incomingDirectory
so that we can merge-throttle it usingRateLimitedIndexOutput
. -
close
Close this MergeScheduler.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
verbose
protected boolean verbose()Returns true if infoStream messages are enabled. This method is usually used in conjunction withmessage(String)
:if (verbose()) { message("your message"); }
-
message
Outputs the given message - this method assumesverbose()
was called and returned true.
-