Package org.apache.solr.handler.admin
Class IndexSizeEstimator
- java.lang.Object
-
- org.apache.solr.handler.admin.IndexSizeEstimator
-
public class IndexSizeEstimator extends Object
Estimates the raw size of all uncompressed indexed data by scanning term, docValues and stored fields data. This utility also provides detailed statistics about term, docValues, postings and stored fields distributions.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IndexSizeEstimator.Estimate
static class
IndexSizeEstimator.Item
static class
IndexSizeEstimator.ItemPriorityQueue
static class
IndexSizeEstimator.MapWriterSummaryStatistics
-
Field Summary
Fields Modifier and Type Field Description static float
DEFAULT_SAMPLING_PERCENT
static int
DEFAULT_SAMPLING_THRESHOLD
static String
DETAILS
static String
DOC_VALUES
static String
FIELDS_BY_SIZE
static String
NORMS
static String
POINTS
static String
STORED_FIELDS
static String
SUMMARY
static String
TERM_VECTORS
static String
TERMS
static String
TYPES_BY_SIZE
-
Constructor Summary
Constructors Constructor Description IndexSizeEstimator(org.apache.lucene.index.IndexReader reader, int topN, int maxLength, boolean withSummary, boolean withDetails)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexSizeEstimator.Estimate
estimate()
static void
main(String[] args)
void
setSamplingPercent(float percent)
Sampling percent (a number greater than 0 and less or equal to 100).void
setSamplingThreshold(int threshold)
Set the sampling threshold.
-
-
-
Field Detail
-
TERMS
public static final String TERMS
- See Also:
- Constant Field Values
-
STORED_FIELDS
public static final String STORED_FIELDS
- See Also:
- Constant Field Values
-
NORMS
public static final String NORMS
- See Also:
- Constant Field Values
-
DOC_VALUES
public static final String DOC_VALUES
- See Also:
- Constant Field Values
-
POINTS
public static final String POINTS
- See Also:
- Constant Field Values
-
TERM_VECTORS
public static final String TERM_VECTORS
- See Also:
- Constant Field Values
-
SUMMARY
public static final String SUMMARY
- See Also:
- Constant Field Values
-
DETAILS
public static final String DETAILS
- See Also:
- Constant Field Values
-
FIELDS_BY_SIZE
public static final String FIELDS_BY_SIZE
- See Also:
- Constant Field Values
-
TYPES_BY_SIZE
public static final String TYPES_BY_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_SAMPLING_THRESHOLD
public static final int DEFAULT_SAMPLING_THRESHOLD
- See Also:
- Constant Field Values
-
DEFAULT_SAMPLING_PERCENT
public static final float DEFAULT_SAMPLING_PERCENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setSamplingThreshold
public void setSamplingThreshold(int threshold)
Set the sampling threshold. If the index has more documents than this threshold then only some values will be sampled and the totals will be extrapolated.- Parameters:
threshold
- size threshold (number of documents). Default value isDEFAULT_SAMPLING_THRESHOLD
. Setting this to values <= 0 means no threshold (and no sampling).
-
setSamplingPercent
public void setSamplingPercent(float percent) throws IllegalArgumentException
Sampling percent (a number greater than 0 and less or equal to 100). When index size exceeds the threshold then approximately only this percent of data will be retrieved from the index and the totals will be extrapolated.- Parameters:
percent
- sample percent. Default value isDEFAULT_SAMPLING_PERCENT
.- Throws:
IllegalArgumentException
- when value is less than or equal to 0.0 or greater than 100.0, or the sampling percent is so small that less than 10 documents would be sampled.
-
estimate
public IndexSizeEstimator.Estimate estimate() throws Exception
- Throws:
Exception
-
-