public class IndexSizeEstimator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IndexSizeEstimator.Estimate |
static class |
IndexSizeEstimator.Item |
static class |
IndexSizeEstimator.ItemPriorityQueue |
static class |
IndexSizeEstimator.MapWriterSummaryStatistics |
Modifier and Type | Field and 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 and Description |
---|
IndexSizeEstimator(IndexReader reader,
int topN,
int maxLength,
boolean withSummary,
boolean withDetails) |
Modifier and Type | Method and 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.
|
public static final String TERMS
public static final String STORED_FIELDS
public static final String NORMS
public static final String DOC_VALUES
public static final String POINTS
public static final String TERM_VECTORS
public static final String SUMMARY
public static final String DETAILS
public static final String FIELDS_BY_SIZE
public static final String TYPES_BY_SIZE
public static final int DEFAULT_SAMPLING_THRESHOLD
public static final float DEFAULT_SAMPLING_PERCENT
public IndexSizeEstimator(IndexReader reader, int topN, int maxLength, boolean withSummary, boolean withDetails)
public void setSamplingThreshold(int threshold)
threshold
- size threshold (number of documents). Default value is DEFAULT_SAMPLING_THRESHOLD
.
Setting this to values <= 0 means no threshold (and no sampling).public void setSamplingPercent(float percent) throws IllegalArgumentException
percent
- sample percent. Default value is DEFAULT_SAMPLING_PERCENT
.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.public IndexSizeEstimator.Estimate estimate() throws Exception
Exception
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.