Skip to content

Apache Lucene open-source search software

added javadocs to SortedBytesMergeUtils public inner classes

Simon Willnauerae79b917ca7f
diff --git a/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java b/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java
index 4af123ab128..c4b4998bf4b 100644
--- a/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java
+++ b/lucene/core/src/java/org/apache/lucene/index/SortedBytesMergeUtils.java
@@ -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;