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 | 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(IndexWriter writer,
MergeTrigger trigger,
boolean newMergesFound)
Run the merges provided by
IndexWriter.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(IndexWriter writer, MergeTrigger trigger, boolean newMergesFound) throws IOException
IndexWriter.getNextMerge()
.writer
- the IndexWriter
to obtain the merges from.trigger
- the MergeTrigger
that caused this merge to happennewMergesFound
- true
iff any new merges were found by the caller otherwise false
IOException
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-2017 Apache Software Foundation. All Rights Reserved.