protected CQL3Row computeNext() { while (hasNextCell()) { CQL3Row toReturn = null; CellName current = nextCell.name(); if (currentRow == null || !current.isSameCQL3RowAs(type, previous)) { toReturn = currentRow; currentRow = new CQL3RowOfSparse(cfMetaData, current); } currentRow.add(nextCell); nextCell = null; previous = current; if (toReturn != null) return toReturn; } if (currentRow != null) { CQL3Row toReturn = currentRow; currentRow = null; return toReturn; } return endOfData(); } }
protected boolean containsPreviousLast(Row first) { if (lastReturned == null) return false; Cell firstCell = isReversed() ? lastCell(first.cf) : firstNonStaticCell(first.cf); // If the row was containing only static columns it has already been returned and we can skip it. if (firstCell == null) return true; CFMetaData metadata = Schema.instance.getCFMetaData(command.getKeyspace(), command.getColumnFamilyName()); // Note: we only return true if the column is the lastReturned *and* it is live. If it is deleted, it is ignored by the // rest of the paging code (it hasn't been counted as live in particular) and we want to act as if it wasn't there. return !first.cf.deletionInfo().isDeleted(firstCell) && firstCell.isLive(timestamp()) && firstCell.name().isSameCQL3RowAs(metadata.comparator, lastReturned); }
protected boolean containsPreviousLast(Row first) { if (lastReturnedKey == null || !lastReturnedKey.equals(first.key)) return false; // If the query is a DISTINCT one we can stop there if (isDistinct()) return true; // Same as SliceQueryPager, we ignore a deleted column Cell firstCell = isReversed() ? lastCell(first.cf) : firstNonStaticCell(first.cf); // If the row was containing only static columns it has already been returned and we can skip it. if (firstCell == null) return true; CFMetaData metadata = Schema.instance.getCFMetaData(command.keyspace, command.columnFamily); return !first.cf.deletionInfo().isDeleted(firstCell) && firstCell.isLive(timestamp()) && firstCell.name().isSameCQL3RowAs(metadata.comparator, lastReturnedName); }