paul-rogers commented on a change in pull request #1843: DRILL-7350: Move RowSet related classes from test folder URL: https://github.com/apache/drill/pull/1843#discussion_r314783903
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/physical/rowSet/AbstractSingleRowSet.java ########## @@ -15,37 +15,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.drill.test.rowSet; +package org.apache.drill.exec.physical.rowSet; import org.apache.drill.exec.record.RecordBatchSizer; import org.apache.drill.exec.physical.rowSet.model.ReaderIndex; import org.apache.drill.exec.physical.rowSet.model.MetadataProvider.MetadataRetrieval; import org.apache.drill.exec.physical.rowSet.model.single.BaseReaderBuilder; import org.apache.drill.exec.record.VectorContainer; import org.apache.drill.exec.record.metadata.TupleMetadata; -import org.apache.drill.test.rowSet.RowSet.SingleRowSet; +import org.apache.drill.exec.physical.rowSet.RowSet.SingleRowSet; /** * Base class for row sets backed by a single record batch. */ public abstract class AbstractSingleRowSet extends AbstractRowSet implements SingleRowSet { - public static class RowSetReaderBuilder extends BaseReaderBuilder { - - public RowSetReader buildReader(AbstractSingleRowSet rowSet, ReaderIndex rowIndex) { - TupleMetadata schema = rowSet.schema(); - return new RowSetReaderImpl(schema, rowIndex, - buildContainerChildren(rowSet.container(), - new MetadataRetrieval(schema))); - } - } - - public AbstractSingleRowSet(AbstractSingleRowSet rowSet) { + protected AbstractSingleRowSet(AbstractSingleRowSet rowSet) { Review comment: I can live with this, though the nested-classes at top is a more common pattern in the Java community. The general rule is that constants and nested classes at top, then fields, then methods. Original Java formatters tended to put fields at the bottom. Some projects mix nested classes with methods: the class is defined adjacent to the method that uses it. I also recall that Arina once suggested removing an anonymous inner class in favor of a declared class. This is, again, a style issue since anonymous inner classes are a very common style, especially in UI and functional programming. In general, we need to establish rules for the project, else each person that touches the file will reformat code to their preferred style. We should discuss those rules on the dev list before we start enforcing them. ---------------------------------------------------------------- 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