Package org.apache.lucene.tests.index
Class RandomCodec
- java.lang.Object
-
- org.apache.lucene.codecs.Codec
-
- org.apache.lucene.codecs.FilterCodec
-
- org.apache.lucene.tests.codecs.asserting.AssertingCodec
-
- org.apache.lucene.tests.index.RandomCodec
-
- All Implemented Interfaces:
NamedSPILoader.NamedSPI
public class RandomCodec extends AssertingCodec
Codec that assigns per-field random postings formats.The same field/format assignment will happen regardless of order, a hash is computed up front that determines the mapping. This means fields can be put into things like HashSets and added to documents in different orders and the test will still be deterministic and reproducable.
-
-
Field Summary
Fields Modifier and Type Field Description Set<String>
avoidCodecs
Set<String>
dvFormatNames
unique set of docvalues format names this codec knows aboutSet<String>
formatNames
unique set of format names this codec knows about-
Fields inherited from class org.apache.lucene.codecs.FilterCodec
delegate
-
-
Constructor Summary
Constructors Constructor Description RandomCodec(Random random)
RandomCodec(Random random, Set<String> avoidCodecs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocValuesFormat
getDocValuesFormatForField(String name)
Returns the docvalues format that should be used for writing new segments offield
.PostingsFormat
getPostingsFormatForField(String name)
Returns the postings format that should be used for writing new segments offield
.PointsFormat
pointsFormat()
String
toString()
-
Methods inherited from class org.apache.lucene.tests.codecs.asserting.AssertingCodec
docValuesFormat, getKnnVectorsFormatForField, knnVectorsFormat, liveDocsFormat, normsFormat, postingsFormat, storedFieldsFormat, termVectorsFormat
-
Methods inherited from class org.apache.lucene.codecs.FilterCodec
compoundFormat, fieldInfosFormat, segmentInfoFormat
-
Methods inherited from class org.apache.lucene.codecs.Codec
availableCodecs, forName, getDefault, getName, reloadCodecs, setDefault
-
-
-
-
Method Detail
-
pointsFormat
public PointsFormat pointsFormat()
- Overrides:
pointsFormat
in classAssertingCodec
-
getPostingsFormatForField
public PostingsFormat getPostingsFormatForField(String name)
Description copied from class:AssertingCodec
Returns the postings format that should be used for writing new segments offield
.The default implementation always returns "Asserting"
- Overrides:
getPostingsFormatForField
in classAssertingCodec
-
getDocValuesFormatForField
public DocValuesFormat getDocValuesFormatForField(String name)
Description copied from class:AssertingCodec
Returns the docvalues format that should be used for writing new segments offield
.The default implementation always returns "Asserting"
- Overrides:
getDocValuesFormatForField
in classAssertingCodec
-
toString
public String toString()
- Overrides:
toString
in classAssertingCodec
-
-