From 24005cdcc59eee9e0ee9d06fffb29e32b7e9a0cb Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sun, 28 Sep 2014 14:36:00 +0000 Subject: [PATCH] LUCENE-5969: fix compile/javadocs, tighten up backwards codecs, add more safety to 5.x fields/vectors git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene5969@1628070 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/codecs/lucene40/BitVector.java | 89 ++------ .../lucene/codecs/lucene40/Lucene40Codec.java | 11 +- .../lucene40/Lucene40DocValuesFormat.java | 101 +-------- .../lucene40/Lucene40DocValuesReader.java | 1 - .../lucene40/Lucene40FieldInfosFormat.java | 69 +----- .../lucene40/Lucene40FieldInfosReader.java | 5 +- .../lucene40/Lucene40LiveDocsFormat.java | 35 +-- .../codecs/lucene40/Lucene40NormsFormat.java | 12 - .../codecs/lucene40/Lucene40NormsReader.java | 5 +- .../lucene40/Lucene40PostingsBaseFormat.java | 10 +- .../lucene40/Lucene40PostingsFormat.java | 209 +----------------- .../lucene40/Lucene40PostingsReader.java | 9 +- .../lucene40/Lucene40SegmentInfoFormat.java | 51 +---- .../lucene40/Lucene40SegmentInfoReader.java | 7 +- .../lucene40/Lucene40SkipListReader.java | 7 +- .../lucene40/Lucene40StoredFieldsFormat.java | 54 +---- .../lucene40/Lucene40StoredFieldsReader.java | 15 +- .../lucene40/Lucene40TermVectorsFormat.java | 87 +------- .../lucene40/Lucene40TermVectorsReader.java | 8 +- .../lucene/codecs/lucene41/Lucene41Codec.java | 12 +- .../lucene41/Lucene41StoredFieldsFormat.java | 1 + .../Lucene41StoredFieldsIndexReader.java | 2 +- .../codecs/lucene410/Lucene410Codec.java | 15 +- .../lucene/codecs/lucene42/Lucene42Codec.java | 13 +- .../lucene42/Lucene42DocValuesFormat.java | 101 +-------- .../lucene42/Lucene42DocValuesProducer.java | 6 +- .../lucene42/Lucene42FieldInfosFormat.java | 60 +---- .../lucene42/Lucene42FieldInfosReader.java | 2 - .../codecs/lucene42/Lucene42NormsFormat.java | 18 +- .../lucene42/Lucene42NormsProducer.java | 4 +- .../lucene42/Lucene42TermVectorsReader.java | 2 +- .../lucene/codecs/lucene45/Lucene45Codec.java | 13 +- .../lucene45/Lucene45DocValuesConsumer.java | 6 +- .../lucene45/Lucene45DocValuesFormat.java | 135 +---------- .../lucene45/Lucene45DocValuesProducer.java | 7 +- .../lucene/codecs/lucene46/Lucene46Codec.java | 13 +- .../lucene46/Lucene46FieldInfosFormat.java | 68 +----- .../lucene46/Lucene46FieldInfosReader.java | 4 +- .../lucene46/Lucene46FieldInfosWriter.java | 4 +- .../lucene46/Lucene46SegmentInfoFormat.java | 48 +--- .../lucene46/Lucene46SegmentInfoReader.java | 9 +- .../lucene/codecs/lucene49/Lucene49Codec.java | 15 +- .../lucene49/Lucene49DocValuesConsumer.java | 6 +- .../lucene49/Lucene49DocValuesFormat.java | 140 +----------- .../lucene49/Lucene49DocValuesProducer.java | 6 +- .../lucene40/Lucene40DocValuesWriter.java | 8 +- .../lucene40/Lucene40FieldInfosWriter.java | 8 +- .../lucene40/Lucene40PostingsWriter.java | 9 +- .../codecs/lucene40/Lucene40RWCodec.java | 7 +- .../lucene40/Lucene40RWDocValuesFormat.java | 9 +- .../lucene40/Lucene40RWNormsFormat.java | 9 +- .../lucene40/Lucene40RWPostingsFormat.java | 15 +- .../lucene40/Lucene40RWSegmentInfoFormat.java | 8 +- .../Lucene40RWStoredFieldsFormat.java | 10 +- .../lucene40/Lucene40RWTermVectorsFormat.java | 11 +- .../lucene40/Lucene40SegmentInfoWriter.java | 8 +- .../lucene40/Lucene40SkipListWriter.java | 9 +- .../lucene40/Lucene40StoredFieldsWriter.java | 13 +- .../lucene40/Lucene40TermVectorsWriter.java | 20 +- .../lucene/codecs/lucene40/TestBitVector.java | 1 - .../TestLucene40StoredFieldsFormat.java | 1 - .../TestLucene40TermVectorsFormat.java | 1 - .../codecs/lucene41/Lucene41RWCodec.java | 7 +- .../Lucene41RWStoredFieldsFormat.java | 8 +- .../Lucene41StoredFieldsIndexWriter.java | 4 +- .../lucene41/Lucene41StoredFieldsWriter.java | 4 +- .../lucene42/Lucene42DocValuesConsumer.java | 7 +- .../lucene42/Lucene42FieldInfosWriter.java | 6 +- .../lucene42/Lucene42NormsConsumer.java | 6 +- .../codecs/lucene42/Lucene42RWCodec.java | 8 +- .../lucene42/Lucene42RWDocValuesFormat.java | 8 +- .../lucene42/Lucene42RWNormsFormat.java | 7 +- .../lucene42/Lucene42RWTermVectorsFormat.java | 8 +- .../lucene42/Lucene42TermVectorsWriter.java | 4 +- .../codecs/lucene45/Lucene45RWCodec.java | 2 +- .../lucene45/Lucene45RWDocValuesFormat.java | 6 +- .../lucene45/TestLucene45DocValuesFormat.java | 1 - .../codecs/lucene46/Lucene46RWCodec.java | 8 +- .../lucene46/Lucene46RWSegmentInfoFormat.java | 8 +- .../lucene46/Lucene46SegmentInfoWriter.java | 9 +- .../codecs/lucene49/Lucene49RWCodec.java | 7 +- .../lucene49/Lucene49RWDocValuesFormat.java | 9 +- .../CompressingStoredFieldsReader.java | 44 ++-- .../CompressingTermVectorsReader.java | 39 ++-- .../codecs/compressing/MatchingReaders.java | 5 +- .../org/apache/lucene/index/MergeState.java | 6 +- .../apache/solr/update/SolrIndexConfig.java | 2 - .../solr/update/SolrIndexConfigTest.java | 12 - 88 files changed, 332 insertions(+), 1545 deletions(-) diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/BitVector.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/BitVector.java index a565e265d9f..0997a646124 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/BitVector.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/BitVector.java @@ -31,19 +31,11 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.BitUtil; import org.apache.lucene.util.MutableBits; -/** Optimized implementation of a vector of bits. This is more-or-less like - * java.util.BitSet, but also includes the following: - * - * - * @lucene.internal +/** + * Bitset for support of 4.x live documents + * @deprecated only for old 4.x segments */ -// pkg-private: if this thing is generally useful then it can go back in .util, -// but the serialization must be here underneath the codec. +@Deprecated final class BitVector implements Cloneable, MutableBits { private byte[] bits; @@ -52,7 +44,7 @@ final class BitVector implements Cloneable, MutableBits { private int version; /** Constructs a vector capable of holding n bits. */ - public BitVector(int n) { + BitVector(int n) { size = n; bits = new byte[getNumBytes(size)]; count = 0; @@ -90,27 +82,6 @@ final class BitVector implements Cloneable, MutableBits { count = -1; } - /** Sets the value of bit to true, and - * returns true if bit was already set */ - public final boolean getAndSet(int bit) { - if (bit >= size) { - throw new ArrayIndexOutOfBoundsException("bit=" + bit + " size=" + size); - } - final int pos = bit >> 3; - final int v = bits[pos]; - final int flag = 1 << (bit & 7); - if ((flag & v) != 0) - return true; - else { - bits[pos] = (byte) (v | flag); - if (count != -1) { - count++; - assert count <= size; - } - return false; - } - } - /** Sets the value of bit to zero. */ @Override public final void clear(int bit) { @@ -121,25 +92,6 @@ final class BitVector implements Cloneable, MutableBits { count = -1; } - public final boolean getAndClear(int bit) { - if (bit >= size) { - throw new ArrayIndexOutOfBoundsException(bit); - } - final int pos = bit >> 3; - final int v = bits[pos]; - final int flag = 1 << (bit & 7); - if ((flag & v) == 0) { - return false; - } else { - bits[pos] &= ~flag; - if (count != -1) { - count--; - assert count >= 0; - } - return true; - } - } - /** Returns true if bit is one and false if it is zero. */ @Override @@ -150,7 +102,7 @@ final class BitVector implements Cloneable, MutableBits { /** Returns the number of bits in this vector. This is also one greater than the number of the largest valid bit number. */ - public final int size() { + final int size() { return size; } @@ -162,7 +114,7 @@ final class BitVector implements Cloneable, MutableBits { /** Returns the total number of one bits in this vector. This is efficiently computed and cached, so that, if the vector is not changed, no recomputation is done for repeated calls. */ - public final int count() { + final int count() { // if the vector has been modified if (count == -1) { int c = 0; @@ -177,7 +129,7 @@ final class BitVector implements Cloneable, MutableBits { } /** For testing */ - public final int getRecomputedCount() { + final int getRecomputedCount() { int c = 0; int end = bits.length; for (int i = 0; i < end; i++) { @@ -191,29 +143,29 @@ final class BitVector implements Cloneable, MutableBits { private static String CODEC = "BitVector"; // Version before version tracking was added: - public final static int VERSION_PRE = -1; + final static int VERSION_PRE = -1; // First version: - public final static int VERSION_START = 0; + final static int VERSION_START = 0; // Changed DGaps to encode gaps between cleared bits, not // set: - public final static int VERSION_DGAPS_CLEARED = 1; + final static int VERSION_DGAPS_CLEARED = 1; // added checksum - public final static int VERSION_CHECKSUM = 2; + final static int VERSION_CHECKSUM = 2; // Increment version to change it: - public final static int VERSION_CURRENT = VERSION_CHECKSUM; + final static int VERSION_CURRENT = VERSION_CHECKSUM; - public int getVersion() { + int getVersion() { return version; } /** Writes this vector to the file name in Directory d, in a format that can be read by the constructor {@link #BitVector(Directory, String, IOContext)}. */ - public final void write(Directory d, String name, IOContext context) throws IOException { + final void write(Directory d, String name, IOContext context) throws IOException { assert !(d instanceof CompoundFileDirectory); try (IndexOutput output = d.createOutput(name, context)) { output.writeInt(-2); @@ -230,7 +182,7 @@ final class BitVector implements Cloneable, MutableBits { } /** Invert all bits */ - public void invertAll() { + void invertAll() { if (count != -1) { count = size - count; } @@ -254,13 +206,6 @@ final class BitVector implements Cloneable, MutableBits { } } - /** Set all bits */ - public void setAll() { - Arrays.fill(bits, (byte) 0xff); - clearUnusedBits(); - count = size; - } - /** Write as a bit set */ private void writeBits(IndexOutput output) throws IOException { output.writeInt(size()); // write size @@ -325,7 +270,7 @@ final class BitVector implements Cloneable, MutableBits { /** Constructs a bit vector from the file name in Directory d, as written by the {@link #write} method. */ - public BitVector(Directory d, String name, IOContext context) throws IOException { + BitVector(Directory d, String name, IOContext context) throws IOException { try (ChecksumIndexInput input = d.openChecksumInput(name, context)) { final int firstInt = input.readInt(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java index bb7f75fd79b..cce56cea31f 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40Codec.java @@ -19,7 +19,6 @@ package org.apache.lucene.codecs.lucene40; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.SegmentInfoFormat; @@ -30,17 +29,9 @@ import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; /** - * Implements the Lucene 4.0 index format, with configurable per-field postings formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene40 package documentation for file format details. + * Reader for the 4.0 file format * @deprecated Only for reading old 4.0 segments */ -// NOTE: if we make largish changes in a minor release, easier to just make Lucene42Codec or whatever -// if they are backwards compatible or smallish we can probably do the backwards in the postingsreader -// (it writes a minor version, etc). @Deprecated public class Lucene40Codec extends Codec { private final StoredFieldsFormat fieldsFormat = new Lucene40StoredFieldsFormat(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java index 4f350efc320..79f5b4f05ad 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesFormat.java @@ -19,119 +19,22 @@ package org.apache.lucene.codecs.lucene40; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.store.CompoundFileDirectory; -import org.apache.lucene.store.DataOutput; -import org.apache.lucene.util.packed.PackedInts; /** * Lucene 4.0 DocValues format. - *

- * Files: - *

- * Entries within the compound file: - * - *

- * There are several many types of {@code DocValues} with different encodings. - * From the perspective of filenames, all types store their values in .dat - * entries within the compound file. In the case of dereferenced/sorted types, the .dat - * actually contains only the unique values, and an additional .idx file contains - * pointers to these unique values. - *

- * Formats: - * - * Data Types: - * - * Notes: - * - *

- * Limitations: - *

* @deprecated Only for reading old 4.0 and 4.1 segments */ @Deprecated -// NOTE: not registered in SPI, doesnt respect segment suffix, etc -// for back compat only! public class Lucene40DocValuesFormat extends DocValuesFormat { /** Maximum length for each binary doc values field. */ - public static final int MAX_BINARY_FIELD_LENGTH = (1 << 15) - 2; + static final int MAX_BINARY_FIELD_LENGTH = (1 << 15) - 2; /** Sole constructor. */ public Lucene40DocValuesFormat() { @@ -144,7 +47,7 @@ public class Lucene40DocValuesFormat extends DocValuesFormat { } @Override - public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { + public final DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { String filename = IndexFileNames.segmentFileName(state.segmentInfo.name, "dv", IndexFileNames.COMPOUND_FILE_EXTENSION); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java index 718bcffa45c..b62a8fd5672 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40DocValuesReader.java @@ -48,7 +48,6 @@ import org.apache.lucene.util.packed.PackedInts; /** * Reads the 4.0 format of norms/docvalues - * @lucene.experimental * @deprecated Only for reading old 4.0 and 4.1 segments */ @Deprecated diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java index bf51c653a5c..93360bb9f87 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosFormat.java @@ -19,79 +19,12 @@ package org.apache.lucene.codecs.lucene40; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.FieldInfosFormat; import org.apache.lucene.codecs.FieldInfosReader; import org.apache.lucene.codecs.FieldInfosWriter; -import org.apache.lucene.store.DataOutput; // javadoc /** * Lucene 4.0 Field Infos format. - *

- *

Field names are stored in the field info file, with suffix .fnm.

- *

FieldInfos (.fnm) --> Header,FieldsCount, <FieldName,FieldNumber, - * FieldBits,DocValuesBits,Attributes> FieldsCount

- *

Data types: - *

- *

- * Field Descriptions: - * - * - * @lucene.experimental * @deprecated Only for reading old 4.0 and 4.1 segments */ @Deprecated @@ -103,7 +36,7 @@ public class Lucene40FieldInfosFormat extends FieldInfosFormat { } @Override - public FieldInfosReader getFieldInfosReader() throws IOException { + public final FieldInfosReader getFieldInfosReader() throws IOException { return reader; } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java index a4c4da07ada..6aefdb59404 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosReader.java @@ -37,13 +37,10 @@ import org.apache.lucene.util.IOUtils; /** * Lucene 4.0 FieldInfos reader. - * - * @lucene.experimental - * @see Lucene40FieldInfosFormat * @deprecated Only for reading old 4.0 and 4.1 segments */ @Deprecated -class Lucene40FieldInfosReader extends FieldInfosReader { +final class Lucene40FieldInfosReader extends FieldInfosReader { /** Sole constructor. */ public Lucene40FieldInfosReader() { diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java index 64dc8541868..e30cb8d1a26 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java @@ -20,12 +20,10 @@ package org.apache.lucene.codecs.lucene40; import java.io.IOException; import java.util.Collection; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.index.CorruptIndexException; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentCommitInfo; -import org.apache.lucene.store.DataOutput; // javadocs import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; import org.apache.lucene.util.Bits; @@ -33,37 +31,10 @@ import org.apache.lucene.util.MutableBits; /** * Lucene 4.0 Live Documents Format. - *

- *

The .del file is optional, and only exists when a segment contains - * deletions.

- *

Although per-segment, this file is maintained exterior to compound segment - * files.

- *

Deletions (.del) --> Format,Header,ByteCount,BitCount, Bits | DGaps (depending - * on Format)

- * - *

Format is 1: indicates cleared DGaps.

- *

ByteCount indicates the number of bytes in Bits. It is typically - * (SegSize/8)+1.

- *

BitCount indicates the number of bits that are currently set in Bits.

- *

Bits contains one bit for each document indexed. When the bit corresponding - * to a document number is cleared, that document is marked as deleted. Bit ordering - * is from least to most significant. Thus, if Bits contains two bytes, 0x00 and - * 0x02, then document 9 is marked as alive (not deleted).

- *

DGaps represents sparse bit-vectors more efficiently than Bits. It is made - * of DGaps on indexes of nonOnes bytes in Bits, and the nonOnes bytes themselves. - * The number of nonOnes bytes in Bits (NonOnesBytesCount) is not stored.

- *

For example, if there are 8000 bits and only bits 10,12,32 are cleared, DGaps - * would be used:

- *

(VInt) 1 , (byte) 20 , (VInt) 3 , (Byte) 1

+ * @deprecated Only for reading old 4.x segments */ -public class Lucene40LiveDocsFormat extends LiveDocsFormat { +@Deprecated +public final class Lucene40LiveDocsFormat extends LiveDocsFormat { /** Extension of deletes */ static final String DELETES_EXTENSION = "del"; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java index ed2f507bad5..02d21c12664 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsFormat.java @@ -25,21 +25,9 @@ import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.store.CompoundFileDirectory; /** * Lucene 4.0 Norms Format. - *

- * Files: - *

- * Norms are implemented as DocValues, so other than file extension, norms are - * written exactly the same way as {@link Lucene40DocValuesFormat DocValues}. - * - * @see Lucene40DocValuesFormat - * @lucene.experimental * @deprecated Only for reading old 4.0 and 4.1 segments */ @Deprecated diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java index a359938f12e..7839011cc1d 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40NormsReader.java @@ -27,14 +27,13 @@ import org.apache.lucene.util.Accountable; /** * Reads 4.0/4.1 norms. - * Implemented the same as docvalues, but with a different filename. * @deprecated Only for reading old 4.0 and 4.1 segments */ @Deprecated -class Lucene40NormsReader extends NormsProducer { +final class Lucene40NormsReader extends NormsProducer { private final Lucene40DocValuesReader impl; - public Lucene40NormsReader(SegmentReadState state, String filename) throws IOException { + Lucene40NormsReader(SegmentReadState state, String filename) throws IOException { impl = new Lucene40DocValuesReader(state, filename, Lucene40FieldInfosReader.LEGACY_NORM_TYPE_KEY); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java index 435a5ee17ba..5d278db4209 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsBaseFormat.java @@ -26,17 +26,13 @@ import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; /** - * Provides a {@link PostingsReaderBase} and {@link - * PostingsWriterBase}. - * + * PostingsReaderBase for 4.0 segments * @deprecated Only for reading old 4.0 segments */ - -// TODO: should these also be named / looked up via SPI? @Deprecated -public final class Lucene40PostingsBaseFormat extends PostingsBaseFormat { +final class Lucene40PostingsBaseFormat extends PostingsBaseFormat { /** Sole constructor. */ - public Lucene40PostingsBaseFormat() { + Lucene40PostingsBaseFormat() { super("Lucene40"); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java index 93b21a77b01..e6e3eeaf53b 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsFormat.java @@ -19,226 +19,25 @@ package org.apache.lucene.codecs.lucene40; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.FieldsProducer; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.PostingsReaderBase; -import org.apache.lucene.codecs.PostingsWriterBase; // javadocs import org.apache.lucene.codecs.blocktree.BlockTreeTermsReader; -import org.apache.lucene.codecs.blocktree.BlockTreeTermsWriter; -import org.apache.lucene.index.DocsEnum; // javadocs -import org.apache.lucene.index.FieldInfo.IndexOptions; // javadocs -import org.apache.lucene.index.FieldInfos; // javadocs import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.store.DataOutput; // javadocs -import org.apache.lucene.util.fst.FST; // javadocs /** * Lucene 4.0 Postings format. - *

- * Files: - *

- *

- *

- * - *

Term Dictionary

- * - *

The .tim file contains the list of terms in each - * field along with per-term statistics (such as docfreq) - * and pointers to the frequencies, positions and - * skip data in the .frq and .prx files. - * See {@link BlockTreeTermsWriter} for more details on the format. - *

- * - *

NOTE: The term dictionary can plug into different postings implementations: - * the postings writer/reader are actually responsible for encoding - * and decoding the Postings Metadata and Term Metadata sections described here:

- * - *

Notes:

- * - * - *

Term Index

- *

The .tip file contains an index into the term dictionary, so that it can be - * accessed randomly. See {@link BlockTreeTermsWriter} for more details on the format.

- * - *

Frequencies

- *

The .frq file contains the lists of documents which contain each term, along - * with the frequency of the term in that document (except when frequencies are - * omitted: {@link IndexOptions#DOCS_ONLY}).

- * - *

TermFreqs are ordered by term (the term is implicit, from the term dictionary).

- *

TermFreq entries are ordered by increasing document number.

- *

DocDelta: if frequencies are indexed, this determines both the document - * number and the frequency. In particular, DocDelta/2 is the difference between - * this document number and the previous document number (or zero when this is the - * first document in a TermFreqs). When DocDelta is odd, the frequency is one. - * When DocDelta is even, the frequency is read as another VInt. If frequencies - * are omitted, DocDelta contains the gap (not multiplied by 2) between document - * numbers and no frequency information is stored.

- *

For example, the TermFreqs for a term which occurs once in document seven - * and three times in document eleven, with frequencies indexed, would be the - * following sequence of VInts:

- *

15, 8, 3

- *

If frequencies were omitted ({@link IndexOptions#DOCS_ONLY}) it would be this - * sequence of VInts instead:

- *

7,4

- *

DocSkip records the document number before every SkipInterval th - * document in TermFreqs. If payloads and offsets are disabled for the term's field, then - * DocSkip represents the difference from the previous value in the sequence. If - * payloads and/or offsets are enabled for the term's field, then DocSkip/2 represents the - * difference from the previous value in the sequence. In this case when - * DocSkip is odd, then PayloadLength and/or OffsetLength are stored indicating the length of - * the last payload/offset before the SkipIntervalth document in TermPositions.

- *

PayloadLength indicates the length of the last payload.

- *

OffsetLength indicates the length of the last offset (endOffset-startOffset).

- *

- * FreqSkip and ProxSkip record the position of every SkipInterval th - * entry in FreqFile and ProxFile, respectively. File positions are relative to - * the start of TermFreqs and Positions, to the previous SkipDatum in the - * sequence.

- *

For example, if DocFreq=35 and SkipInterval=16, then there are two SkipData - * entries, containing the 15 th and 31 st document numbers - * in TermFreqs. The first FreqSkip names the number of bytes after the beginning - * of TermFreqs that the 16 th SkipDatum starts, and the second the - * number of bytes after that that the 32 nd starts. The first ProxSkip - * names the number of bytes after the beginning of Positions that the 16 - * th SkipDatum starts, and the second the number of bytes after that - * that the 32 nd starts.

- *

Each term can have multiple skip levels. The amount of skip levels for a - * term is NumSkipLevels = Min(MaxSkipLevels, - * floor(log(DocFreq/log(SkipInterval)))). The number of SkipData entries for a - * skip level is DocFreq/(SkipInterval^(Level + 1)), whereas the lowest skip level - * is Level=0.
- * Example: SkipInterval = 4, MaxSkipLevels = 2, DocFreq = 35. Then skip level 0 - * has 8 SkipData entries, containing the 3rd, 7th, - * 11th, 15th, 19th, 23rd, - * 27th, and 31st document numbers in TermFreqs. Skip level - * 1 has 2 SkipData entries, containing the 15th and 31st - * document numbers in TermFreqs.
- * The SkipData entries on all upper levels > 0 contain a SkipChildLevelPointer - * referencing the corresponding SkipData entry in level-1. In the example has - * entry 15 on level 1 a pointer to entry 15 on level 0 and entry 31 on level 1 a - * pointer to entry 31 on level 0. - *

- * - *

Positions

- *

The .prx file contains the lists of positions that each term occurs at - * within documents. Note that fields omitting positional data do not store - * anything into this file, and if all fields in the index omit positional data - * then the .prx file will not exist.

- * - *

TermPositions are ordered by term (the term is implicit, from the term dictionary).

- *

Positions entries are ordered by increasing document number (the document - * number is implicit from the .frq file).

- *

PositionDelta is, if payloads are disabled for the term's field, the - * difference between the position of the current occurrence in the document and - * the previous occurrence (or zero, if this is the first occurrence in this - * document). If payloads are enabled for the term's field, then PositionDelta/2 - * is the difference between the current and the previous position. If payloads - * are enabled and PositionDelta is odd, then PayloadLength is stored, indicating - * the length of the payload at the current term position.

- *

For example, the TermPositions for a term which occurs as the fourth term in - * one document, and as the fifth and ninth term in a subsequent document, would - * be the following sequence of VInts (payloads disabled):

- *

4, 5, 4

- *

PayloadData is metadata associated with the current term position. If - * PayloadLength is stored at the current position, then it indicates the length - * of this payload. If PayloadLength is not stored, then this payload has the same - * length as the payload at the previous position.

- *

OffsetDelta/2 is the difference between this position's startOffset from the - * previous occurrence (or zero, if this is the first occurrence in this document). - * If OffsetDelta is odd, then the length (endOffset-startOffset) differs from the - * previous occurrence and an OffsetLength follows. Offset data is only written for - * {@link IndexOptions#DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS}.

- * - * @deprecated Only for reading old 4.0 segments */ - -// TODO: this class could be created by wrapping -// BlockTreeTermsDict around Lucene40PostingsBaseFormat; ie -// we should not duplicate the code from that class here: + * @deprecated Only for reading old 4.0 segments + */ @Deprecated public class Lucene40PostingsFormat extends PostingsFormat { - /** minimum items (terms or sub-blocks) per block for BlockTree */ - protected final int minBlockSize; - /** maximum items (terms or sub-blocks) per block for BlockTree */ - protected final int maxBlockSize; - /** Creates {@code Lucene40PostingsFormat} with default * settings. */ public Lucene40PostingsFormat() { - this(BlockTreeTermsWriter.DEFAULT_MIN_BLOCK_SIZE, BlockTreeTermsWriter.DEFAULT_MAX_BLOCK_SIZE); - } - - /** Creates {@code Lucene40PostingsFormat} with custom - * values for {@code minBlockSize} and {@code - * maxBlockSize} passed to block terms dictionary. - * @see BlockTreeTermsWriter#BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int) */ - private Lucene40PostingsFormat(int minBlockSize, int maxBlockSize) { super("Lucene40"); - this.minBlockSize = minBlockSize; - assert minBlockSize > 1; - this.maxBlockSize = maxBlockSize; } @Override @@ -247,7 +46,7 @@ public class Lucene40PostingsFormat extends PostingsFormat { } @Override - public FieldsProducer fieldsProducer(SegmentReadState state) throws IOException { + public final FieldsProducer fieldsProducer(SegmentReadState state) throws IOException { PostingsReaderBase postings = new Lucene40PostingsReader(state.directory, state.fieldInfos, state.segmentInfo, state.context, state.segmentSuffix); boolean success = false; @@ -276,6 +75,6 @@ public class Lucene40PostingsFormat extends PostingsFormat { @Override public String toString() { - return getName() + "(minBlockSize=" + minBlockSize + " maxBlockSize=" + maxBlockSize + ")"; + return getName(); } } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java index d8c5a31a53b..05ffeda2591 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40PostingsReader.java @@ -43,13 +43,10 @@ import org.apache.lucene.util.BytesRefBuilder; import org.apache.lucene.util.IOUtils; /** - * Concrete class that reads the 4.0 frq/prox - * postings format. - * - * @see Lucene40PostingsFormat - * @deprecated Only for reading old 4.0 segments */ + * Reader for 4.0 postings format + * @deprecated Only for reading old 4.0 segments */ @Deprecated -public class Lucene40PostingsReader extends PostingsReaderBase { +final class Lucene40PostingsReader extends PostingsReaderBase { final static String TERMS_CODEC = "Lucene40PostingsWriterTerms"; final static String FRQ_CODEC = "Lucene40PostingsWriterFrq"; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java index 8ceb726bdc9..134dce2672e 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoFormat.java @@ -17,57 +17,14 @@ package org.apache.lucene.codecs.lucene40; * limitations under the License. */ -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.SegmentInfoReader; import org.apache.lucene.codecs.SegmentInfoWriter; -import org.apache.lucene.index.IndexWriter; // javadocs -import org.apache.lucene.index.SegmentInfo; // javadocs -import org.apache.lucene.index.SegmentInfos; // javadocs -import org.apache.lucene.store.DataOutput; // javadocs +import org.apache.lucene.index.SegmentInfo; /** * Lucene 4.0 Segment info format. - *

- * Files: - *

- *

- * Data types: - *

- *

- *

- * Field Descriptions: - *

- *

- *

- * - * @see SegmentInfos - * @lucene.experimental - * @deprecated Only for reading old 4.0-4.5 segments, and supporting IndexWriter.addIndexes + * @deprecated Only for reading old 4.0-4.5 segments */ @Deprecated public class Lucene40SegmentInfoFormat extends SegmentInfoFormat { @@ -78,7 +35,7 @@ public class Lucene40SegmentInfoFormat extends SegmentInfoFormat { } @Override - public SegmentInfoReader getSegmentInfoReader() { + public final SegmentInfoReader getSegmentInfoReader() { return reader; } @@ -88,7 +45,7 @@ public class Lucene40SegmentInfoFormat extends SegmentInfoFormat { } /** File extension used to store {@link SegmentInfo}. */ - public final static String SI_EXTENSION = "si"; + static final String SI_EXTENSION = "si"; static final String CODEC_NAME = "Lucene40SegmentInfo"; static final int VERSION_START = 0; static final int VERSION_CURRENT = VERSION_START; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java index 64b68978ec5..fe1e5c6ddda 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoReader.java @@ -34,14 +34,11 @@ import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.Version; /** - * Lucene 4.0 implementation of {@link SegmentInfoReader}. - * - * @see Lucene40SegmentInfoFormat - * @lucene.experimental + * Lucene 4.0 SI reader * @deprecated Only for reading old 4.0-4.5 segments */ @Deprecated -public class Lucene40SegmentInfoReader extends SegmentInfoReader { +final class Lucene40SegmentInfoReader extends SegmentInfoReader { /** Sole constructor. */ public Lucene40SegmentInfoReader() { diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java index 1580a390ba9..3275fa6a98d 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40SkipListReader.java @@ -24,14 +24,11 @@ import org.apache.lucene.codecs.MultiLevelSkipListReader; import org.apache.lucene.store.IndexInput; /** - * Implements the skip list reader for the 4.0 posting list format - * that stores positions and payloads. - * - * @see Lucene40PostingsFormat + * Lucene 4.0 skiplist reader * @deprecated Only for reading old 4.0 segments */ @Deprecated -public class Lucene40SkipListReader extends MultiLevelSkipListReader { +final class Lucene40SkipListReader extends MultiLevelSkipListReader { private boolean currentFieldStoresPayloads; private boolean currentFieldStoresOffsets; private long freqPointer[]; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java index dcdf360cb96..35dee656801 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsFormat.java @@ -19,66 +19,18 @@ package org.apache.lucene.codecs.lucene40; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.StoredFieldsReader; import org.apache.lucene.codecs.StoredFieldsWriter; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.store.DataOutput; // javadocs import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; /** * Lucene 4.0 Stored Fields Format. - *

Stored fields are represented by two files:

- *
    - *
  1. - *

    The field index, or .fdx file.

    - *

    This is used to find the location within the field data file of the fields - * of a particular document. Because it contains fixed-length data, this file may - * be easily randomly accessed. The position of document n 's field data is - * the {@link DataOutput#writeLong Uint64} at n*8 in this file.

    - *

    This contains, for each document, a pointer to its field data, as - * follows:

    - *
      - *
    • FieldIndex (.fdx) --> <Header>, <FieldValuesPosition> SegSize
    • - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • FieldValuesPosition --> {@link DataOutput#writeLong Uint64}
    • - *
    - *
  2. - *
  3. - *

    The field data, or .fdt file.

    - *

    This contains the stored fields of each document, as follows:

    - *
      - *
    • FieldData (.fdt) --> <Header>, <DocFieldData> SegSize
    • - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • DocFieldData --> FieldCount, <FieldNum, Bits, Value> - * FieldCount
    • - *
    • FieldCount --> {@link DataOutput#writeVInt VInt}
    • - *
    • FieldNum --> {@link DataOutput#writeVInt VInt}
    • - *
    • Bits --> {@link DataOutput#writeByte Byte}
    • - *
        - *
      • low order bit reserved.
      • - *
      • second bit is one for fields containing binary data
      • - *
      • third bit reserved.
      • - *
      • 4th to 6th bit (mask: 0x7<<3) define the type of a numeric field: - *
          - *
        • all bits in mask are cleared if no numeric field at all
        • - *
        • 1<<3: Value is Int
        • - *
        • 2<<3: Value is Long
        • - *
        • 3<<3: Value is Int as Float (as of {@link Float#intBitsToFloat(int)}
        • - *
        • 4<<3: Value is Long as Double (as of {@link Double#longBitsToDouble(long)}
        • - *
        - *
      • - *
      - *
    • Value --> String | BinaryValue | Int | Long (depending on Bits)
    • - *
    • BinaryValue --> ValueSize, <{@link DataOutput#writeByte Byte}>^ValueSize
    • - *
    • ValueSize --> {@link DataOutput#writeVInt VInt}
    • - * - *
    - *
- * @lucene.experimental */ + * @deprecated only for reading 4.0 segments */ +@Deprecated public class Lucene40StoredFieldsFormat extends StoredFieldsFormat { /** Sole constructor. */ @@ -86,7 +38,7 @@ public class Lucene40StoredFieldsFormat extends StoredFieldsFormat { } @Override - public StoredFieldsReader fieldsReader(Directory directory, SegmentInfo si, + public final StoredFieldsReader fieldsReader(Directory directory, SegmentInfo si, FieldInfos fn, IOContext context) throws IOException { return new Lucene40StoredFieldsReader(directory, si, fn, context); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java index 73d5e10b084..d8e3fcd705b 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsReader.java @@ -40,14 +40,11 @@ import java.nio.charset.StandardCharsets; import java.util.Collections; /** - * Class responsible for access to stored document fields. - *

- * It uses <segment>.fdt and <segment>.fdx; files. - * - * @see Lucene40StoredFieldsFormat - * @lucene.internal + * Reader for 4.0 stored fields + * @deprecated only for reading 4.0 segments */ -public final class Lucene40StoredFieldsReader extends StoredFieldsReader implements Cloneable, Closeable { +@Deprecated +final class Lucene40StoredFieldsReader extends StoredFieldsReader implements Cloneable, Closeable { // NOTE: bit 0 is free here! You can steal it! static final int FIELD_IS_BINARY = 1 << 1; @@ -76,10 +73,10 @@ public final class Lucene40StoredFieldsReader extends StoredFieldsReader impleme /** Extension of stored fields file */ - public static final String FIELDS_EXTENSION = "fdt"; + static final String FIELDS_EXTENSION = "fdt"; /** Extension of stored fields index file */ - public static final String FIELDS_INDEX_EXTENSION = "fdx"; + static final String FIELDS_INDEX_EXTENSION = "fdx"; private static final long RAM_BYTES_USED = RamUsageEstimator.shallowSizeOfInstance(Lucene40StoredFieldsReader.class); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java index efea3bbbf33..93d2f8b34bd 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsFormat.java @@ -19,100 +19,19 @@ package org.apache.lucene.codecs.lucene40; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.TermVectorsReader; import org.apache.lucene.codecs.TermVectorsWriter; import org.apache.lucene.index.FieldInfos; import org.apache.lucene.index.SegmentInfo; -import org.apache.lucene.store.DataOutput; // javadocs import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; /** * Lucene 4.0 Term Vectors format. - *

Term Vector support is an optional on a field by field basis. It consists of - * 3 files.

- *
    - *
  1. - *

    The Document Index or .tvx file.

    - *

    For each document, this stores the offset into the document data (.tvd) and - * field data (.tvf) files.

    - *

    DocumentIndex (.tvx) --> Header,<DocumentPosition,FieldPosition> - * NumDocs

    - *
      - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • DocumentPosition --> {@link DataOutput#writeLong UInt64} (offset in the .tvd file)
    • - *
    • FieldPosition --> {@link DataOutput#writeLong UInt64} (offset in the .tvf file)
    • - *
    - *
  2. - *
  3. - *

    The Document or .tvd file.

    - *

    This contains, for each document, the number of fields, a list of the fields - * with term vector info and finally a list of pointers to the field information - * in the .tvf (Term Vector Fields) file.

    - *

    The .tvd file is used to map out the fields that have term vectors stored - * and where the field information is in the .tvf file.

    - *

    Document (.tvd) --> Header,<NumFields, FieldNums, - * FieldPositions> NumDocs

    - *
      - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • NumFields --> {@link DataOutput#writeVInt VInt}
    • - *
    • FieldNums --> <FieldNumDelta> NumFields
    • - *
    • FieldNumDelta --> {@link DataOutput#writeVInt VInt}
    • - *
    • FieldPositions --> <FieldPositionDelta> NumFields-1
    • - *
    • FieldPositionDelta --> {@link DataOutput#writeVLong VLong}
    • - *
    - *
  4. - *
  5. - *

    The Field or .tvf file.

    - *

    This file contains, for each field that has a term vector stored, a list of - * the terms, their frequencies and, optionally, position, offset, and payload - * information.

    - *

    Field (.tvf) --> Header,<NumTerms, Flags, TermFreqs> - * NumFields

    - *
      - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • NumTerms --> {@link DataOutput#writeVInt VInt}
    • - *
    • Flags --> {@link DataOutput#writeByte Byte}
    • - *
    • TermFreqs --> <TermText, TermFreq, Positions?, PayloadData?, Offsets?> - * NumTerms
    • - *
    • TermText --> <PrefixLength, Suffix>
    • - *
    • PrefixLength --> {@link DataOutput#writeVInt VInt}
    • - *
    • Suffix --> {@link DataOutput#writeString String}
    • - *
    • TermFreq --> {@link DataOutput#writeVInt VInt}
    • - *
    • Positions --> <PositionDelta PayloadLength?>TermFreq
    • - *
    • PositionDelta --> {@link DataOutput#writeVInt VInt}
    • - *
    • PayloadLength --> {@link DataOutput#writeVInt VInt}
    • - *
    • PayloadData --> {@link DataOutput#writeByte Byte}NumPayloadBytes
    • - *
    • Offsets --> <{@link DataOutput#writeVInt VInt}, {@link DataOutput#writeVInt VInt}>TermFreq
    • - *
    - *

    Notes:

    - *
      - *
    • Flags byte stores whether this term vector has position, offset, payload. - * information stored.
    • - *
    • Term byte prefixes are shared. The PrefixLength is the number of initial - * bytes from the previous term which must be pre-pended to a term's suffix - * in order to form the term's bytes. Thus, if the previous term's text was "bone" - * and the term is "boy", the PrefixLength is two and the suffix is "y".
    • - *
    • PositionDelta is, if payloads are disabled for the term's field, the - * difference between the position of the current occurrence in the document and - * the previous occurrence (or zero, if this is the first occurrence in this - * document). If payloads are enabled for the term's field, then PositionDelta/2 - * is the difference between the current and the previous position. If payloads - * are enabled and PositionDelta is odd, then PayloadLength is stored, indicating - * the length of the payload at the current term position.
    • - *
    • PayloadData is metadata associated with a term position. If - * PayloadLength is stored at the current position, then it indicates the length - * of this payload. If PayloadLength is not stored, then this payload has the same - * length as the payload at the previous position. PayloadData encodes the - * concatenated bytes for all of a terms occurrences.
    • - *
    • Offsets are stored as delta encoded VInts. The first VInt is the - * startOffset, the second is the endOffset.
    • - *
    - *
  6. - *
+ * @deprecated only for reading 4.0 and 4.1 segments */ +@Deprecated public class Lucene40TermVectorsFormat extends TermVectorsFormat { /** Sole constructor. */ @@ -120,7 +39,7 @@ public class Lucene40TermVectorsFormat extends TermVectorsFormat { } @Override - public TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws IOException { + public final TermVectorsReader vectorsReader(Directory directory, SegmentInfo segmentInfo, FieldInfos fieldInfos, IOContext context) throws IOException { return new Lucene40TermVectorsReader(directory, segmentInfo, fieldInfos, context); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java index f290e3336c3..2287c2a0aef 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsReader.java @@ -48,12 +48,10 @@ import org.apache.lucene.util.IOUtils; /** * Lucene 4.0 Term Vectors reader. - *

- * It reads .tvd, .tvf, and .tvx files. - * - * @see Lucene40TermVectorsFormat + * @deprecated only for reading 4.0 and 4.1 segments */ -public class Lucene40TermVectorsReader extends TermVectorsReader implements Closeable { +@Deprecated +final class Lucene40TermVectorsReader extends TermVectorsReader implements Closeable { static final byte STORE_POSITIONS_WITH_TERMVECTOR = 0x1; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41Codec.java index b359f8587a7..b62367c208c 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41Codec.java @@ -19,7 +19,6 @@ package org.apache.lucene.codecs.lucene41; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.SegmentInfoFormat; @@ -36,14 +35,8 @@ import org.apache.lucene.codecs.lucene40.Lucene40TermVectorsFormat; import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; /** - * Implements the Lucene 4.1 index format, with configurable per-field postings formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene41 package documentation for file format details. - * @deprecated Only for reading old 4.0 segments - * @lucene.experimental + * Implements the Lucene 4.1 index format + * @deprecated Only for reading old 4.1 segments */ @Deprecated public class Lucene41Codec extends Codec { @@ -65,7 +58,6 @@ public class Lucene41Codec extends Codec { super("Lucene41"); } - // TODO: slightly evil @Override public StoredFieldsFormat storedFieldsFormat() { return fieldsFormat; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsFormat.java index aaf88a35af9..6001e71a70f 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsFormat.java @@ -30,6 +30,7 @@ import org.apache.lucene.store.IOContext; /** * Lucene 4.1 stored fields format. + * @deprecated only for reading old 4.x segments */ @Deprecated public class Lucene41StoredFieldsFormat extends StoredFieldsFormat { diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexReader.java index eac775b8284..b0b7ac88e32 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexReader.java @@ -34,7 +34,7 @@ import org.apache.lucene.util.RamUsageEstimator; import org.apache.lucene.util.packed.PackedInts; /** - * Random-access reader for {@code Lucene41CompressingStoredFieldsIndexWriter}. + * Reader for 4.x stored fields/term vectors index * @deprecated only for reading old segments */ @Deprecated diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene410/Lucene410Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene410/Lucene410Codec.java index 579f267b7a2..4464e66534a 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene410/Lucene410Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene410/Lucene410Codec.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; @@ -41,18 +40,10 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; import org.apache.lucene.index.SegmentWriteState; /** - * Implements the Lucene 4.10 index format, with configurable per-field postings - * and docvalues formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene410 package documentation for file format details. - * @lucene.experimental + * Implements the Lucene 4.10 codec + * @deprecated only for reading old 4.10 segments */ -// NOTE: if we make largish changes in a minor release, easier to just make Lucene411Codec or whatever -// if they are backwards compatible or smallish we can probably do the backwards in the postingsreader -// (it writes a minor version, etc). +@Deprecated public class Lucene410Codec extends Codec { private final StoredFieldsFormat fieldsFormat = new Lucene41StoredFieldsFormat(); private final TermVectorsFormat vectorsFormat = new Lucene42TermVectorsFormat(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42Codec.java index fedb63c9f31..a038121bcac 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42Codec.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; @@ -38,19 +37,9 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; import org.apache.lucene.index.SegmentWriteState; /** - * Implements the Lucene 4.2 index format, with configurable per-field postings - * and docvalues formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene42 package documentation for file format details. - * @lucene.experimental + * Implements the Lucene 4.2 index format * @deprecated Only for reading old 4.2 segments */ -// NOTE: if we make largish changes in a minor release, easier to just make Lucene43Codec or whatever -// if they are backwards compatible or smallish we can probably do the backwards in the postingsreader -// (it writes a minor version, etc). @Deprecated public class Lucene42Codec extends Codec { private final StoredFieldsFormat fieldsFormat = new Lucene41StoredFieldsFormat(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesFormat.java index 02e6001fd4b..fa2d5eeac77 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesFormat.java @@ -19,119 +19,22 @@ package org.apache.lucene.codecs.lucene42; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.store.DataOutput; -import org.apache.lucene.util.fst.FST; -import org.apache.lucene.util.packed.MonotonicBlockPackedWriter; import org.apache.lucene.util.packed.PackedInts; -import org.apache.lucene.util.packed.BlockPackedWriter; /** * Lucene 4.2 DocValues format. - *

- * Encodes the four per-document value types (Numeric,Binary,Sorted,SortedSet) with seven basic strategies. - *

- *

- *

- * Files: - *

    - *
  1. .dvd: DocValues data
  2. - *
  3. .dvm: DocValues metadata
  4. - *
- *
    - *
  1. - *

    The DocValues metadata or .dvm file.

    - *

    For DocValues field, this stores metadata, such as the offset into the - * DocValues data (.dvd)

    - *

    DocValues metadata (.dvm) --> Header,<FieldNumber,EntryType,Entry>NumFields,Footer

    - *
      - *
    • Entry --> NumericEntry | BinaryEntry | SortedEntry
    • - *
    • NumericEntry --> DataOffset,CompressionType,PackedVersion
    • - *
    • BinaryEntry --> DataOffset,DataLength,MinLength,MaxLength,PackedVersion?,BlockSize?
    • - *
    • SortedEntry --> DataOffset,ValueCount
    • - *
    • FieldNumber,PackedVersion,MinLength,MaxLength,BlockSize,ValueCount --> {@link DataOutput#writeVInt VInt}
    • - *
    • DataOffset,DataLength --> {@link DataOutput#writeLong Int64}
    • - *
    • EntryType,CompressionType --> {@link DataOutput#writeByte Byte}
    • - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • Footer --> {@link CodecUtil#writeFooter CodecFooter}
    • - *
    - *

    Sorted fields have two entries: a SortedEntry with the FST metadata, - * and an ordinary NumericEntry for the document-to-ord metadata.

    - *

    SortedSet fields have two entries: a SortedEntry with the FST metadata, - * and an ordinary BinaryEntry for the document-to-ord-list metadata.

    - *

    FieldNumber of -1 indicates the end of metadata.

    - *

    EntryType is a 0 (NumericEntry), 1 (BinaryEntry, or 2 (SortedEntry)

    - *

    DataOffset is the pointer to the start of the data in the DocValues data (.dvd)

    - *

    CompressionType indicates how Numeric values will be compressed: - *

      - *
    • 0 --> delta-compressed. For each block of 4096 integers, every integer is delta-encoded - * from the minimum value within the block. - *
    • 1 --> table-compressed. When the number of unique numeric values is small and it would save space, - * a lookup table of unique values is written, followed by the ordinal for each document. - *
    • 2 --> uncompressed. When the acceptableOverheadRatio parameter would upgrade the number - * of bits required to 8, and all values fit in a byte, these are written as absolute binary values - * for performance. - *
    • 3 -->, gcd-compressed. When all integers share a common divisor, only quotients are stored - * using blocks of delta-encoded ints. - *
    - *

    MinLength and MaxLength represent the min and max byte[] value lengths for Binary values. - * If they are equal, then all values are of a fixed size, and can be addressed as DataOffset + (docID * length). - * Otherwise, the binary values are of variable size, and packed integer metadata (PackedVersion,BlockSize) - * is written for the addresses. - *

  2. - *

    The DocValues data or .dvd file.

    - *

    For DocValues field, this stores the actual per-document data (the heavy-lifting)

    - *

    DocValues data (.dvd) --> Header,<NumericData | BinaryData | SortedData>NumFields,Footer

    - *
      - *
    • NumericData --> DeltaCompressedNumerics | TableCompressedNumerics | UncompressedNumerics | GCDCompressedNumerics
    • - *
    • BinaryData --> {@link DataOutput#writeByte Byte}DataLength,Addresses
    • - *
    • SortedData --> {@link FST FST<Int64>}
    • - *
    • DeltaCompressedNumerics --> {@link BlockPackedWriter BlockPackedInts(blockSize=4096)}
    • - *
    • TableCompressedNumerics --> TableSize,{@link DataOutput#writeLong Int64}TableSize,{@link PackedInts PackedInts}
    • - *
    • UncompressedNumerics --> {@link DataOutput#writeByte Byte}maxdoc
    • - *
    • Addresses --> {@link MonotonicBlockPackedWriter MonotonicBlockPackedInts(blockSize=4096)}
    • - *
    • Footer --> {@link CodecUtil#writeFooter CodecFooter}
    • - *
    - *

    SortedSet entries store the list of ordinals in their BinaryData as a - * sequences of increasing {@link DataOutput#writeVLong vLong}s, delta-encoded.

    - *
- *

- * Limitations: - *

* @deprecated Only for reading old 4.2 segments */ @Deprecated public class Lucene42DocValuesFormat extends DocValuesFormat { /** Maximum length for each binary doc values field. */ - public static final int MAX_BINARY_FIELD_LENGTH = (1 << 15) - 2; + static final int MAX_BINARY_FIELD_LENGTH = (1 << 15) - 2; final float acceptableOverheadRatio; @@ -162,7 +65,7 @@ public class Lucene42DocValuesFormat extends DocValuesFormat { } @Override - public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { + public final DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { return new Lucene42DocValuesProducer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesProducer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesProducer.java index 71f3c8e51fc..1adb5462efd 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesProducer.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42DocValuesProducer.java @@ -66,9 +66,11 @@ import org.apache.lucene.util.packed.MonotonicBlockPackedReader; import org.apache.lucene.util.packed.PackedInts; /** - * Reader for {@link Lucene42DocValuesFormat} + * Reader for 4.2 docvalues + * @deprecated only for reading old 4.x segments */ -class Lucene42DocValuesProducer extends DocValuesProducer { +@Deprecated +final class Lucene42DocValuesProducer extends DocValuesProducer { // metadata maps (just file pointers and minimal stuff) private final Map numerics; private final Map binaries; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosFormat.java index 5873bc0c4d5..588acecd1aa 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosFormat.java @@ -19,70 +19,12 @@ package org.apache.lucene.codecs.lucene42; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.FieldInfosFormat; import org.apache.lucene.codecs.FieldInfosReader; import org.apache.lucene.codecs.FieldInfosWriter; -import org.apache.lucene.index.FieldInfo.DocValuesType; // javadoc -import org.apache.lucene.store.DataOutput; // javadoc /** * Lucene 4.2 Field Infos format. - *

- *

Field names are stored in the field info file, with suffix .fnm.

- *

FieldInfos (.fnm) --> Header,FieldsCount, <FieldName,FieldNumber, - * FieldBits,DocValuesBits,Attributes> FieldsCount

- *

Data types: - *

    - *
  • Header --> {@link CodecUtil#checkHeader CodecHeader}
  • - *
  • FieldsCount --> {@link DataOutput#writeVInt VInt}
  • - *
  • FieldName --> {@link DataOutput#writeString String}
  • - *
  • FieldBits, DocValuesBits --> {@link DataOutput#writeByte Byte}
  • - *
  • FieldNumber --> {@link DataOutput#writeInt VInt}
  • - *
  • Attributes --> {@link DataOutput#writeStringStringMap Map<String,String>}
  • - *
- *

- * Field Descriptions: - *
    - *
  • FieldsCount: the number of fields in this file.
  • - *
  • FieldName: name of the field as a UTF-8 String.
  • - *
  • FieldNumber: the field's number. Note that unlike previous versions of - * Lucene, the fields are not numbered implicitly by their order in the - * file, instead explicitly.
  • - *
  • FieldBits: a byte containing field options. - *
      - *
    • The low-order bit is one for indexed fields, and zero for non-indexed - * fields.
    • - *
    • The second lowest-order bit is one for fields that have term vectors - * stored, and zero for fields without term vectors.
    • - *
    • If the third lowest order-bit is set (0x4), offsets are stored into - * the postings list in addition to positions.
    • - *
    • Fourth bit is unused.
    • - *
    • If the fifth lowest-order bit is set (0x10), norms are omitted for the - * indexed field.
    • - *
    • If the sixth lowest-order bit is set (0x20), payloads are stored for the - * indexed field.
    • - *
    • If the seventh lowest-order bit is set (0x40), term frequencies and - * positions omitted for the indexed field.
    • - *
    • If the eighth lowest-order bit is set (0x80), positions are omitted for the - * indexed field.
    • - *
    - *
  • - *
  • DocValuesBits: a byte containing per-document value types. The type - * recorded as two four-bit integers, with the high-order bits representing - * norms options, and the low-order bits representing - * {@code DocValues} options. Each four-bit integer can be decoded as such: - *
      - *
    • 0: no DocValues for this field.
    • - *
    • 1: NumericDocValues. ({@link DocValuesType#NUMERIC})
    • - *
    • 2: BinaryDocValues. ({@code DocValuesType#BINARY})
    • - *
    • 3: SortedDocValues. ({@code DocValuesType#SORTED})
    • - *
    - *
  • - *
  • Attributes: a key-value map of codec-private attributes.
  • - *
- * - * @lucene.experimental * @deprecated Only for reading old 4.2-4.5 segments */ @Deprecated @@ -94,7 +36,7 @@ public class Lucene42FieldInfosFormat extends FieldInfosFormat { } @Override - public FieldInfosReader getFieldInfosReader() throws IOException { + public final FieldInfosReader getFieldInfosReader() throws IOException { return reader; } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosReader.java index 935fa4cf2c5..140c30ddd43 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosReader.java @@ -38,9 +38,7 @@ import org.apache.lucene.util.IOUtils; /** * Lucene 4.2 FieldInfos reader. * - * @lucene.experimental * @deprecated Only for reading old 4.2-4.5 segments - * @see Lucene42FieldInfosFormat */ @Deprecated final class Lucene42FieldInfosReader extends FieldInfosReader { diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsFormat.java index 2c660751f93..b021eb58463 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsFormat.java @@ -19,8 +19,6 @@ package org.apache.lucene.codecs.lucene42; import java.io.IOException; -import org.apache.lucene.codecs.DocValuesConsumer; -import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.NormsProducer; @@ -30,19 +28,9 @@ import org.apache.lucene.util.packed.PackedInts; /** * Lucene 4.2 score normalization format. - *

- * NOTE: this uses the same format as {@link Lucene42DocValuesFormat} - * Numeric DocValues, but with different file extensions, and passing - * {@link PackedInts#FASTEST} for uncompressed encoding: trading off - * space for performance. - *

- * Files: - *

    - *
  • .nvd: DocValues data
  • - *
  • .nvm: DocValues metadata
  • - *
- * @see Lucene42DocValuesFormat + * @deprecated only for reading old 4.x segments */ +@Deprecated public class Lucene42NormsFormat extends NormsFormat { final float acceptableOverheadRatio; @@ -73,7 +61,7 @@ public class Lucene42NormsFormat extends NormsFormat { } @Override - public NormsProducer normsProducer(SegmentReadState state) throws IOException { + public final NormsProducer normsProducer(SegmentReadState state) throws IOException { return new Lucene42NormsProducer(state, DATA_CODEC, DATA_EXTENSION, METADATA_CODEC, METADATA_EXTENSION); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsProducer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsProducer.java index c550fb44ada..8e1a72ca37d 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsProducer.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42NormsProducer.java @@ -18,7 +18,6 @@ package org.apache.lucene.codecs.lucene42; */ import java.io.IOException; -import java.util.Collections; import org.apache.lucene.codecs.NormsProducer; import org.apache.lucene.index.FieldInfo; @@ -28,11 +27,10 @@ import org.apache.lucene.util.Accountable; /** * Reads 4.2-4.8 norms. - * Implemented the same as docvalues, but with a different filename. * @deprecated Only for reading old segments */ @Deprecated -class Lucene42NormsProducer extends NormsProducer { +final class Lucene42NormsProducer extends NormsProducer { private final Lucene42DocValuesProducer impl; Lucene42NormsProducer(SegmentReadState state, String dataCodec, String dataExtension, String metaCodec, String metaExtension) throws IOException { diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsReader.java index d2efe863091..5c16ff43b11 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsReader.java @@ -55,7 +55,7 @@ import org.apache.lucene.util.packed.BlockPackedReaderIterator; import org.apache.lucene.util.packed.PackedInts; /** - * {@link TermVectorsReader} for {@code Lucene42TermVectorsFormat}. + * 4.2 term vectors reader * @deprecated only for reading old segments */ @Deprecated diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45Codec.java index ffa5bd34e9f..bca26c00d94 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45Codec.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; @@ -41,19 +40,9 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; import org.apache.lucene.index.SegmentWriteState; /** - * Implements the Lucene 4.5 index format, with configurable per-field postings - * and docvalues formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene45 package documentation for file format details. - * @lucene.experimental + * Implements the Lucene 4.5 index format * @deprecated Only for reading old 4.3-4.5 segments */ -// NOTE: if we make largish changes in a minor release, easier to just make Lucene46Codec or whatever -// if they are backwards compatible or smallish we can probably do the backwards in the postingsreader -// (it writes a minor version, etc). @Deprecated public class Lucene45Codec extends Codec { private final StoredFieldsFormat fieldsFormat = new Lucene41StoredFieldsFormat(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesConsumer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesConsumer.java index 54e0af83012..3a7ace1c3e6 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesConsumer.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesConsumer.java @@ -39,7 +39,11 @@ import org.apache.lucene.util.packed.BlockPackedWriter; import org.apache.lucene.util.packed.MonotonicBlockPackedWriter; import org.apache.lucene.util.packed.PackedInts; -/** writer for {@link Lucene45DocValuesFormat} */ +/** + * writer for 4.5 docvalues format + * @deprecated only for old 4.x segments + */ +@Deprecated class Lucene45DocValuesConsumer extends DocValuesConsumer implements Closeable { static final int BLOCK_SIZE = 16384; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesFormat.java index 04b482136a5..e717d4457c3 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesFormat.java @@ -19,148 +19,15 @@ package org.apache.lucene.codecs.lucene45; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.index.FieldInfo.DocValuesType; -import org.apache.lucene.store.DataOutput; -import org.apache.lucene.util.SmallFloat; -import org.apache.lucene.util.fst.FST; -import org.apache.lucene.util.packed.BlockPackedWriter; -import org.apache.lucene.util.packed.MonotonicBlockPackedWriter; -import org.apache.lucene.util.packed.PackedInts; /** * Lucene 4.5 DocValues format. - *

- * Encodes the four per-document value types (Numeric,Binary,Sorted,SortedSet) with these strategies: - *

- * {@link DocValuesType#NUMERIC NUMERIC}: - *

    - *
  • Delta-compressed: per-document integers written in blocks of 16k. For each block - * the minimum value in that block is encoded, and each entry is a delta from that - * minimum value. Each block of deltas is compressed with bitpacking. For more - * information, see {@link BlockPackedWriter}. - *
  • Table-compressed: when the number of unique values is very small (< 256), and - * when there are unused "gaps" in the range of values used (such as {@link SmallFloat}), - * a lookup table is written instead. Each per-document entry is instead the ordinal - * to this table, and those ordinals are compressed with bitpacking ({@link PackedInts}). - *
  • GCD-compressed: when all numbers share a common divisor, such as dates, the greatest - * common denominator (GCD) is computed, and quotients are stored using Delta-compressed Numerics. - *
- *

- * {@link DocValuesType#BINARY BINARY}: - *

    - *
  • Fixed-width Binary: one large concatenated byte[] is written, along with the fixed length. - * Each document's value can be addressed directly with multiplication ({@code docID * length}). - *
  • Variable-width Binary: one large concatenated byte[] is written, along with end addresses - * for each document. The addresses are written in blocks of 16k, with the current absolute - * start for the block, and the average (expected) delta per entry. For each document the - * deviation from the delta (actual - expected) is written. - *
  • Prefix-compressed Binary: values are written in chunks of 16, with the first value written - * completely and other values sharing prefixes. chunk addresses are written in blocks of 16k, - * with the current absolute start for the block, and the average (expected) delta per entry. - * For each chunk the deviation from the delta (actual - expected) is written. - *
- *

- * {@link DocValuesType#SORTED SORTED}: - *

    - *
  • Sorted: a mapping of ordinals to deduplicated terms is written as Prefix-Compressed Binary, - * along with the per-document ordinals written using one of the numeric strategies above. - *
- *

- * {@link DocValuesType#SORTED_SET SORTED_SET}: - *

    - *
  • SortedSet: a mapping of ordinals to deduplicated terms is written as Prefix-Compressed Binary, - * an ordinal list and per-document index into this list are written using the numeric strategies - * above. - *
- *

- * Files: - *

    - *
  1. .dvd: DocValues data
  2. - *
  3. .dvm: DocValues metadata
  4. - *
- *
    - *
  1. - *

    The DocValues metadata or .dvm file.

    - *

    For DocValues field, this stores metadata, such as the offset into the - * DocValues data (.dvd)

    - *

    DocValues metadata (.dvm) --> Header,<Entry>NumFields,Footer

    - *
      - *
    • Entry --> NumericEntry | BinaryEntry | SortedEntry | SortedSetEntry
    • - *
    • NumericEntry --> GCDNumericEntry | TableNumericEntry | DeltaNumericEntry
    • - *
    • GCDNumericEntry --> NumericHeader,MinValue,GCD
    • - *
    • TableNumericEntry --> NumericHeader,TableSize,{@link DataOutput#writeLong Int64}TableSize
    • - *
    • DeltaNumericEntry --> NumericHeader
    • - *
    • NumericHeader --> FieldNumber,EntryType,NumericType,MissingOffset,PackedVersion,DataOffset,Count,BlockSize
    • - *
    • BinaryEntry --> FixedBinaryEntry | VariableBinaryEntry | PrefixBinaryEntry
    • - *
    • FixedBinaryEntry --> BinaryHeader
    • - *
    • VariableBinaryEntry --> BinaryHeader,AddressOffset,PackedVersion,BlockSize
    • - *
    • PrefixBinaryEntry --> BinaryHeader,AddressInterval,AddressOffset,PackedVersion,BlockSize
    • - *
    • BinaryHeader --> FieldNumber,EntryType,BinaryType,MissingOffset,MinLength,MaxLength,DataOffset
    • - *
    • SortedEntry --> FieldNumber,EntryType,BinaryEntry,NumericEntry
    • - *
    • SortedSetEntry --> EntryType,BinaryEntry,NumericEntry,NumericEntry
    • - *
    • FieldNumber,PackedVersion,MinLength,MaxLength,BlockSize,ValueCount --> {@link DataOutput#writeVInt VInt}
    • - *
    • EntryType,CompressionType --> {@link DataOutput#writeByte Byte}
    • - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • MinValue,GCD,MissingOffset,AddressOffset,DataOffset --> {@link DataOutput#writeLong Int64}
    • - *
    • TableSize --> {@link DataOutput#writeVInt vInt}
    • - *
    • Footer --> {@link CodecUtil#writeFooter CodecFooter}
    • - *
    - *

    Sorted fields have two entries: a BinaryEntry with the value metadata, - * and an ordinary NumericEntry for the document-to-ord metadata.

    - *

    SortedSet fields have three entries: a BinaryEntry with the value metadata, - * and two NumericEntries for the document-to-ord-index and ordinal list metadata.

    - *

    FieldNumber of -1 indicates the end of metadata.

    - *

    EntryType is a 0 (NumericEntry) or 1 (BinaryEntry)

    - *

    DataOffset is the pointer to the start of the data in the DocValues data (.dvd)

    - *

    NumericType indicates how Numeric values will be compressed: - *

      - *
    • 0 --> delta-compressed. For each block of 16k integers, every integer is delta-encoded - * from the minimum value within the block. - *
    • 1 -->, gcd-compressed. When all integers share a common divisor, only quotients are stored - * using blocks of delta-encoded ints. - *
    • 2 --> table-compressed. When the number of unique numeric values is small and it would save space, - * a lookup table of unique values is written, followed by the ordinal for each document. - *
    - *

    BinaryType indicates how Binary values will be stored: - *

      - *
    • 0 --> fixed-width. All values have the same length, addressing by multiplication. - *
    • 1 -->, variable-width. An address for each value is stored. - *
    • 2 --> prefix-compressed. An address to the start of every interval'th value is stored. - *
    - *

    MinLength and MaxLength represent the min and max byte[] value lengths for Binary values. - * If they are equal, then all values are of a fixed size, and can be addressed as DataOffset + (docID * length). - * Otherwise, the binary values are of variable size, and packed integer metadata (PackedVersion,BlockSize) - * is written for the addresses. - *

    MissingOffset points to a byte[] containing a bitset of all documents that had a value for the field. - * If its -1, then there are no missing values. - *

    Checksum contains the CRC32 checksum of all bytes in the .dvm file up - * until the checksum. This is used to verify integrity of the file on opening the - * index. - *

  2. - *

    The DocValues data or .dvd file.

    - *

    For DocValues field, this stores the actual per-document data (the heavy-lifting)

    - *

    DocValues data (.dvd) --> Header,<NumericData | BinaryData | SortedData>NumFields,Footer

    - *
      - *
    • NumericData --> DeltaCompressedNumerics | TableCompressedNumerics | GCDCompressedNumerics
    • - *
    • BinaryData --> {@link DataOutput#writeByte Byte}DataLength,Addresses
    • - *
    • SortedData --> {@link FST FST<Int64>}
    • - *
    • DeltaCompressedNumerics --> {@link BlockPackedWriter BlockPackedInts(blockSize=16k)}
    • - *
    • TableCompressedNumerics --> {@link PackedInts PackedInts}
    • - *
    • GCDCompressedNumerics --> {@link BlockPackedWriter BlockPackedInts(blockSize=16k)}
    • - *
    • Addresses --> {@link MonotonicBlockPackedWriter MonotonicBlockPackedInts(blockSize=16k)}
    • - *
    • Footer --> {@link CodecUtil#writeFooter CodecFooter}
    • - *
    - *

    SortedSet entries store the list of ordinals in their BinaryData as a - * sequences of increasing {@link DataOutput#writeVLong vLong}s, delta-encoded.

    - *
* @deprecated Only for reading old 4.3-4.5 segments - * @lucene.experimental */ @Deprecated public class Lucene45DocValuesFormat extends DocValuesFormat { @@ -177,7 +44,7 @@ public class Lucene45DocValuesFormat extends DocValuesFormat { } @Override - public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { + public final DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { return new Lucene45DocValuesProducer(state, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesProducer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesProducer.java index 20b06582bb0..51135a72519 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesProducer.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene45/Lucene45DocValuesProducer.java @@ -63,13 +63,16 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.LongValues; import org.apache.lucene.util.RamUsageEstimator; -import org.apache.lucene.util.StringHelper; import org.apache.lucene.util.Version; import org.apache.lucene.util.packed.BlockPackedReader; import org.apache.lucene.util.packed.MonotonicBlockPackedReader; import org.apache.lucene.util.packed.PackedInts; -/** reader for {@link Lucene45DocValuesFormat} */ +/** + * reader for 4.5 docvalues format + * @deprecated only for reading old 4.x segments + */ +@Deprecated class Lucene45DocValuesProducer extends DocValuesProducer implements Closeable { private final Map numerics; private final Map binaries; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46Codec.java index 8cd411495ec..7f1e6353571 100755 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46Codec.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; @@ -39,19 +38,9 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; import org.apache.lucene.index.SegmentWriteState; /** - * Implements the Lucene 4.6 index format, with configurable per-field postings - * and docvalues formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene46 package documentation for file format details. - * @lucene.experimental + * Implements the Lucene 4.6 index format * @deprecated Only for reading old 4.6-4.8 segments */ -// NOTE: if we make largish changes in a minor release, easier to just make Lucene46Codec or whatever -// if they are backwards compatible or smallish we can probably do the backwards in the postingsreader -// (it writes a minor version, etc). @Deprecated public class Lucene46Codec extends Codec { private final StoredFieldsFormat fieldsFormat = new Lucene41StoredFieldsFormat(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosFormat.java index 809aac84fed..0f78c7d70e2 100755 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosFormat.java @@ -19,77 +19,15 @@ package org.apache.lucene.codecs.lucene46; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; -import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FieldInfosFormat; import org.apache.lucene.codecs.FieldInfosReader; import org.apache.lucene.codecs.FieldInfosWriter; -import org.apache.lucene.index.FieldInfo.DocValuesType; -import org.apache.lucene.store.DataOutput; /** * Lucene 4.6 Field Infos format. - *

- *

Field names are stored in the field info file, with suffix .fnm.

- *

FieldInfos (.fnm) --> Header,FieldsCount, <FieldName,FieldNumber, - * FieldBits,DocValuesBits,DocValuesGen,Attributes> FieldsCount,Footer

- *

Data types: - *

    - *
  • Header --> {@link CodecUtil#checkHeader CodecHeader}
  • - *
  • FieldsCount --> {@link DataOutput#writeVInt VInt}
  • - *
  • FieldName --> {@link DataOutput#writeString String}
  • - *
  • FieldBits, DocValuesBits --> {@link DataOutput#writeByte Byte}
  • - *
  • FieldNumber --> {@link DataOutput#writeInt VInt}
  • - *
  • Attributes --> {@link DataOutput#writeStringStringMap Map<String,String>}
  • - *
  • DocValuesGen --> {@link DataOutput#writeLong(long) Int64}
  • - *
  • Footer --> {@link CodecUtil#writeFooter CodecFooter}
  • - *
- *

- * Field Descriptions: - *
    - *
  • FieldsCount: the number of fields in this file.
  • - *
  • FieldName: name of the field as a UTF-8 String.
  • - *
  • FieldNumber: the field's number. Note that unlike previous versions of - * Lucene, the fields are not numbered implicitly by their order in the - * file, instead explicitly.
  • - *
  • FieldBits: a byte containing field options. - *
      - *
    • The low-order bit is one for indexed fields, and zero for non-indexed - * fields.
    • - *
    • The second lowest-order bit is one for fields that have term vectors - * stored, and zero for fields without term vectors.
    • - *
    • If the third lowest order-bit is set (0x4), offsets are stored into - * the postings list in addition to positions.
    • - *
    • Fourth bit is unused.
    • - *
    • If the fifth lowest-order bit is set (0x10), norms are omitted for the - * indexed field.
    • - *
    • If the sixth lowest-order bit is set (0x20), payloads are stored for the - * indexed field.
    • - *
    • If the seventh lowest-order bit is set (0x40), term frequencies and - * positions omitted for the indexed field.
    • - *
    • If the eighth lowest-order bit is set (0x80), positions are omitted for the - * indexed field.
    • - *
    - *
  • - *
  • DocValuesBits: a byte containing per-document value types. The type - * recorded as two four-bit integers, with the high-order bits representing - * norms options, and the low-order bits representing - * {@code DocValues} options. Each four-bit integer can be decoded as such: - *
      - *
    • 0: no DocValues for this field.
    • - *
    • 1: NumericDocValues. ({@link DocValuesType#NUMERIC})
    • - *
    • 2: BinaryDocValues. ({@code DocValuesType#BINARY})
    • - *
    • 3: SortedDocValues. ({@code DocValuesType#SORTED})
    • - *
    - *
  • - *
  • DocValuesGen is the generation count of the field's DocValues. If this is -1, - * there are no DocValues updates to that field. Anything above zero means there - * are updates stored by {@link DocValuesFormat}.
  • - *
  • Attributes: a key-value map of codec-private attributes.
  • - *
- * - * @lucene.experimental + * @deprecated only for old 4.x segments */ +@Deprecated public final class Lucene46FieldInfosFormat extends FieldInfosFormat { private final FieldInfosReader reader = new Lucene46FieldInfosReader(); private final FieldInfosWriter writer = new Lucene46FieldInfosWriter(); @@ -99,7 +37,7 @@ public final class Lucene46FieldInfosFormat extends FieldInfosFormat { } @Override - public FieldInfosReader getFieldInfosReader() throws IOException { + public final FieldInfosReader getFieldInfosReader() throws IOException { return reader; } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosReader.java index ef3babfc300..8f1827019eb 100755 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosReader.java @@ -38,9 +38,9 @@ import org.apache.lucene.store.IndexInput; /** * Lucene 4.6 FieldInfos reader. * - * @lucene.experimental - * @see Lucene46FieldInfosFormat + * @deprecated only for old 4.x segments */ +@Deprecated final class Lucene46FieldInfosReader extends FieldInfosReader { /** Sole constructor. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosWriter.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosWriter.java index a0b01d5488d..e511da4543b 100755 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosWriter.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46FieldInfosWriter.java @@ -34,9 +34,9 @@ import org.apache.lucene.store.IOContext; /** * Lucene 4.6 FieldInfos writer. * - * @see Lucene46FieldInfosFormat - * @lucene.experimental + * @deprecated only for old 4.x segments */ +@Deprecated final class Lucene46FieldInfosWriter extends FieldInfosWriter { /** Sole constructor. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoFormat.java index a8e4586779c..6a553c053f1 100755 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoFormat.java @@ -17,54 +17,16 @@ package org.apache.lucene.codecs.lucene46; * limitations under the License. */ -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.SegmentInfoFormat; import org.apache.lucene.codecs.SegmentInfoReader; import org.apache.lucene.codecs.SegmentInfoWriter; -import org.apache.lucene.index.IndexWriter; // javadocs -import org.apache.lucene.index.SegmentInfo; // javadocs -import org.apache.lucene.index.SegmentInfos; // javadocs -import org.apache.lucene.store.DataOutput; // javadocs +import org.apache.lucene.index.SegmentInfo; /** * Lucene 4.6 Segment info format. - *

- * Files: - *

    - *
  • .si: Header, SegVersion, SegSize, IsCompoundFile, Diagnostics, Files, Footer - *
- *

- * Data types: - *

- *

    - *
  • Header --> {@link CodecUtil#writeHeader CodecHeader}
  • - *
  • SegSize --> {@link DataOutput#writeInt Int32}
  • - *
  • SegVersion --> {@link DataOutput#writeString String}
  • - *
  • Files --> {@link DataOutput#writeStringSet Set<String>}
  • - *
  • Diagnostics --> {@link DataOutput#writeStringStringMap Map<String,String>}
  • - *
  • IsCompoundFile --> {@link DataOutput#writeByte Int8}
  • - *
  • Footer --> {@link CodecUtil#writeFooter CodecFooter}
  • - *
- *

- * Field Descriptions: - *

- *

    - *
  • SegVersion is the code version that created the segment.
  • - *
  • SegSize is the number of documents contained in the segment index.
  • - *
  • IsCompoundFile records whether the segment is written as a compound file or - * not. If this is -1, the segment is not a compound file. If it is 1, the segment - * is a compound file.
  • - *
  • The Diagnostics Map is privately written by {@link IndexWriter}, as a debugging aid, - * for each segment it creates. It includes metadata like the current Lucene - * version, OS, Java version, why the segment was created (merge, flush, - * addIndexes), etc.
  • - *
  • Files is a list of files referred to by this segment.
  • - *
- *

- * - * @see SegmentInfos - * @lucene.experimental + * @deprecated only for old 4.x segments */ +@Deprecated public class Lucene46SegmentInfoFormat extends SegmentInfoFormat { private final SegmentInfoReader reader = new Lucene46SegmentInfoReader(); @@ -73,7 +35,7 @@ public class Lucene46SegmentInfoFormat extends SegmentInfoFormat { } @Override - public SegmentInfoReader getSegmentInfoReader() { + public final SegmentInfoReader getSegmentInfoReader() { return reader; } @@ -83,7 +45,7 @@ public class Lucene46SegmentInfoFormat extends SegmentInfoFormat { } /** File extension used to store {@link SegmentInfo}. */ - public final static String SI_EXTENSION = "si"; + final static String SI_EXTENSION = "si"; static final String CODEC_NAME = "Lucene46SegmentInfo"; static final int VERSION_START = 0; static final int VERSION_CHECKSUM = 1; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoReader.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoReader.java index b205644272f..9faeb8a5af7 100755 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoReader.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoReader.java @@ -33,12 +33,11 @@ import org.apache.lucene.store.IOContext; import org.apache.lucene.util.Version; /** - * Lucene 4.6 implementation of {@link SegmentInfoReader}. - * - * @see Lucene46SegmentInfoFormat - * @lucene.experimental + * Lucene 4.6 segment infos reader + * @deprecated only for old 4.x segments */ -public class Lucene46SegmentInfoReader extends SegmentInfoReader { +@Deprecated +final class Lucene46SegmentInfoReader extends SegmentInfoReader { /** Sole constructor. */ public Lucene46SegmentInfoReader() { diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49Codec.java index f42406abdf2..7c87519f14c 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49Codec.java @@ -22,7 +22,6 @@ import java.io.IOException; import org.apache.lucene.codecs.Codec; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.FieldInfosFormat; -import org.apache.lucene.codecs.FilterCodec; import org.apache.lucene.codecs.LiveDocsFormat; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.codecs.NormsFormat; @@ -40,18 +39,10 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; import org.apache.lucene.index.SegmentWriteState; /** - * Implements the Lucene 4.9 index format, with configurable per-field postings - * and docvalues formats. - *

- * If you want to reuse functionality of this codec in another codec, extend - * {@link FilterCodec}. - * - * @see org.apache.lucene.codecs.lucene49 package documentation for file format details. - * @lucene.experimental + * Implements the Lucene 4.9 index format + * @deprecated only for old 4.x segments */ -// NOTE: if we make largish changes in a minor release, easier to just make Lucene410Codec or whatever -// if they are backwards compatible or smallish we can probably do the backwards in the postingsreader -// (it writes a minor version, etc). +@Deprecated public class Lucene49Codec extends Codec { private final StoredFieldsFormat fieldsFormat = new Lucene41StoredFieldsFormat(); private final TermVectorsFormat vectorsFormat = new Lucene42TermVectorsFormat(); diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesConsumer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesConsumer.java index 416f0702558..9fbc7199171 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesConsumer.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesConsumer.java @@ -40,7 +40,11 @@ import org.apache.lucene.util.packed.DirectWriter; import org.apache.lucene.util.packed.MonotonicBlockPackedWriter; import org.apache.lucene.util.packed.PackedInts; -/** writer for {@link Lucene49DocValuesFormat} */ +/** + * writer for 4.9 docvalues format + * @deprecated only for old 4.x segments + */ +@Deprecated class Lucene49DocValuesConsumer extends DocValuesConsumer implements Closeable { static final int BLOCK_SIZE = 16384; diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesFormat.java index 281c0f286da..1108b2ad0ce 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesFormat.java @@ -19,151 +19,17 @@ package org.apache.lucene.codecs.lucene49; import java.io.IOException; -import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.DocValuesProducer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.index.SegmentReadState; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.index.FieldInfo.DocValuesType; -import org.apache.lucene.store.DataOutput; -import org.apache.lucene.util.SmallFloat; -import org.apache.lucene.util.fst.FST; -import org.apache.lucene.util.packed.DirectWriter; -import org.apache.lucene.util.packed.MonotonicBlockPackedWriter; /** * Lucene 4.9 DocValues format. - *

- * Encodes the five per-document value types (Numeric,Binary,Sorted,SortedSet,SortedNumeric) with these strategies: - *

- * {@link DocValuesType#NUMERIC NUMERIC}: - *

    - *
  • Delta-compressed: per-document integers written as deltas from the minimum value, - * compressed with bitpacking. For more information, see {@link DirectWriter}. - *
  • Table-compressed: when the number of unique values is very small (< 256), and - * when there are unused "gaps" in the range of values used (such as {@link SmallFloat}), - * a lookup table is written instead. Each per-document entry is instead the ordinal - * to this table, and those ordinals are compressed with bitpacking ({@link DirectWriter}). - *
  • GCD-compressed: when all numbers share a common divisor, such as dates, the greatest - * common denominator (GCD) is computed, and quotients are stored using Delta-compressed Numerics. - *
  • Monotonic-compressed: when all numbers are monotonically increasing offsets, they are written - * as blocks of bitpacked integers, encoding the deviation from the expected delta. - *
- *

- * {@link DocValuesType#BINARY BINARY}: - *

    - *
  • Fixed-width Binary: one large concatenated byte[] is written, along with the fixed length. - * Each document's value can be addressed directly with multiplication ({@code docID * length}). - *
  • Variable-width Binary: one large concatenated byte[] is written, along with end addresses - * for each document. The addresses are written as Monotonic-compressed numerics. - *
  • Prefix-compressed Binary: values are written in chunks of 16, with the first value written - * completely and other values sharing prefixes. chunk addresses are written as Monotonic-compressed - * numerics. - *
- *

- * {@link DocValuesType#SORTED SORTED}: - *

    - *
  • Sorted: a mapping of ordinals to deduplicated terms is written as Prefix-Compressed Binary, - * along with the per-document ordinals written using one of the numeric strategies above. - *
- *

- * {@link DocValuesType#SORTED_SET SORTED_SET}: - *

    - *
  • SortedSet: a mapping of ordinals to deduplicated terms is written as Prefix-Compressed Binary, - * an ordinal list and per-document index into this list are written using the numeric strategies - * above. - *
- *

- * {@link DocValuesType#SORTED_NUMERIC SORTED_NUMERIC}: - *

    - *
  • SortedNumeric: a value list and per-document index into this list are written using the numeric - * strategies above. - *
- *

- * Files: - *

    - *
  1. .dvd: DocValues data
  2. - *
  3. .dvm: DocValues metadata
  4. - *
- *
    - *
  1. - *

    The DocValues metadata or .dvm file.

    - *

    For DocValues field, this stores metadata, such as the offset into the - * DocValues data (.dvd)

    - *

    DocValues metadata (.dvm) --> Header,<Entry>NumFields,Footer

    - *
      - *
    • Entry --> NumericEntry | BinaryEntry | SortedEntry | SortedSetEntry | SortedNumericEntry
    • - *
    • NumericEntry --> GCDNumericEntry | TableNumericEntry | DeltaNumericEntry
    • - *
    • GCDNumericEntry --> NumericHeader,MinValue,GCD,BitsPerValue
    • - *
    • TableNumericEntry --> NumericHeader,TableSize,{@link DataOutput#writeLong Int64}TableSize,BitsPerValue
    • - *
    • DeltaNumericEntry --> NumericHeader,MinValue,BitsPerValue
    • - *
    • MonotonicNumericEntry --> NumericHeader,PackedVersion,BlockSize
    • - *
    • NumericHeader --> FieldNumber,EntryType,NumericType,MissingOffset,DataOffset,Count,EndOffset
    • - *
    • BinaryEntry --> FixedBinaryEntry | VariableBinaryEntry | PrefixBinaryEntry
    • - *
    • FixedBinaryEntry --> BinaryHeader
    • - *
    • VariableBinaryEntry --> BinaryHeader,AddressOffset,PackedVersion,BlockSize
    • - *
    • PrefixBinaryEntry --> BinaryHeader,AddressInterval,AddressOffset,PackedVersion,BlockSize
    • - *
    • BinaryHeader --> FieldNumber,EntryType,BinaryType,MissingOffset,MinLength,MaxLength,DataOffset
    • - *
    • SortedEntry --> FieldNumber,EntryType,BinaryEntry,NumericEntry
    • - *
    • SortedSetEntry --> EntryType,BinaryEntry,NumericEntry,NumericEntry
    • - *
    • SortedNumericEntry --> EntryType,NumericEntry,NumericEntry
    • - *
    • FieldNumber,PackedVersion,MinLength,MaxLength,BlockSize,ValueCount --> {@link DataOutput#writeVInt VInt}
    • - *
    • EntryType,CompressionType --> {@link DataOutput#writeByte Byte}
    • - *
    • Header --> {@link CodecUtil#writeHeader CodecHeader}
    • - *
    • MinValue,GCD,MissingOffset,AddressOffset,DataOffset,EndOffset --> {@link DataOutput#writeLong Int64}
    • - *
    • TableSize,BitsPerValue --> {@link DataOutput#writeVInt vInt}
    • - *
    • Footer --> {@link CodecUtil#writeFooter CodecFooter}
    • - *
    - *

    Sorted fields have two entries: a BinaryEntry with the value metadata, - * and an ordinary NumericEntry for the document-to-ord metadata.

    - *

    SortedSet fields have three entries: a BinaryEntry with the value metadata, - * and two NumericEntries for the document-to-ord-index and ordinal list metadata.

    - *

    SortedNumeric fields have two entries: A NumericEntry with the value metadata, - * and a numeric entry with the document-to-value index.

    - *

    FieldNumber of -1 indicates the end of metadata.

    - *

    EntryType is a 0 (NumericEntry) or 1 (BinaryEntry)

    - *

    DataOffset is the pointer to the start of the data in the DocValues data (.dvd)

    - *

    EndOffset is the pointer to the end of the data in the DocValues data (.dvd)

    - *

    NumericType indicates how Numeric values will be compressed: - *

      - *
    • 0 --> delta-compressed. For each block of 16k integers, every integer is delta-encoded - * from the minimum value within the block. - *
    • 1 -->, gcd-compressed. When all integers share a common divisor, only quotients are stored - * using blocks of delta-encoded ints. - *
    • 2 --> table-compressed. When the number of unique numeric values is small and it would save space, - * a lookup table of unique values is written, followed by the ordinal for each document. - *
    - *

    BinaryType indicates how Binary values will be stored: - *

      - *
    • 0 --> fixed-width. All values have the same length, addressing by multiplication. - *
    • 1 -->, variable-width. An address for each value is stored. - *
    • 2 --> prefix-compressed. An address to the start of every interval'th value is stored. - *
    - *

    MinLength and MaxLength represent the min and max byte[] value lengths for Binary values. - * If they are equal, then all values are of a fixed size, and can be addressed as DataOffset + (docID * length). - * Otherwise, the binary values are of variable size, and packed integer metadata (PackedVersion,BlockSize) - * is written for the addresses. - *

    MissingOffset points to a byte[] containing a bitset of all documents that had a value for the field. - * If its -1, then there are no missing values. - *

    Checksum contains the CRC32 checksum of all bytes in the .dvm file up - * until the checksum. This is used to verify integrity of the file on opening the - * index. - *

  2. - *

    The DocValues data or .dvd file.

    - *

    For DocValues field, this stores the actual per-document data (the heavy-lifting)

    - *

    DocValues data (.dvd) --> Header,<NumericData | BinaryData | SortedData>NumFields,Footer

    - *
      - *
    • NumericData --> DeltaCompressedNumerics | TableCompressedNumerics | GCDCompressedNumerics
    • - *
    • BinaryData --> {@link DataOutput#writeByte Byte}DataLength,Addresses
    • - *
    • SortedData --> {@link FST FST<Int64>}
    • - *
    • DeltaCompressedNumerics,TableCompressedNumerics,GCDCompressedNumerics --> {@link DirectWriter PackedInts}
    • - *
    • Addresses --> {@link MonotonicBlockPackedWriter MonotonicBlockPackedInts(blockSize=16k)}
    • - *
    • Footer --> {@link CodecUtil#writeFooter CodecFooter}
    • - *
    - *
- * @lucene.experimental + * @deprecated only for old 4.x segments */ +@Deprecated public class Lucene49DocValuesFormat extends DocValuesFormat { /** Sole Constructor */ @@ -177,7 +43,7 @@ public class Lucene49DocValuesFormat extends DocValuesFormat { } @Override - public DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { + public final DocValuesProducer fieldsProducer(SegmentReadState state) throws IOException { return new Lucene49DocValuesProducer(state, DATA_CODEC, DATA_EXTENSION, META_CODEC, META_EXTENSION); } diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesProducer.java b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesProducer.java index e6bb2e373aa..c1e90dda2f6 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesProducer.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/codecs/lucene49/Lucene49DocValuesProducer.java @@ -67,7 +67,11 @@ import org.apache.lucene.util.RamUsageEstimator; import org.apache.lucene.util.packed.DirectReader; import org.apache.lucene.util.packed.MonotonicBlockPackedReader; -/** reader for {@link Lucene49DocValuesFormat} */ +/** + * reader for 4.9 docvalues format + * @deprecated only for 4.x segments + */ +@Deprecated class Lucene49DocValuesProducer extends DocValuesProducer implements Closeable { private final Map numerics; private final Map binaries; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40DocValuesWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40DocValuesWriter.java index 67dccf6c965..fa2b2d8a02c 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40DocValuesWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40DocValuesWriter.java @@ -26,7 +26,6 @@ import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.codecs.MissingOrdRemapper; import org.apache.lucene.codecs.lucene40.Lucene40FieldInfosReader.LegacyDocValuesType; -import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentWriteState; @@ -37,7 +36,12 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.packed.PackedInts; -class Lucene40DocValuesWriter extends DocValuesConsumer { +/** + * Writer for 4.0 docvalues format + * @deprecated for test purposes only + */ +@Deprecated +final class Lucene40DocValuesWriter extends DocValuesConsumer { private final Directory dir; private final SegmentWriteState state; private final String legacyKey; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosWriter.java index e773604c593..26190c72f1a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40FieldInfosWriter.java @@ -33,13 +33,11 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.IOUtils; /** - * Lucene 4.0 FieldInfos writer. - * - * @see Lucene40FieldInfosFormat - * @lucene.experimental + * Writer for 4.0 fieldinfos format + * @deprecated for test purposes only */ @Deprecated -public class Lucene40FieldInfosWriter extends FieldInfosWriter { +public final class Lucene40FieldInfosWriter extends FieldInfosWriter { /** Sole constructor. */ public Lucene40FieldInfosWriter() { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java index 76fe57c2d4e..cff96cf38bf 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40PostingsWriter.java @@ -37,12 +37,11 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; /** - * Concrete class that writes the 4.0 frq/prx postings format. - * - * @see Lucene40PostingsFormat - * @lucene.experimental + * Writer for 4.0 postings format + * @deprecated for test purposes only */ -public final class Lucene40PostingsWriter extends PushPostingsWriterBase { +@Deprecated +final class Lucene40PostingsWriter extends PushPostingsWriterBase { final IndexOutput freqOut; final IndexOutput proxOut; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWCodec.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWCodec.java index d819224e5d8..6e4dff11403 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWCodec.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWCodec.java @@ -28,8 +28,11 @@ import org.apache.lucene.codecs.TermVectorsFormat; * limitations under the License. */ -/** Read-write version of Lucene40Codec for testing */ -@SuppressWarnings("deprecation") +/** + * Read-write version of 4.0 codec for testing + * @deprecated for test purposes only + */ +@Deprecated public final class Lucene40RWCodec extends Lucene40Codec { private final FieldInfosFormat fieldInfos = new Lucene40FieldInfosFormat() { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWDocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWDocValuesFormat.java index b4b919fdde6..fcc86b0da3e 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWDocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWDocValuesFormat.java @@ -23,9 +23,12 @@ import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentWriteState; -/** Read-write version of {@link Lucene40DocValuesFormat} for testing */ -@SuppressWarnings("deprecation") -public class Lucene40RWDocValuesFormat extends Lucene40DocValuesFormat { +/** + * Read-write version of 4.0 docvalues format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene40RWDocValuesFormat extends Lucene40DocValuesFormat { @Override public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWNormsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWNormsFormat.java index 227aeaba330..2dc34520892 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWNormsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWNormsFormat.java @@ -24,9 +24,12 @@ import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.IndexFileNames; import org.apache.lucene.index.SegmentWriteState; -/** Read-write version of {@link Lucene40NormsFormat} for testing */ -@SuppressWarnings("deprecation") -public class Lucene40RWNormsFormat extends Lucene40NormsFormat { +/** + * Read-write version of 4.0 norms format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene40RWNormsFormat extends Lucene40NormsFormat { @Override public NormsConsumer normsConsumer(SegmentWriteState state) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWPostingsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWPostingsFormat.java index c0baaf654fc..965b1bf8d3e 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWPostingsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWPostingsFormat.java @@ -23,14 +23,19 @@ import org.apache.lucene.codecs.FieldsConsumer; import org.apache.lucene.codecs.PostingsWriterBase; import org.apache.lucene.codecs.blocktree.BlockTreeTermsWriter; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.LuceneTestCase; /** - * Read-write version of {@link Lucene40PostingsFormat} for testing. + * Read-write version of 4.0 postings format for testing + * @deprecated for test purposes only */ -@SuppressWarnings("deprecation") -public class Lucene40RWPostingsFormat extends Lucene40PostingsFormat { +@Deprecated +public final class Lucene40RWPostingsFormat extends Lucene40PostingsFormat { + /** minimum items (terms or sub-blocks) per block for 4.0 BlockTree */ + final static int MIN_BLOCK_SIZE = 25; + /** maximum items (terms or sub-blocks) per block for 4.0 BlockTree */ + final static int MAX_BLOCK_SIZE = 48; + @Override public FieldsConsumer fieldsConsumer(SegmentWriteState state) throws IOException { PostingsWriterBase docs = new Lucene40PostingsWriter(state); @@ -41,7 +46,7 @@ public class Lucene40RWPostingsFormat extends Lucene40PostingsFormat { // Or... you must make a new Codec for this? boolean success = false; try { - FieldsConsumer ret = new BlockTreeTermsWriter(state, docs, minBlockSize, maxBlockSize); + FieldsConsumer ret = new BlockTreeTermsWriter(state, docs, MIN_BLOCK_SIZE, MAX_BLOCK_SIZE); success = true; return ret; } finally { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWSegmentInfoFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWSegmentInfoFormat.java index 84a910130e9..492d419bc2a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWSegmentInfoFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWSegmentInfoFormat.java @@ -19,8 +19,12 @@ package org.apache.lucene.codecs.lucene40; import org.apache.lucene.codecs.SegmentInfoWriter; -/** read-write version of 4.0 segmentinfos for testing */ -public class Lucene40RWSegmentInfoFormat extends Lucene40SegmentInfoFormat { +/** + * Read-write version of 4.0 segmentinfo format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene40RWSegmentInfoFormat extends Lucene40SegmentInfoFormat { @Override public SegmentInfoWriter getSegmentInfoWriter() { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWStoredFieldsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWStoredFieldsFormat.java index 58d977092b0..3e4f7907ff9 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWStoredFieldsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWStoredFieldsFormat.java @@ -24,10 +24,12 @@ import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -/** - * Simulates writing Lucene 4.0 Stored Fields Format. - */ -public class Lucene40RWStoredFieldsFormat extends Lucene40StoredFieldsFormat { +/** + * Read-write version of 4.0 stored fields format for testing + * @deprecated for test purposes only + */ +@Deprecated +final class Lucene40RWStoredFieldsFormat extends Lucene40StoredFieldsFormat { @Override public StoredFieldsWriter fieldsWriter(Directory directory, SegmentInfo si, IOContext context) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWTermVectorsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWTermVectorsFormat.java index a6a3e244961..9c62465506e 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWTermVectorsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40RWTermVectorsFormat.java @@ -23,12 +23,13 @@ import org.apache.lucene.codecs.TermVectorsWriter; import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -import org.apache.lucene.util.LuceneTestCase; -/** - * Simulates writing Lucene 4.0 Stored Fields Format. - */ -public class Lucene40RWTermVectorsFormat extends Lucene40TermVectorsFormat { +/** + * Read-write version of 4.0 term vectors format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene40RWTermVectorsFormat extends Lucene40TermVectorsFormat { @Override public TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java index 61bb7ad1346..68151023ef2 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SegmentInfoWriter.java @@ -31,13 +31,11 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.IOUtils; /** - * Lucene 4.0 implementation of {@link SegmentInfoWriter}. - * - * @see Lucene40SegmentInfoFormat - * @lucene.experimental + * writer for 4.0 segmentinfos for testing + * @deprecated for test purposes only */ @Deprecated -public class Lucene40SegmentInfoWriter extends SegmentInfoWriter { +public final class Lucene40SegmentInfoWriter extends SegmentInfoWriter { /** Sole constructor. */ public Lucene40SegmentInfoWriter() { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SkipListWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SkipListWriter.java index 62bd3047878..444813b6796 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SkipListWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40SkipListWriter.java @@ -25,14 +25,11 @@ import org.apache.lucene.codecs.MultiLevelSkipListWriter; /** - * Implements the skip list writer for the 4.0 posting list format - * that stores positions and payloads. - * - * @see Lucene40PostingsFormat - * @deprecated Only for reading old 4.0 segments + * Writer of 4.0 skip lists for testing + * @deprecated for test purposes only */ @Deprecated -public class Lucene40SkipListWriter extends MultiLevelSkipListWriter { +final class Lucene40SkipListWriter extends MultiLevelSkipListWriter { private int[] lastSkipDoc; private int[] lastSkipPayloadLength; private int[] lastSkipOffsetLength; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java index 0b8b350e567..71d6de203ab 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40StoredFieldsWriter.java @@ -34,15 +34,12 @@ import org.apache.lucene.util.IOUtils; import static org.apache.lucene.codecs.lucene40.Lucene40StoredFieldsReader.*; -/** - * Class responsible for writing stored document fields. - *

- * It uses <segment>.fdt and <segment>.fdx; files. - * - * @see Lucene40StoredFieldsFormat - * @lucene.experimental +/** + * Writer for 4.0 stored fields format for testing + * @deprecated for test purposes only */ -public final class Lucene40StoredFieldsWriter extends StoredFieldsWriter { +@Deprecated +final class Lucene40StoredFieldsWriter extends StoredFieldsWriter { private final Directory directory; private final String segment; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java index 5b5b3016273..69ec8c1cb43 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/Lucene40TermVectorsWriter.java @@ -36,24 +36,12 @@ import org.apache.lucene.util.StringHelper; import static org.apache.lucene.codecs.lucene40.Lucene40TermVectorsReader.*; - -// TODO: make a new 4.0 TV format that encodes better -// - use startOffset (not endOffset) as base for delta on -// next startOffset because today for syns or ngrams or -// WDF or shingles etc. we are encoding negative vints -// (= slow, 5 bytes per) -// - if doc has no term vectors, write 0 into the tvx -// file; saves a seek to tvd only to read a 0 vint (and -// saves a byte in tvd) - /** - * Lucene 4.0 Term Vectors writer. - *

- * It writes .tvd, .tvf, and .tvx files. - * - * @see Lucene40TermVectorsFormat + * Writer for 4.0 term vectors format for testing + * @deprecated for test purposes only */ -public final class Lucene40TermVectorsWriter extends TermVectorsWriter { +@Deprecated +final class Lucene40TermVectorsWriter extends TermVectorsWriter { private final Directory directory; private final String segment; private IndexOutput tvx = null, tvd = null, tvf = null; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestBitVector.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestBitVector.java index 7e09e86a335..0ce482ee839 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestBitVector.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestBitVector.java @@ -24,7 +24,6 @@ import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.RAMDirectory; import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.TestUtil; -import org.apache.lucene.util.TestUtil; /** * TestBitVector tests the BitVector, obviously. diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40StoredFieldsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40StoredFieldsFormat.java index b7e4bda5733..72427c0249b 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40StoredFieldsFormat.java @@ -19,7 +19,6 @@ package org.apache.lucene.codecs.lucene40; import org.apache.lucene.codecs.Codec; import org.apache.lucene.index.BaseStoredFieldsFormatTestCase; -import org.junit.BeforeClass; public class TestLucene40StoredFieldsFormat extends BaseStoredFieldsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40TermVectorsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40TermVectorsFormat.java index 0d4146189d0..1360b2a8219 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40TermVectorsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene40/TestLucene40TermVectorsFormat.java @@ -19,7 +19,6 @@ package org.apache.lucene.codecs.lucene40; import org.apache.lucene.codecs.Codec; import org.apache.lucene.index.BaseTermVectorsFormatTestCase; -import org.junit.BeforeClass; public class TestLucene40TermVectorsFormat extends BaseTermVectorsFormatTestCase { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWCodec.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWCodec.java index 1d1fd2fb8e4..79268d75eae 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWCodec.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWCodec.java @@ -34,10 +34,11 @@ import org.apache.lucene.codecs.lucene40.Lucene40RWTermVectorsFormat; */ /** - * Read-write version of {@link Lucene41Codec} for testing. + * Read-write version of 4.1 codec for testing + * @deprecated for test purposes only */ -@SuppressWarnings("deprecation") -public class Lucene41RWCodec extends Lucene41Codec { +@Deprecated +public final class Lucene41RWCodec extends Lucene41Codec { private final StoredFieldsFormat fieldsFormat = new Lucene41RWStoredFieldsFormat(); private final FieldInfosFormat fieldInfos = new Lucene40FieldInfosFormat() { @Override diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWStoredFieldsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWStoredFieldsFormat.java index 94e464263e4..cf2690fe7c0 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWStoredFieldsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41RWStoredFieldsFormat.java @@ -24,8 +24,12 @@ import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -/** read-write version of Lucene41StoredsFieldsFormat for testing */ -public class Lucene41RWStoredFieldsFormat extends Lucene41StoredFieldsFormat { +/** + * Read-write version of 4.1 stored fields format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene41RWStoredFieldsFormat extends Lucene41StoredFieldsFormat { @Override public StoredFieldsWriter fieldsWriter(Directory directory, SegmentInfo si, IOContext context) throws IOException { return new Lucene41StoredFieldsWriter(directory, si, SEGMENT_SUFFIX, context, FORMAT_NAME, COMPRESSION_MODE, CHUNK_SIZE); diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexWriter.java index 03d0b2c97a3..8b2ab4e1271 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsIndexWriter.java @@ -27,8 +27,10 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.packed.PackedInts; /** - * writer for lucene 4.x stored fields/vectors index for testing + * Writer for 4.1 stored fields/term vectors index for testing + * @deprecated for test purposes only */ +@Deprecated public final class Lucene41StoredFieldsIndexWriter implements Closeable { static final int BLOCK_SIZE = 1024; // number of chunks to serialize at once diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsWriter.java index 7d40386d351..a286d6450f5 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene41/Lucene41StoredFieldsWriter.java @@ -53,8 +53,10 @@ import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.packed.PackedInts; /** - * writer for Lucene 4.1 stored fields for testing + * Writer for 4.1 stored fields format for testing + * @deprecated for test purposes only */ +@Deprecated final class Lucene41StoredFieldsWriter extends StoredFieldsWriter { // hard limit on the maximum number of documents per chunk diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42DocValuesConsumer.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42DocValuesConsumer.java index c0ed76bae23..1bbab87d8e7 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42DocValuesConsumer.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42DocValuesConsumer.java @@ -34,7 +34,6 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.ArrayUtil; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.IOUtils; -import org.apache.lucene.util.IntsRef; import org.apache.lucene.util.IntsRefBuilder; import org.apache.lucene.util.MathUtil; import org.apache.lucene.util.fst.Builder; @@ -58,9 +57,11 @@ import static org.apache.lucene.codecs.lucene42.Lucene42DocValuesProducer.TABLE_ import static org.apache.lucene.codecs.lucene42.Lucene42DocValuesProducer.UNCOMPRESSED; /** - * Writer for {@link Lucene42DocValuesFormat} + * Writer for 4.2 docvalues format for testing + * @deprecated for test purposes only */ -class Lucene42DocValuesConsumer extends DocValuesConsumer { +@Deprecated +final class Lucene42DocValuesConsumer extends DocValuesConsumer { final IndexOutput data, meta; final int maxDoc; final float acceptableOverheadRatio; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosWriter.java index 79cea32cdce..ab9862725e3 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42FieldInfosWriter.java @@ -33,10 +33,8 @@ import org.apache.lucene.store.IndexOutput; import org.apache.lucene.util.IOUtils; /** - * Lucene 4.2 FieldInfos writer. - * - * @see Lucene42FieldInfosFormat - * @lucene.experimental + * Writer for 4.2 fieldinfos format for testing + * @deprecated for test purposes only */ @Deprecated public final class Lucene42FieldInfosWriter extends FieldInfosWriter { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42NormsConsumer.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42NormsConsumer.java index dc1825dd9cd..0d003c98480 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42NormsConsumer.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42NormsConsumer.java @@ -36,9 +36,11 @@ import org.apache.lucene.util.packed.PackedInts; import static org.apache.lucene.codecs.lucene42.Lucene42DocValuesProducer.VERSION_CURRENT; /** - * Writer for {@link Lucene42NormsFormat} + * Writer for 4.2 norms format for testing + * @deprecated for test purposes only */ -class Lucene42NormsConsumer extends NormsConsumer { +@Deprecated +final class Lucene42NormsConsumer extends NormsConsumer { static final byte NUMBER = 0; static final int BLOCK_SIZE = 4096; diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWCodec.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWCodec.java index b98696df63f..aa1cf385eca 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWCodec.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWCodec.java @@ -28,13 +28,13 @@ import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.lucene40.Lucene40RWSegmentInfoFormat; import org.apache.lucene.codecs.lucene41.Lucene41RWStoredFieldsFormat; -import org.apache.lucene.util.LuceneTestCase; /** - * Read-write version of {@link Lucene42Codec} for testing. + * Read-Write version of 4.2 codec for testing + * @deprecated for test purposes only */ -@SuppressWarnings("deprecation") -public class Lucene42RWCodec extends Lucene42Codec { +@Deprecated +public final class Lucene42RWCodec extends Lucene42Codec { private static final DocValuesFormat dv = new Lucene42RWDocValuesFormat(); private static final NormsFormat norms = new Lucene42RWNormsFormat(); diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWDocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWDocValuesFormat.java index f4401d651e0..6ecbd7941b4 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWDocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWDocValuesFormat.java @@ -21,13 +21,13 @@ import java.io.IOException; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.LuceneTestCase; /** - * Read-write version of {@link Lucene42DocValuesFormat} for testing. + * Read-Write version of 4.2 docvalues format for testing + * @deprecated for test purposes only */ -@SuppressWarnings("deprecation") -public class Lucene42RWDocValuesFormat extends Lucene42DocValuesFormat { +@Deprecated +public final class Lucene42RWDocValuesFormat extends Lucene42DocValuesFormat { @Override public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWNormsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWNormsFormat.java index be62482a630..ef8165aa1f0 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWNormsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWNormsFormat.java @@ -21,12 +21,13 @@ import java.io.IOException; import org.apache.lucene.codecs.NormsConsumer; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.LuceneTestCase; /** - * Read-write version of {@link Lucene42NormsFormat} + * Read-write version of 4.2 norms format for testing + * @deprecated for test purposes only */ -public class Lucene42RWNormsFormat extends Lucene42NormsFormat { +@Deprecated +public final class Lucene42RWNormsFormat extends Lucene42NormsFormat { @Override public NormsConsumer normsConsumer(SegmentWriteState state) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWTermVectorsFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWTermVectorsFormat.java index ec75b867049..fdf461fb65a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWTermVectorsFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42RWTermVectorsFormat.java @@ -24,8 +24,12 @@ import org.apache.lucene.index.SegmentInfo; import org.apache.lucene.store.Directory; import org.apache.lucene.store.IOContext; -/** read-write version of lucene 4.2 term vectors for testing */ -public class Lucene42RWTermVectorsFormat extends Lucene42TermVectorsFormat { +/** + * Read-Write version of 4.2 term vectors format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene42RWTermVectorsFormat extends Lucene42TermVectorsFormat { @Override public TermVectorsWriter vectorsWriter(Directory directory, SegmentInfo segmentInfo, IOContext context) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsWriter.java index c11255dd9f9..e8c813b874a 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene42/Lucene42TermVectorsWriter.java @@ -58,8 +58,10 @@ import org.apache.lucene.util.packed.BlockPackedWriter; import org.apache.lucene.util.packed.PackedInts; /** - * writer for Lucene 4.2 term vectors for testing + * Writer for 4.2 term vectors format for testing + * @deprecated for test purposes only */ +@Deprecated final class Lucene42TermVectorsWriter extends TermVectorsWriter { // hard limit on the maximum number of documents per chunk diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWCodec.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWCodec.java index eadd4d3db7b..43bf33f3bcd 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWCodec.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWCodec.java @@ -37,7 +37,7 @@ import org.apache.lucene.codecs.lucene42.Lucene42RWTermVectorsFormat; * Read-write version of {@link Lucene45Codec} for testing. */ @SuppressWarnings("deprecation") -public class Lucene45RWCodec extends Lucene45Codec { +public final class Lucene45RWCodec extends Lucene45Codec { private final FieldInfosFormat fieldInfosFormat = new Lucene42FieldInfosFormat() { @Override diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWDocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWDocValuesFormat.java index c7ca97a6d60..0b205ccb873 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWDocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/Lucene45RWDocValuesFormat.java @@ -24,9 +24,11 @@ import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.SegmentWriteState; /** - * Read-write version of {@link Lucene45DocValuesFormat} for testing. + * Read-write version of 4.5 docvalues format for testing + * @deprecated for test purposes only */ -public class Lucene45RWDocValuesFormat extends Lucene45DocValuesFormat { +@Deprecated +public final class Lucene45RWDocValuesFormat extends Lucene45DocValuesFormat { @Override public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java index f55c65c8d01..3e7436bac4b 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene45/TestLucene45DocValuesFormat.java @@ -19,7 +19,6 @@ package org.apache.lucene.codecs.lucene45; import org.apache.lucene.codecs.Codec; import org.apache.lucene.index.BaseCompressingDocValuesFormatTestCase; -import org.junit.BeforeClass; /** * Tests Lucene45DocValuesFormat diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWCodec.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWCodec.java index c2b20355f58..ea9e00be014 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWCodec.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWCodec.java @@ -20,7 +20,6 @@ package org.apache.lucene.codecs.lucene46; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.NormsFormat; import org.apache.lucene.codecs.SegmentInfoFormat; -import org.apache.lucene.codecs.SegmentInfoWriter; import org.apache.lucene.codecs.StoredFieldsFormat; import org.apache.lucene.codecs.TermVectorsFormat; import org.apache.lucene.codecs.lucene41.Lucene41RWStoredFieldsFormat; @@ -29,10 +28,11 @@ import org.apache.lucene.codecs.lucene42.Lucene42RWTermVectorsFormat; import org.apache.lucene.codecs.lucene45.Lucene45RWDocValuesFormat; /** - * Read-write version of {@link Lucene46Codec} for testing. + * Read-write version of 4.6 codec for testing + * @deprecated for test purposes only */ -@SuppressWarnings("deprecation") -public class Lucene46RWCodec extends Lucene46Codec { +@Deprecated +public final class Lucene46RWCodec extends Lucene46Codec { private static final DocValuesFormat docValues = new Lucene45RWDocValuesFormat(); diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWSegmentInfoFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWSegmentInfoFormat.java index 7089a41af84..b57f30c5ba2 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWSegmentInfoFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46RWSegmentInfoFormat.java @@ -19,8 +19,12 @@ package org.apache.lucene.codecs.lucene46; import org.apache.lucene.codecs.SegmentInfoWriter; -/** read-write version of 4.6 segmentinfos for testing */ -public class Lucene46RWSegmentInfoFormat extends Lucene46SegmentInfoFormat { +/** + * Read-Write version of 4.6 segmentinfo format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene46RWSegmentInfoFormat extends Lucene46SegmentInfoFormat { @Override public SegmentInfoWriter getSegmentInfoWriter() { return new Lucene46SegmentInfoWriter(); diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoWriter.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoWriter.java index a8db471154d..92132220120 100755 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoWriter.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene46/Lucene46SegmentInfoWriter.java @@ -31,12 +31,11 @@ import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.Version; /** - * Lucene 4.0 implementation of {@link SegmentInfoWriter}. - * - * @see Lucene46SegmentInfoFormat - * @lucene.experimental + * Writer for 4.0 segmentinfo format for testing + * @deprecated for test purposes only */ -public class Lucene46SegmentInfoWriter extends SegmentInfoWriter { +@Deprecated +final class Lucene46SegmentInfoWriter extends SegmentInfoWriter { /** Sole constructor. */ public Lucene46SegmentInfoWriter() { diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWCodec.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWCodec.java index 16b22a08aa6..bb35cd70784 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWCodec.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWCodec.java @@ -27,10 +27,11 @@ import org.apache.lucene.codecs.lucene42.Lucene42RWTermVectorsFormat; import org.apache.lucene.codecs.lucene46.Lucene46RWSegmentInfoFormat; /** - * Read-write version of {@link Lucene49Codec} for testing. + * Read-Write version of 4.9 codec for testing + * @deprecated for test purposes only */ -@SuppressWarnings("deprecation") -public class Lucene49RWCodec extends Lucene49Codec { +@Deprecated +public final class Lucene49RWCodec extends Lucene49Codec { private static final DocValuesFormat docValues = new Lucene49RWDocValuesFormat(); diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWDocValuesFormat.java b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWDocValuesFormat.java index 67ae4841abc..e3c758ea5b0 100644 --- a/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWDocValuesFormat.java +++ b/lucene/backward-codecs/src/test/org/apache/lucene/codecs/lucene49/Lucene49RWDocValuesFormat.java @@ -22,10 +22,13 @@ import java.io.IOException; import org.apache.lucene.codecs.DocValuesConsumer; import org.apache.lucene.index.FieldInfo; import org.apache.lucene.index.SegmentWriteState; -import org.apache.lucene.util.LuceneTestCase; -/** Read-write version of {@link Lucene49DocValuesFormat} for testing */ -public class Lucene49RWDocValuesFormat extends Lucene49DocValuesFormat { +/** + * Read-Write version of 4.9 docvalues format for testing + * @deprecated for test purposes only + */ +@Deprecated +public final class Lucene49RWDocValuesFormat extends Lucene49DocValuesFormat { @Override public DocValuesConsumer fieldsConsumer(SegmentWriteState state) throws IOException { diff --git a/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsReader.java index f05b8f99ccd..e1bb77755c1 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsReader.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingStoredFieldsReader.java @@ -107,22 +107,34 @@ public final class CompressingStoredFieldsReader extends StoredFieldsReader { boolean success = false; fieldInfos = fn; numDocs = si.getDocCount(); - ChecksumIndexInput indexStream = null; + + int version = -1; + long maxPointer = -1; + CompressingStoredFieldsIndexReader indexReader = null; + + // Load the index into memory + final String indexName = IndexFileNames.segmentFileName(segment, segmentSuffix, FIELDS_INDEX_EXTENSION); + try (ChecksumIndexInput indexStream = d.openChecksumInput(indexName, context)) { + Throwable priorE = null; + try { + final String codecNameIdx = formatName + CODEC_SFX_IDX; + version = CodecUtil.checkSegmentHeader(indexStream, codecNameIdx, VERSION_START, VERSION_CURRENT, si.getId()); + assert CodecUtil.segmentHeaderLength(codecNameIdx) == indexStream.getFilePointer(); + indexReader = new CompressingStoredFieldsIndexReader(indexStream, si); + maxPointer = indexStream.readVLong(); + } catch (Throwable exception) { + priorE = exception; + } finally { + CodecUtil.checkFooter(indexStream, priorE); + } + } + + this.version = version; + this.maxPointer = maxPointer; + this.indexReader = indexReader; + + final String fieldsStreamFN = IndexFileNames.segmentFileName(segment, segmentSuffix, FIELDS_EXTENSION); try { - final String indexStreamFN = IndexFileNames.segmentFileName(segment, segmentSuffix, FIELDS_INDEX_EXTENSION); - final String fieldsStreamFN = IndexFileNames.segmentFileName(segment, segmentSuffix, FIELDS_EXTENSION); - // Load the index into memory - indexStream = d.openChecksumInput(indexStreamFN, context); - final String codecNameIdx = formatName + CODEC_SFX_IDX; - version = CodecUtil.checkSegmentHeader(indexStream, codecNameIdx, VERSION_START, VERSION_CURRENT, si.getId()); - assert CodecUtil.segmentHeaderLength(codecNameIdx) == indexStream.getFilePointer(); - indexReader = new CompressingStoredFieldsIndexReader(indexStream, si); - - maxPointer = indexStream.readVLong(); - CodecUtil.checkFooter(indexStream); - indexStream.close(); - indexStream = null; - // Open the data file and read metadata fieldsStream = d.openInput(fieldsStreamFN, context); if (maxPointer + CodecUtil.footerLength() != fieldsStream.length()) { @@ -149,7 +161,7 @@ public final class CompressingStoredFieldsReader extends StoredFieldsReader { success = true; } finally { if (!success) { - IOUtils.closeWhileHandlingException(this, indexStream); + IOUtils.closeWhileHandlingException(this); } } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingTermVectorsReader.java b/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingTermVectorsReader.java index 4339597ce89..4315cf3d632 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingTermVectorsReader.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/compressing/CompressingTermVectorsReader.java @@ -105,21 +105,30 @@ public final class CompressingTermVectorsReader extends TermVectorsReader implem boolean success = false; fieldInfos = fn; numDocs = si.getDocCount(); - ChecksumIndexInput indexStream = null; - try { - // Load the index into memory - final String indexStreamFN = IndexFileNames.segmentFileName(segment, segmentSuffix, VECTORS_INDEX_EXTENSION); - indexStream = d.openChecksumInput(indexStreamFN, context); - final String codecNameIdx = formatName + CODEC_SFX_IDX; - version = CodecUtil.checkSegmentHeader(indexStream, codecNameIdx, VERSION_START, VERSION_CURRENT, si.getId()); - assert CodecUtil.segmentHeaderLength(codecNameIdx) == indexStream.getFilePointer(); - indexReader = new CompressingStoredFieldsIndexReader(indexStream, si); - - indexStream.readVLong(); // the end of the data file - CodecUtil.checkFooter(indexStream); - indexStream.close(); - indexStream = null; + int version = -1; + CompressingStoredFieldsIndexReader indexReader = null; + + // Load the index into memory + final String indexName = IndexFileNames.segmentFileName(segment, segmentSuffix, VECTORS_INDEX_EXTENSION); + try (ChecksumIndexInput input = d.openChecksumInput(indexName, context)) { + Throwable priorE = null; + try { + final String codecNameIdx = formatName + CODEC_SFX_IDX; + version = CodecUtil.checkSegmentHeader(input, codecNameIdx, VERSION_START, VERSION_CURRENT, si.getId()); + assert CodecUtil.segmentHeaderLength(codecNameIdx) == input.getFilePointer(); + indexReader = new CompressingStoredFieldsIndexReader(input, si); + input.readVLong(); // the end of the data file + } catch (Throwable exception) { + priorE = exception; + } finally { + CodecUtil.checkFooter(input, priorE); + } + } + + this.version = version; + this.indexReader = indexReader; + try { // Open the data file and read metadata final String vectorsStreamFN = IndexFileNames.segmentFileName(segment, segmentSuffix, VECTORS_EXTENSION); vectorsStream = d.openInput(vectorsStreamFN, context); @@ -146,7 +155,7 @@ public final class CompressingTermVectorsReader extends TermVectorsReader implem success = true; } finally { if (!success) { - IOUtils.closeWhileHandlingException(this, indexStream); + IOUtils.closeWhileHandlingException(this); } } } diff --git a/lucene/core/src/java/org/apache/lucene/codecs/compressing/MatchingReaders.java b/lucene/core/src/java/org/apache/lucene/codecs/compressing/MatchingReaders.java index b27d68381ad..c9806900e1b 100644 --- a/lucene/core/src/java/org/apache/lucene/codecs/compressing/MatchingReaders.java +++ b/lucene/core/src/java/org/apache/lucene/codecs/compressing/MatchingReaders.java @@ -18,9 +18,6 @@ package org.apache.lucene.codecs.compressing; */ import org.apache.lucene.index.FieldInfo; -import org.apache.lucene.index.FieldInfos; -import org.apache.lucene.index.IndexReader; -import org.apache.lucene.index.LeafReader; import org.apache.lucene.index.MergeState; import org.apache.lucene.index.SegmentReader; @@ -35,7 +32,7 @@ class MatchingReaders { * vectors may be bulk merged. */ final boolean[] matchingReaders; - /** How many {@link #matchingSegmentReaders} are set. */ + /** How many {@link #matchingReaders} are set. */ final int count; MatchingReaders(MergeState mergeState) { diff --git a/lucene/core/src/java/org/apache/lucene/index/MergeState.java b/lucene/core/src/java/org/apache/lucene/index/MergeState.java index 2d5bdc7e411..5bd67fe3880 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MergeState.java +++ b/lucene/core/src/java/org/apache/lucene/index/MergeState.java @@ -18,7 +18,6 @@ package org.apache.lucene.index; */ import java.io.IOException; -import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -46,14 +45,19 @@ public class MergeState { /** {@link FieldInfos} of the newly merged segment. */ public FieldInfos mergeFieldInfos; + /** Stored field producers being merged */ public final StoredFieldsReader[] storedFieldsReaders; + /** Term vector producers being merged */ public final TermVectorsReader[] termVectorsReaders; + /** Norms producers being merged */ public final NormsProducer[] normsProducers; + /** DocValues producers being merged */ public final DocValuesProducer[] docValuesProducers; + /** FieldInfos being merged */ public final FieldInfos[] fieldInfos; /** Live docs for each reader */ diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java index 0c5d375b14d..4dc1c56e660 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java +++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java @@ -232,8 +232,6 @@ public class SolrIndexConfig { iwc.setMergedSegmentWarmer(warmer); } - iwc.setCheckIntegrityAtMerge(checkIntegrityAtMerge); - return iwc; } diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java index c5ede8e80d9..a29cf373a12 100644 --- a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java +++ b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java @@ -78,18 +78,6 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 { } - @Test - public void testCheckIntegrityAtMerge() throws Exception { - SolrConfig solrConfig = new SolrConfig("solr" + File.separator - + "collection1", "solrconfig-indexconfig.xml", null); - SolrIndexConfig solrIndexConfig = new SolrIndexConfig(solrConfig, null, null); - assertNotNull(solrIndexConfig.checkIntegrityAtMerge); - assertTrue(solrIndexConfig.checkIntegrityAtMerge); - IndexSchema indexSchema = IndexSchemaFactory.buildIndexSchema("schema.xml", solrConfig); - IndexWriterConfig iwc = solrIndexConfig.toIndexWriterConfig(indexSchema); - assertTrue(iwc.getCheckIntegrityAtMerge()); - } - public void testMergedSegmentWarmerIndexConfigCreation() throws Exception { SolrConfig solrConfig = new SolrConfig("solr" + File.separator + "collection1", "solrconfig-warmer.xml", null);