You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2012/08/16 21:37:40 UTC
svn commit: r1374004 -
/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java
Author: simonw
Date: Thu Aug 16 19:37:40 2012
New Revision: 1374004
URL: http://svn.apache.org/viewvc?rev=1374004&view=rev
Log:
added javadocs to SortedBytesMergeUtils public inner classes
Modified:
lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java
Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java?rev=1374004&r1=1374003&r2=1374004&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java Thu Aug 16 19:37:40 2012
@@ -179,10 +179,36 @@ public final class SortedBytesMergeUtils
return merger.currentOrd;
}
+ /**
+ * Implementation of this interface consume the merged bytes with their
+ * corresponding ordinal and byte offset. The offset is the byte offset in
+ * target sorted source where the currently merged {@link BytesRef} instance
+ * should be stored at.
+ */
public static interface BytesRefConsumer {
+
+ /**
+ * Consumes a single {@link BytesRef}. The provided {@link BytesRef}
+ * instances are strictly increasing with respect to the used
+ * {@link Comparator} used for merging
+ *
+ * @param ref
+ * the {@link BytesRef} to consume
+ * @param ord
+ * the ordinal of the given {@link BytesRef} in the merge target
+ * @param offset
+ * the byte offset of the given {@link BytesRef} in the merge
+ * target
+ * @throws IOException
+ * if an {@link IOException} occurs
+ */
public void consume(BytesRef ref, int ord, long offset) throws IOException;
}
+ /**
+ * A simple {@link BytesRefConsumer} that writes the merged {@link BytesRef}
+ * instances sequentially to an {@link IndexOutput}.
+ */
public static final class IndexOutputBytesRefConsumer implements BytesRefConsumer {
private final IndexOutput datOut;