public abstract class MergeScheduler extends Object implements Closeable
Expert: IndexWriter
uses an instance
implementing this interface to execute the merges
selected by a MergePolicy
. The default
MergeScheduler is ConcurrentMergeScheduler
.
Modifier and Type | Class and Description |
---|---|
static interface |
MergeScheduler.MergeSource
Provides access to new merges and executes the actual merge
|
Modifier and Type | Field and Description |
---|---|
protected InfoStream |
infoStream
For messages about merge scheduling
|
Modifier | Constructor and Description |
---|---|
protected |
MergeScheduler()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Close this MergeScheduler.
|
abstract void |
merge(MergeScheduler.MergeSource mergeSource,
MergeTrigger trigger)
Run the merges provided by
MergeScheduler.MergeSource.getNextMerge() . |
protected void |
message(String message)
Outputs the given message - this method assumes
verbose() was
called and returned true. |
protected boolean |
verbose()
Returns true if infoStream messages are enabled.
|
Directory |
wrapForMerge(MergePolicy.OneMerge merge,
Directory in)
Wraps the incoming
Directory so that we can merge-throttle it
using RateLimitedIndexOutput . |
protected InfoStream infoStream
protected MergeScheduler()
public abstract void merge(MergeScheduler.MergeSource mergeSource, MergeTrigger trigger) throws IOException
MergeScheduler.MergeSource.getNextMerge()
.mergeSource
- the IndexWriter
to obtain the merges from.trigger
- the MergeTrigger
that caused this merge to happenIOException
public Directory wrapForMerge(MergePolicy.OneMerge merge, Directory in)
Directory
so that we can merge-throttle it
using RateLimitedIndexOutput
.public abstract void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected boolean verbose()
message(String)
:
if (verbose()) { message("your message"); }
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.