Package org.apache.lucene.index
Class NoMergeScheduler
java.lang.Object
org.apache.lucene.index.MergeScheduler
org.apache.lucene.index.NoMergeScheduler
- All Implemented Interfaces:
Closeable
,AutoCloseable
A
MergeScheduler
which never executes any merges. It is also a singleton and can be
accessed through INSTANCE
. Use it if you want to prevent an IndexWriter
from ever executing merges, regardless of the MergePolicy
used. Note that
you can achieve the same thing by using NoMergePolicy
, however with NoMergeScheduler
you also ensure that no unnecessary code of any MergeScheduler
implementation is ever executed. Hence it is recommended to use both if you want to disable
merges from ever happening.-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.lucene.index.MergeScheduler
MergeScheduler.MergeSource
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MergeScheduler
The single instance ofNoMergeScheduler
Fields inherited from class org.apache.lucene.index.MergeScheduler
infoStream
-
Method Summary
Modifier and TypeMethodDescriptionclone()
void
close()
Close this MergeScheduler.void
merge
(MergeScheduler.MergeSource mergeSource, MergeTrigger trigger) Run the merges provided byMergeScheduler.MergeSource.getNextMerge()
.wrapForMerge
(MergePolicy.OneMerge merge, Directory in) Wraps the incomingDirectory
so that we can merge-throttle it usingRateLimitedIndexOutput
.Methods inherited from class org.apache.lucene.index.MergeScheduler
message, verbose
-
Field Details
-
INSTANCE
The single instance ofNoMergeScheduler
-
-
Method Details
-
close
public void close()Description copied from class:MergeScheduler
Close this MergeScheduler.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classMergeScheduler
-
merge
Description copied from class:MergeScheduler
Run the merges provided byMergeScheduler.MergeSource.getNextMerge()
.- Specified by:
merge
in classMergeScheduler
- Parameters:
mergeSource
- theIndexWriter
to obtain the merges from.trigger
- theMergeTrigger
that caused this merge to happen
-
wrapForMerge
Description copied from class:MergeScheduler
Wraps the incomingDirectory
so that we can merge-throttle it usingRateLimitedIndexOutput
.- Overrides:
wrapForMerge
in classMergeScheduler
-
clone
-