Package org.apache.lucene.codecs.memory
Class DirectDocValuesFormat
java.lang.Object
org.apache.lucene.codecs.DocValuesFormat
org.apache.lucene.codecs.memory.DirectDocValuesFormat
- All Implemented Interfaces:
NamedSPILoader.NamedSPI
In-memory docvalues format that does no (or very little)
compression. Indexed values are stored on disk, but
then at search time all values are loaded into memory as
simple java arrays. For numeric values, it uses
byte[], short[], int[], long[] as necessary to fit the
range of the values. For binary values, there is an int
(4 bytes) overhead per value.
Limitations:
- For binary and sorted fields the total space required for all binary values cannot exceed about 2.1 GB (see #MAX_TOTAL_BYTES_LENGTH).
- For sorted set fields, the sum of the size of each
document's set of values cannot exceed about 2.1 B
values (see #MAX_SORTED_SET_ORDS). For example,
if every document has 10 values (10 instances of
SortedSetDocValuesField) added, then no more than ~210 M documents can be added to one segment.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final String(package private) static final Stringstatic final intThe sum of the number of values across all documents in a sorted set field cannot exceed this.static final intThe sum of all byte lengths for binary field, or for the unique values in sorted or sorted set fields, cannot exceed this.(package private) static final String(package private) static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfieldsConsumer(SegmentWriteState state) Returns aDocValuesConsumerto write docvalues to the index.fieldsProducer(SegmentReadState state) Returns aDocValuesProducerto read docvalues from the index.Methods inherited from class org.apache.lucene.codecs.DocValuesFormat
availableDocValuesFormats, forName, getName, reloadDocValuesFormats, toString
-
Field Details
-
MAX_TOTAL_BYTES_LENGTH
public static final int MAX_TOTAL_BYTES_LENGTHThe sum of all byte lengths for binary field, or for the unique values in sorted or sorted set fields, cannot exceed this. -
MAX_SORTED_SET_ORDS
public static final int MAX_SORTED_SET_ORDSThe sum of the number of values across all documents in a sorted set field cannot exceed this. -
DATA_CODEC
- See Also:
-
DATA_EXTENSION
- See Also:
-
METADATA_CODEC
- See Also:
-
METADATA_EXTENSION
- See Also:
-
-
Constructor Details
-
DirectDocValuesFormat
public DirectDocValuesFormat()Sole constructor.
-
-
Method Details
-
fieldsConsumer
Description copied from class:DocValuesFormatReturns aDocValuesConsumerto write docvalues to the index.- Specified by:
fieldsConsumerin classDocValuesFormat- Throws:
IOException
-
fieldsProducer
Description copied from class:DocValuesFormatReturns aDocValuesProducerto read docvalues from the index.NOTE: by the time this call returns, it must hold open any files it will need to use; else, those files may be deleted. Additionally, required files may be deleted during the execution of this call before there is a chance to open them. Under these circumstances an IOException should be thrown by the implementation. IOExceptions are expected and will automatically cause a retry of the segment opening logic with the newly revised segments.
- Specified by:
fieldsProducerin classDocValuesFormat- Throws:
IOException
-