ihuzenko commented on a change in pull request #1929: DRILL-6832: Remove the old "unmanaged" external sort URL: https://github.com/apache/drill/pull/1929#discussion_r360365036
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/BatchGroup.java ########## @@ -18,140 +18,300 @@ package org.apache.drill.exec.physical.impl.xsort; import java.io.IOException; +import java.io.InputStream; +import java.util.Collection; import java.util.Iterator; import java.util.concurrent.TimeUnit; +import org.apache.drill.common.exceptions.UserException; import org.apache.drill.common.expression.SchemaPath; -import org.apache.drill.exec.cache.VectorAccessibleSerializable; +import org.apache.drill.exec.cache.VectorSerializer; +import org.apache.drill.exec.cache.VectorSerializer.Writer; import org.apache.drill.exec.memory.BufferAllocator; -import org.apache.drill.exec.ops.OperatorContext; +import org.apache.drill.exec.physical.impl.spill.SpillSet; import org.apache.drill.exec.record.BatchSchema; import org.apache.drill.exec.record.SchemaUtil; import org.apache.drill.exec.record.TransferPair; import org.apache.drill.exec.record.TypedFieldId; import org.apache.drill.exec.record.VectorAccessible; import org.apache.drill.exec.record.VectorContainer; import org.apache.drill.exec.record.VectorWrapper; -import org.apache.drill.exec.record.WritableBatch; import org.apache.drill.exec.record.selection.SelectionVector2; import org.apache.drill.exec.record.selection.SelectionVector4; -import org.apache.hadoop.fs.FSDataInputStream; -import org.apache.hadoop.fs.FSDataOutputStream; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.fs.Path; import org.apache.drill.shaded.guava.com.google.common.base.Stopwatch; -public class BatchGroup implements VectorAccessible, AutoCloseable { +/** + * Represents a group of batches spilled to disk. + * <p> + * The batches are defined by a schema which can change over time. When the schema changes, + * all existing and new batches are coerced into the new schema. Provides a + * uniform way to iterate over records for one or more batches whether + * the batches are in memory or on disk. + * <p> + * The <code>BatchGroup</code> operates in two modes as given by the two + * subclasses: + * <ul> + * <li>Input mode (@link InputBatchGroup): Used to buffer in-memory batches + * prior to spilling.</li> + * <li>Spill mode (@link SpilledBatchGroup): Holds a "memento" to a set Review comment: ```suggestion * <li>Spill mode {@link SpilledRun}: Holds a "memento" to a set ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services