public class LogByteSizeMergePolicy extends LogMergePolicy
LogMergePolicy
that measures size of a
segment as the total byte size of the segment's files.MergePolicy.DocMap, MergePolicy.MergeAbortedException, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_MAX_MERGE_MB
Default maximum segment size.
|
static double |
DEFAULT_MAX_MERGE_MB_FOR_FORCED_MERGE
Default maximum segment size.
|
static double |
DEFAULT_MIN_MERGE_MB
Default minimum segment size.
|
calibrateSizeByDeletes, DEFAULT_MAX_MERGE_DOCS, DEFAULT_MERGE_FACTOR, DEFAULT_NO_CFS_RATIO, LEVEL_LOG_SPAN, maxMergeDocs, maxMergeSize, maxMergeSizeForForcedMerge, mergeFactor, minMergeSize
DEFAULT_MAX_CFS_SEGMENT_SIZE, maxCFSSegmentSize, noCFSRatio
Constructor and Description |
---|
LogByteSizeMergePolicy()
Sole constructor, setting all settings to their
defaults.
|
Modifier and Type | Method and Description |
---|---|
double |
getMaxMergeMB()
Returns the largest segment (measured by total byte
size of the segment's files, in MB) that may be merged
with other segments.
|
double |
getMaxMergeMBForForcedMerge()
Returns the largest segment (measured by total byte
size of the segment's files, in MB) that may be merged
with other segments during forceMerge.
|
double |
getMinMergeMB()
Get the minimum size for a segment to remain
un-merged.
|
void |
setMaxMergeMB(double mb)
Determines the largest segment (measured by total
byte size of the segment's files, in MB) that may be
merged with other segments.
|
void |
setMaxMergeMBForForcedMerge(double mb)
Determines the largest segment (measured by total
byte size of the segment's files, in MB) that may be
merged with other segments during forceMerge.
|
void |
setMinMergeMB(double mb)
Sets the minimum size for the lowest level segments.
|
protected long |
size(SegmentCommitInfo info,
IndexWriter writer)
Return the byte size of the provided
SegmentCommitInfo , pro-rated by percentage of
non-deleted documents is set. |
findForcedDeletesMerges, findForcedMerges, findMerges, getCalibrateSizeByDeletes, getMaxMergeDocs, getMergeFactor, isMerged, message, setCalibrateSizeByDeletes, setMaxMergeDocs, setMergeFactor, sizeBytes, sizeDocs, toString, verbose
getMaxCFSSegmentSizeMB, getNoCFSRatio, isMerged, setMaxCFSSegmentSizeMB, setNoCFSRatio, useCompoundFile
public static final double DEFAULT_MIN_MERGE_MB
public static final double DEFAULT_MAX_MERGE_MB
public static final double DEFAULT_MAX_MERGE_MB_FOR_FORCED_MERGE
public LogByteSizeMergePolicy()
protected long size(SegmentCommitInfo info, IndexWriter writer) throws IOException
MergePolicy
SegmentCommitInfo
, pro-rated by percentage of
non-deleted documents is set.size
in class MergePolicy
IOException
public void setMaxMergeMB(double mb)
Determines the largest segment (measured by total byte size of the segment's files, in MB) that may be merged with other segments. Small values (e.g., less than 50 MB) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.
Note that LogMergePolicy.setMaxMergeDocs(int)
is also
used to check whether a segment is too large for
merging (it's either or).
public double getMaxMergeMB()
setMaxMergeMB(double)
public void setMaxMergeMBForForcedMerge(double mb)
Determines the largest segment (measured by total
byte size of the segment's files, in MB) that may be
merged with other segments during forceMerge. Setting
it low will leave the index with more than 1 segment,
even if IndexWriter.forceMerge(int)
is called.
public double getMaxMergeMBForForcedMerge()
setMaxMergeMBForForcedMerge(double)
public void setMinMergeMB(double mb)
public double getMinMergeMB()
setMinMergeMB(double)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.