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
.
Implementers of sub-classes should make sure that Object.clone()
returns an independent instance able to work with any IndexWriter
instance.
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.
|
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 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-2016 Apache Software Foundation. All Rights Reserved.