Apache Solr open-source search software
clear nocommits
Robert Muir54773d36a368
diff --git a/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.javaindex 88b24396ed6..8e50bc6ec75 100644--- a/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java+++ b/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java@@ -130,7 +130,7 @@ public final class BytesRefHash {* order to reuse this {@link BytesRefHash} instance.* </p>*/- private int[] compact() {+ int[] compact() {assert bytesStart != null : "Bytesstart is null - not initialized";int upto = 0;for (int i = 0; i < hashSize; i++) {diff --git a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.javaindex 6d7edf8a02e..64541a7f921 100644--- a/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java+++ b/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java@@ -848,7 +848,18 @@ public class PackedInts {}}- //nocommit javadoc+ /**+ * Expert: Restore a {@link Reader} from a stream without reading metadata at+ * the beginning of the stream. This method is useful to restore data when+ * metadata has been previously read using {@link #readHeader(DataInput)}.+ *+ * @param in the stream to read data from, positioned at the beginning of the packed values+ * @param header metadata result from <code>readHeader()</code>+ * @return a Reader+ * @throws IOException If there is a low-level I/O error+ * @see #readHeader(DataInput)+ * @lucene.internal+ */public static Reader getReaderNoHeader(DataInput in, Header header) throws IOException {return getReaderNoHeader(in, header.format, header.version, header.valueCount, header.bitsPerValue);}@@ -965,7 +976,19 @@ public class PackedInts {}}- //nocommit javadoc+ /**+ * Expert: Construct a direct {@link Reader} from an {@link IndexInput}+ * without reading metadata at the beginning of the stream. This method is+ * useful to restore data when metadata has been previously read using+ * {@link #readHeader(DataInput)}.+ *+ * @param in the stream to read data from, positioned at the beginning of the packed values+ * @param header metadata result from <code>readHeader()</code>+ * @return a Reader+ * @throws IOException If there is a low-level I/O error+ * @see #readHeader(DataInput)+ * @lucene.internal+ */public static Reader getDirectReaderNoHeader(IndexInput in, Header header) throws IOException {return getDirectReaderNoHeader(in, header.format, header.version, header.valueCount, header.bitsPerValue);}@@ -1200,8 +1223,18 @@ public class PackedInts {}}- //nocommit javadoc- public static Header readHeader(IndexInput in) throws IOException {+ /**+ * Expert: reads only the metadata from a stream. This is useful to later+ * restore a stream or open a direct reader via+ * {@link #getReaderNoHeader(DataInput, Header)}+ * or {@link #getDirectReaderNoHeader(IndexInput, Header)}.+ * @param in the stream to read data+ * @return packed integer metadata.+ * @throws IOException If there is a low-level I/O error+ * @see #getReaderNoHeader(DataInput, Header)+ * @see #getDirectReaderNoHeader(IndexInput, Header)+ */+ public static Header readHeader(DataInput in) throws IOException {final int version = CodecUtil.checkHeader(in, CODEC_NAME, VERSION_START, VERSION_CURRENT);final int bitsPerValue = in.readVInt();assert bitsPerValue > 0 && bitsPerValue <= 64: "bitsPerValue=" + bitsPerValue;diff --git a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.javaindex f3f61596bc9..3be9e6f151d 100644--- a/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java+++ b/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java@@ -133,7 +133,6 @@ public class TestBytesRefHash extends LuceneTestCase {/*** Test method for {@link org.apache.lucene.util.BytesRefHash#compact()}.*/- /* nocommit: rewrite in terms of TestSort?@Testpublic void testCompact() {BytesRef ref = new BytesRef();@@ -170,7 +169,7 @@ public class TestBytesRefHash extends LuceneTestCase {assertEquals(0, hash.size());hash.reinit();}- }*/+ }/*** Test method for