/** * Initialize this node sequence only the first time that {@link #nextBatch()} is called. * * @return the iterator over the buffered rows in this sequence; may be null if this sequence is empty */ protected Iterator<BufferedRow> initialize() { // Load everthing into the buffer ... batchSize = loadAll(delegate, extractor, rowsWithNullKey); remainingRowCount.set(buffer.size() + rowsWithNullKey.size()); // We always return the buffered rows in ascending order of the extracted key ... if (rowsWithNullKey.isEmpty()) { return buffer.ascending(); } // Return the rows with NULL first ... assert nullOrder != null; switch (nullOrder) { case NULLS_FIRST: return SequentialIterator.create(rowsWithNullKey.iterator(), buffer.ascending()); case NULLS_LAST: return SequentialIterator.create(buffer.ascending(), rowsWithNullKey.iterator()); } assert false; return null; }
/** * Initialize this node sequence only the first time that {@link #nextBatch()} is called. * * @return the iterator over the buffered rows in this sequence; may be null if this sequence is empty */ protected Iterator<BufferedRow> initialize() { // Load everthing into the buffer ... batchSize = loadAll(delegate, extractor, rowsWithNullKey); remainingRowCount.set(buffer.size() + rowsWithNullKey.size()); // We always return the buffered rows in ascending order of the extracted key ... if (rowsWithNullKey.isEmpty()) { return buffer.ascending(); } // Return the rows with NULL first ... assert nullOrder != null; switch (nullOrder) { case NULLS_FIRST: return SequentialIterator.create(rowsWithNullKey.iterator(), buffer.ascending()); case NULLS_LAST: return SequentialIterator.create(buffer.ascending(), rowsWithNullKey.iterator()); } assert false; return null; }
protected Iterator<BufferedRow> allRightRows() { if (rightRowsWithNullKey != null) { return SequentialIterator.create(rightRowsWithNullKey.iterator(), buffer.ascending()); } return buffer.ascending(); }
protected Iterator<BufferedRow> allRightRows() { if (rightRowsWithNullKey != null) { return SequentialIterator.create(rightRowsWithNullKey.iterator(), buffer.ascending()); } return buffer.ascending(); }