Package org.apache.solr.handler.admin
Class IndexSizeEstimator
java.lang.Object
org.apache.solr.handler.admin.IndexSizeEstimator
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 ClassesModifier and TypeClassDescriptionstatic final classstatic classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIndexSizeEstimator(org.apache.lucene.index.IndexReader reader, int topN, int maxLength, boolean withSummary, boolean withDetails) -
Method Summary
Modifier and TypeMethodDescriptionestimate()static voidvoidsetSamplingPercent(float percent) Sampling percent (a number greater than 0 and less or equal to 100).voidsetSamplingThreshold(int threshold) Set the sampling threshold.
-
Field Details
-
TERMS
- See Also:
-
STORED_FIELDS
- See Also:
-
NORMS
- See Also:
-
DOC_VALUES
- See Also:
-
POINTS
- See Also:
-
TERM_VECTORS
- See Also:
-
SUMMARY
- See Also:
-
DETAILS
- See Also:
-
FIELDS_BY_SIZE
- See Also:
-
TYPES_BY_SIZE
- See Also:
-
DEFAULT_SAMPLING_THRESHOLD
public static final int DEFAULT_SAMPLING_THRESHOLD- See Also:
-
DEFAULT_SAMPLING_PERCENT
public static final float DEFAULT_SAMPLING_PERCENT- See Also:
-
-
Constructor Details
-
IndexSizeEstimator
public IndexSizeEstimator(org.apache.lucene.index.IndexReader reader, int topN, int maxLength, boolean withSummary, boolean withDetails)
-
-
Method Details
-
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
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
- Throws:
Exception
-
main
- Throws:
Exception
-