public static class MergePolicy.OneMerge extends Object
Modifier and Type | Field and Description |
---|---|
long |
estimatedMergeBytes
Estimated size in bytes of the merged segment.
|
List<SegmentCommitInfo> |
segments
Segments to be merged.
|
int |
totalDocCount
Number of documents in the merged segment.
|
Constructor and Description |
---|
MergePolicy.OneMerge(List<SegmentCommitInfo> segments)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkAborted(Directory dir)
Called periodically by
IndexWriter while
merging to see if the merge is aborted. |
MergePolicy.DocMap |
getDocMap(MergeState mergeState)
Expert: If
getMergeReaders() reorders document IDs, this method
must be overridden to return a mapping from the natural doc ID
(the doc ID that would result from a natural merge) to the actual doc
ID. |
MergeInfo |
getMergeInfo()
Return
MergeInfo describing this merge. |
List<AtomicReader> |
getMergeReaders()
Expert: Get the list of readers to merge.
|
boolean |
getPause()
Returns true if this merge is paused.
|
String |
segString(Directory dir)
Returns a readable description of the current merge
state.
|
void |
setInfo(SegmentCommitInfo info)
Expert: Sets the
SegmentCommitInfo of this MergePolicy.OneMerge . |
void |
setPause(boolean paused)
Set or clear whether this merge is paused paused (for example
ConcurrentMergeScheduler will pause merges
if too many are running). |
long |
totalBytesSize()
Returns the total size in bytes of this merge.
|
int |
totalNumDocs()
Returns the total number of documents that are included with this merge.
|
public volatile long estimatedMergeBytes
public final List<SegmentCommitInfo> segments
public final int totalDocCount
public MergePolicy.OneMerge(List<SegmentCommitInfo> segments)
segments
- List of SegmentCommitInfo
s
to be merged.public List<AtomicReader> getMergeReaders() throws IOException
MergePolicy.OneMerge
reorders doc IDs, it must override getDocMap(org.apache.lucene.index.MergeState)
too so that
deletes that happened during the merge can be applied to the newly
merged segment.IOException
public void setInfo(SegmentCommitInfo info)
SegmentCommitInfo
of this MergePolicy.OneMerge
.
Allows sub-classes to e.g. set diagnostics properties.public MergePolicy.DocMap getDocMap(MergeState mergeState)
getMergeReaders()
reorders document IDs, this method
must be overridden to return a mapping from the natural doc ID
(the doc ID that would result from a natural merge) to the actual doc
ID. This mapping is used to apply deletions that happened during the
merge to the new segment.public void checkAborted(Directory dir) throws MergePolicy.MergeAbortedException
IndexWriter
while
merging to see if the merge is aborted.public void setPause(boolean paused)
ConcurrentMergeScheduler
will pause merges
if too many are running).public boolean getPause()
setPause(boolean)
public String segString(Directory dir)
public long totalBytesSize() throws IOException
IOException
public int totalNumDocs() throws IOException
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.