@Override protected long size(SegmentCommitInfo info, MergeContext context) throws IOException { return in.size(info, context); }
/** Return the byte size of the provided {@link * SegmentCommitInfo}, pro-rated by percentage of * non-deleted documents if {@link * #setCalibrateSizeByDeletes} is set. */ protected long sizeBytes(SegmentCommitInfo info, MergeContext mergeContext) throws IOException { if (calibrateSizeByDeletes) { return super.size(info, mergeContext); } return info.sizeInBytes(); }
/** * Returns true if a new segment (regardless of its origin) should use the * compound file format. The default implementation returns <code>true</code> * iff the size of the given mergedInfo is less or equal to * {@link #getMaxCFSSegmentSizeMB()} and the size is less or equal to the * TotalIndexSize * {@link #getNoCFSRatio()} otherwise <code>false</code>. */ public boolean useCompoundFile(SegmentInfos infos, SegmentCommitInfo mergedInfo, MergeContext mergeContext) throws IOException { if (getNoCFSRatio() == 0.0) { return false; } long mergedInfoSize = size(mergedInfo, mergeContext); if (mergedInfoSize > maxCFSSegmentSize) { return false; } if (getNoCFSRatio() >= 1.0) { return true; } long totalSize = 0; for (SegmentCommitInfo info : infos) { totalSize += size(info, mergeContext); } return mergedInfoSize <= getNoCFSRatio() * totalSize; }
@Override protected long size(SegmentCommitInfo info, MergeContext context) throws IOException { return in.size(info, context); }
@Override protected long size(SegmentCommitInfo info, IndexWriter writer) throws IOException { return in.size(info, writer); }
@Override protected long size(SegmentCommitInfo info, IndexWriter writer) throws IOException { return in.size(info, writer); }
/** Return the byte size of the provided {@link * SegmentCommitInfo}, pro-rated by percentage of * non-deleted documents if {@link * #setCalibrateSizeByDeletes} is set. */ protected long sizeBytes(SegmentCommitInfo info, MergeContext mergeContext) throws IOException { if (calibrateSizeByDeletes) { return super.size(info, mergeContext); } return info.sizeInBytes(); }
/** Return the byte size of the provided {@link * SegmentCommitInfo}, pro-rated by percentage of * non-deleted documents if {@link * #setCalibrateSizeByDeletes} is set. */ protected long sizeBytes(SegmentCommitInfo info, IndexWriter writer) throws IOException { if (calibrateSizeByDeletes) { return super.size(info, writer); } return info.sizeInBytes(); }
/** Return the byte size of the provided {@link * SegmentCommitInfo}, pro-rated by percentage of * non-deleted documents if {@link * #setCalibrateSizeByDeletes} is set. */ protected long sizeBytes(SegmentCommitInfo info, IndexWriter writer) throws IOException { if (calibrateSizeByDeletes) { return super.size(info, writer); } return info.sizeInBytes(); }
/** * Returns true if a new segment (regardless of its origin) should use the * compound file format. The default implementation returns <code>true</code> * iff the size of the given mergedInfo is less or equal to * {@link #getMaxCFSSegmentSizeMB()} and the size is less or equal to the * TotalIndexSize * {@link #getNoCFSRatio()} otherwise <code>false</code>. */ public boolean useCompoundFile(SegmentInfos infos, SegmentCommitInfo mergedInfo, MergeContext mergeContext) throws IOException { if (getNoCFSRatio() == 0.0) { return false; } long mergedInfoSize = size(mergedInfo, mergeContext); if (mergedInfoSize > maxCFSSegmentSize) { return false; } if (getNoCFSRatio() >= 1.0) { return true; } long totalSize = 0; for (SegmentCommitInfo info : infos) { totalSize += size(info, mergeContext); } return mergedInfoSize <= getNoCFSRatio() * totalSize; }
/** * Returns true if a new segment (regardless of its origin) should use the * compound file format. The default implementation returns <code>true</code> * iff the size of the given mergedInfo is less or equal to * {@link #getMaxCFSSegmentSizeMB()} and the size is less or equal to the * TotalIndexSize * {@link #getNoCFSRatio()} otherwise <code>false</code>. */ public boolean useCompoundFile(SegmentInfos infos, SegmentCommitInfo mergedInfo, IndexWriter writer) throws IOException { if (getNoCFSRatio() == 0.0) { return false; } long mergedInfoSize = size(mergedInfo, writer); if (mergedInfoSize > maxCFSSegmentSize) { return false; } if (getNoCFSRatio() >= 1.0) { return true; } long totalSize = 0; for (SegmentCommitInfo info : infos) { totalSize += size(info, writer); } return mergedInfoSize <= getNoCFSRatio() * totalSize; }
/** * Returns true if a new segment (regardless of its origin) should use the * compound file format. The default implementation returns <code>true</code> * iff the size of the given mergedInfo is less or equal to * {@link #getMaxCFSSegmentSizeMB()} and the size is less or equal to the * TotalIndexSize * {@link #getNoCFSRatio()} otherwise <code>false</code>. */ public boolean useCompoundFile(SegmentInfos infos, SegmentCommitInfo mergedInfo, IndexWriter writer) throws IOException { if (getNoCFSRatio() == 0.0) { return false; } long mergedInfoSize = size(mergedInfo, writer); if (mergedInfoSize > maxCFSSegmentSize) { return false; } if (getNoCFSRatio() >= 1.0) { return true; } long totalSize = 0; for (SegmentCommitInfo info : infos) { totalSize += size(info, writer); } return mergedInfoSize <= getNoCFSRatio() * totalSize; }