Exemple #1
0
        protected internal virtual long SizeBytes(SegmentInfo info)
        {
            long byteSize = info.SizeInBytes();

            if (calibrateSizeByDeletes)
            {
                int   delCount = writer.NumDeletedDocs(info);
                float delRatio = (info.docCount <= 0?0.0f:((float)delCount / (float)info.docCount));
                return(info.docCount <= 0?byteSize:(long)(byteSize * (1.0f - delRatio)));
            }
            else
            {
                return(byteSize);
            }
        }