You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2013/01/31 05:39:39 UTC
svn commit: r1440845 - in /lucene/dev/branches/lucene4547/lucene/core/src:
java/org/apache/lucene/util/BytesRefHash.java
java/org/apache/lucene/util/packed/PackedInts.java
test/org/apache/lucene/util/TestBytesRefHash.java
Author: rmuir
Date: Thu Jan 31 04:39:38 2013
New Revision: 1440845
URL: http://svn.apache.org/viewvc?rev=1440845&view=rev
Log:
clear nocommits
Modified:
lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java
Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java?rev=1440845&r1=1440844&r2=1440845&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/BytesRefHash.java Thu Jan 31 04:39:38 2013
@@ -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++) {
Modified: lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java?rev=1440845&r1=1440844&r2=1440845&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/java/org/apache/lucene/util/packed/PackedInts.java Thu Jan 31 04:39:38 2013
@@ -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;
Modified: lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java?rev=1440845&r1=1440844&r2=1440845&view=diff
==============================================================================
--- lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java (original)
+++ lucene/dev/branches/lucene4547/lucene/core/src/test/org/apache/lucene/util/TestBytesRefHash.java Thu Jan 31 04:39:38 2013
@@ -133,7 +133,6 @@ public class TestBytesRefHash extends Lu
/**
* Test method for {@link org.apache.lucene.util.BytesRefHash#compact()}.
*/
- /* nocommit: rewrite in terms of TestSort?
@Test
public void testCompact() {
BytesRef ref = new BytesRef();
@@ -170,7 +169,7 @@ public class TestBytesRefHash extends Lu
assertEquals(0, hash.size());
hash.reinit();
}
- }*/
+ }
/**
* Test method for