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>avoidCodecsSet<String>dvFormatNamesunique set of docvalues format names this codec knows aboutSet<String>formatNamesunique 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 DocValuesFormatgetDocValuesFormatForField(String name)Returns the docvalues format that should be used for writing new segments offield.PostingsFormatgetPostingsFormatForField(String name)Returns the postings format that should be used for writing new segments offield.PointsFormatpointsFormat()StringtoString()-
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:
pointsFormatin classAssertingCodec
-
getPostingsFormatForField
public PostingsFormat getPostingsFormatForField(String name)
Description copied from class:AssertingCodecReturns the postings format that should be used for writing new segments offield.The default implementation always returns "Asserting"
- Overrides:
getPostingsFormatForFieldin classAssertingCodec
-
getDocValuesFormatForField
public DocValuesFormat getDocValuesFormatForField(String name)
Description copied from class:AssertingCodecReturns the docvalues format that should be used for writing new segments offield.The default implementation always returns "Asserting"
- Overrides:
getDocValuesFormatForFieldin classAssertingCodec
-
toString
public String toString()
- Overrides:
toStringin classAssertingCodec
-
-