public static class MergePolicy.OneMerge extends Object
Modifier and Type | Field and Description |
---|---|
long |
estimatedMergeBytes
Estimated size in bytes of the merged segment.
|
MergeRateLimiter |
rateLimiter
A private
RateLimiter for this merge, used to rate limit writes and abort. |
List<SegmentCommitInfo> |
segments
Segments to be merged.
|
int |
totalMaxDoc
Total number of documents in segments to be merged, not accounting for deletions.
|
Constructor and Description |
---|
OneMerge(List<SegmentCommitInfo> segments)
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
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. |
SegmentCommitInfo |
getMergeInfo()
Returns the
SegmentCommitInfo for the merged segment,
or null if it hasn't been set yet. |
List<CodecReader> |
getMergeReaders()
Expert: Get the list of readers to merge.
|
MergeInfo |
getStoreMergeInfo()
Return
MergeInfo describing this merge. |
void |
mergeFinished()
Called by
IndexWriter after the merge is done and all readers have been closed. |
String |
segString()
Returns a readable description of the current merge
state.
|
void |
setMergeInfo(SegmentCommitInfo info)
Expert: Sets the
SegmentCommitInfo of the merged segment. |
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 MergeRateLimiter rateLimiter
RateLimiter
for this merge, used to rate limit writes and abort.public final int totalMaxDoc
public OneMerge(List<SegmentCommitInfo> segments)
segments
- List of SegmentCommitInfo
s
to be merged.public void mergeFinished() throws IOException
IndexWriter
after the merge is done and all readers have been closed.IOException
public List<CodecReader> 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 setMergeInfo(SegmentCommitInfo info)
SegmentCommitInfo
of the merged segment.
Allows sub-classes to e.g. set diagnostics properties.public SegmentCommitInfo getMergeInfo()
SegmentCommitInfo
for the merged segment,
or null if it hasn't been set yet.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 String segString()
public long totalBytesSize() throws IOException
IOException
public int totalNumDocs() throws IOException
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.