public abstract class Codec extends implements NamedSPILoader.NamedSPI
Note, when extending this class, the name (getName()
) is
written into the index. In order for the segment to be read, the
name must resolve to your implementation via forName(String)
.
This method uses Java's
(SPI) to resolve codec names.
If you implement your own codec, make sure that it has a no-arg constructor so SPI can load it.
Modifier | Constructor and Description |
---|---|
protected |
name)
Creates a new codec.
|
Modifier and Type | Method and Description |
---|---|
static <> |
availableCodecs()
returns a list of all available codec names
|
abstract CompoundFormat |
compoundFormat()
Encodes/decodes compound files
|
abstract DocValuesFormat |
docValuesFormat()
Encodes/decodes docvalues
|
abstract FieldInfosFormat |
fieldInfosFormat()
Encodes/decodes field infos file
|
static Codec |
name)
looks up a codec by name
|
static Codec |
getDefault()
expert: returns the default codec used for newly created
IndexWriterConfig s. |
|
getName()
Returns this codec's name
|
abstract LiveDocsFormat |
liveDocsFormat()
Encodes/decodes live docs
|
abstract NormsFormat |
normsFormat()
Encodes/decodes document normalization values
|
abstract PointsFormat |
pointsFormat()
Encodes/decodes points index
|
abstract PostingsFormat |
postingsFormat()
Encodes/decodes postings
|
static void |
classloader)
Reloads the codec list from the given .
|
abstract SegmentInfoFormat |
segmentInfoFormat()
Encodes/decodes segment info file
|
static void |
setDefault(Codec codec)
expert: sets the default codec used for newly created
IndexWriterConfig s. |
abstract StoredFieldsFormat |
storedFieldsFormat()
Encodes/decodes stored fields
|
abstract TermVectorsFormat |
termVectorsFormat()
Encodes/decodes term vectors
|
|
toString()
returns the codec's name.
|
protected Codec( name)
The provided name will be written into the index segment: in order to for the segment to be read this class should be registered with Java's SPI mechanism (registered in META-INF/ of your jar file, etc).
name
- must be all ascii alphanumeric, and less than 128 characters in length.public final getName()
getName
in interface NamedSPILoader.NamedSPI
public abstract PostingsFormat postingsFormat()
public abstract DocValuesFormat docValuesFormat()
public abstract StoredFieldsFormat storedFieldsFormat()
public abstract TermVectorsFormat termVectorsFormat()
public abstract FieldInfosFormat fieldInfosFormat()
public abstract SegmentInfoFormat segmentInfoFormat()
public abstract NormsFormat normsFormat()
public abstract LiveDocsFormat liveDocsFormat()
public abstract CompoundFormat compoundFormat()
public abstract PointsFormat pointsFormat()
public static name)
public static <> availableCodecs()
public static void reloadCodecs( classloader)
availableCodecs()
,...) stay consistent.
NOTE: Only new codecs are added, existing ones are never removed or replaced.
This method is expensive and should only be called for discovery of new codecs on the given classpath/classloader!
public static Codec getDefault()
IndexWriterConfig
s.public static void setDefault(Codec codec)
IndexWriterConfig
s.public toString()
in class
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.