private static Iterator<Cell> getCells(Row row, ColumnDefinition column) { // If we're asking for a complex cells, and we didn't got any row from our read, it's // the same as not having any cells for that column. if (row == null) return Collections.<Cell>emptyIterator(); ComplexColumnData complexData = row.getComplexColumnData(column); return complexData == null ? Collections.<Cell>emptyIterator() : complexData.iterator(); }
private Iterator<Cell> makeComplexIterator(Object complexData) { ComplexColumnData ccd = (ComplexColumnData)complexData; return reversed ? ccd.reverseIterator() : ccd.iterator(); }
private static Iterator<Cell> getCells(Row row, ColumnDefinition column) { // If we're asking for a complex cells, and we didn't got any row from our read, it's // the same as not having any cells for that column. if (row == null) return Collections.<Cell>emptyIterator(); ComplexColumnData complexData = row.getComplexColumnData(column); return complexData == null ? Collections.<Cell>emptyIterator() : complexData.iterator(); }
private static Iterator<Cell> getCells(Row row, ColumnDefinition column) { // If we're asking for a complex cells, and we didn't got any row from our read, it's // the same as not having any cells for that column. if (row == null) return Collections.<Cell>emptyIterator(); ComplexColumnData complexData = row.getComplexColumnData(column); return complexData == null ? Collections.<Cell>emptyIterator() : complexData.iterator(); }
private Iterator<Cell> makeComplexIterator(Object complexData) { ComplexColumnData ccd = (ComplexColumnData)complexData; return reversed ? ccd.reverseIterator() : ccd.iterator(); }
private Iterator<Cell> makeComplexIterator(Object complexData) { ComplexColumnData ccd = (ComplexColumnData)complexData; return reversed ? ccd.reverseIterator() : ccd.iterator(); }
private Iterator<Cell> makeComplexIterator(Object complexData) { ComplexColumnData ccd = (ComplexColumnData)complexData; return reversed ? ccd.reverseIterator() : ccd.iterator(); }
protected Cell computeNext() { while (true) { if (complexCells != null) { if (complexCells.hasNext()) return complexCells.next(); complexCells = null; } if (!columnData.hasNext()) return endOfData(); ColumnData cd = columnData.next(); if (cd.column().isComplex()) complexCells = ((ComplexColumnData)cd).iterator(); else return (Cell)cd; } } }
protected Cell computeNext() { while (true) { if (complexCells != null) { if (complexCells.hasNext()) return complexCells.next(); complexCells = null; } if (!columnData.hasNext()) return endOfData(); ColumnData cd = columnData.next(); if (cd.column().isComplex()) complexCells = ((ComplexColumnData)cd).iterator(); else return (Cell)cd; } } }
protected Cell computeNext() { while (true) { if (complexCells != null) { if (complexCells.hasNext()) return complexCells.next(); complexCells = null; } if (!columnData.hasNext()) return endOfData(); ColumnData cd = columnData.next(); if (cd.column().isComplex()) complexCells = ((ComplexColumnData)cd).iterator(); else return (Cell)cd; } } }
protected Cell computeNext() { while (true) { if (complexCells != null) { if (complexCells.hasNext()) return complexCells.next(); complexCells = null; } if (!columnData.hasNext()) return endOfData(); ColumnData cd = columnData.next(); if (cd.column().isComplex()) complexCells = ((ComplexColumnData)cd).iterator(); else return (Cell)cd; } } }
private static void addValue(Selection.ResultSetBuilder result, ColumnDefinition def, Row row, int nowInSec, ProtocolVersion protocolVersion) { if (def.isComplex()) { assert def.type.isMultiCell(); ComplexColumnData complexData = row.getComplexColumnData(def); if (complexData == null) result.add(null); else if (def.type.isCollection()) result.add(((CollectionType) def.type).serializeForNativeProtocol(complexData.iterator(), protocolVersion)); else result.add(((UserType) def.type).serializeForNativeProtocol(complexData.iterator(), protocolVersion)); } else { result.add(row.getCell(def), nowInSec); } }
private static void addValue(Selection.ResultSetBuilder result, ColumnDefinition def, Row row, int nowInSec, ProtocolVersion protocolVersion) { if (def.isComplex()) { assert def.type.isMultiCell(); ComplexColumnData complexData = row.getComplexColumnData(def); if (complexData == null) result.add(null); else if (def.type.isCollection()) result.add(((CollectionType) def.type).serializeForNativeProtocol(complexData.iterator(), protocolVersion)); else result.add(((UserType) def.type).serializeForNativeProtocol(complexData.iterator(), protocolVersion)); } else { result.add(row.getCell(def), nowInSec); } }
private static void addValue(Selection.ResultSetBuilder result, ColumnDefinition def, Row row, int nowInSec, ProtocolVersion protocolVersion) { if (def.isComplex()) { assert def.type.isMultiCell(); ComplexColumnData complexData = row.getComplexColumnData(def); if (complexData == null) result.add(null); else if (def.type.isCollection()) result.add(((CollectionType) def.type).serializeForNativeProtocol(complexData.iterator(), protocolVersion)); else result.add(((UserType) def.type).serializeForNativeProtocol(complexData.iterator(), protocolVersion)); } else { result.add(row.getCell(def), nowInSec); } }
public static Row fromInternalRow(CFMetaData metadata, DecoratedKey key, org.apache.cassandra.db.rows.Row row) { Map<String, ByteBuffer> data = new HashMap<>(); ByteBuffer[] keyComponents = SelectStatement.getComponents(metadata, key); for (ColumnDefinition def : metadata.partitionKeyColumns()) data.put(def.name.toString(), keyComponents[def.position()]); Clustering clustering = row.clustering(); for (ColumnDefinition def : metadata.clusteringColumns()) data.put(def.name.toString(), clustering.get(def.position())); for (ColumnDefinition def : metadata.partitionColumns()) { if (def.isSimple()) { Cell cell = row.getCell(def); if (cell != null) data.put(def.name.toString(), cell.value()); } else { ComplexColumnData complexData = row.getComplexColumnData(def); if (complexData != null) data.put(def.name.toString(), ((CollectionType)def.type).serializeForNativeProtocol(complexData.iterator(), ProtocolVersion.V3)); } } return new Row(data); }
public static Row fromInternalRow(CFMetaData metadata, DecoratedKey key, org.apache.cassandra.db.rows.Row row) { Map<String, ByteBuffer> data = new HashMap<>(); ByteBuffer[] keyComponents = SelectStatement.getComponents(metadata, key); for (ColumnDefinition def : metadata.partitionKeyColumns()) data.put(def.name.toString(), keyComponents[def.position()]); Clustering clustering = row.clustering(); for (ColumnDefinition def : metadata.clusteringColumns()) data.put(def.name.toString(), clustering.get(def.position())); for (ColumnDefinition def : metadata.partitionColumns()) { if (def.isSimple()) { Cell cell = row.getCell(def); if (cell != null) data.put(def.name.toString(), cell.value()); } else { ComplexColumnData complexData = row.getComplexColumnData(def); if (complexData != null) data.put(def.name.toString(), ((CollectionType)def.type).serializeForNativeProtocol(complexData.iterator(), ProtocolVersion.V3)); } } return new Row(data); }
public static Row fromInternalRow(CFMetaData metadata, DecoratedKey key, org.apache.cassandra.db.rows.Row row) { Map<String, ByteBuffer> data = new HashMap<>(); ByteBuffer[] keyComponents = SelectStatement.getComponents(metadata, key); for (ColumnDefinition def : metadata.partitionKeyColumns()) data.put(def.name.toString(), keyComponents[def.position()]); Clustering clustering = row.clustering(); for (ColumnDefinition def : metadata.clusteringColumns()) data.put(def.name.toString(), clustering.get(def.position())); for (ColumnDefinition def : metadata.partitionColumns()) { if (def.isSimple()) { Cell cell = row.getCell(def); if (cell != null) data.put(def.name.toString(), cell.value()); } else { ComplexColumnData complexData = row.getComplexColumnData(def); if (complexData != null) data.put(def.name.toString(), ((CollectionType)def.type).serializeForNativeProtocol(complexData.iterator(), ProtocolVersion.V3)); } } return new Row(data); }
if (cd.complexDeletion().supersedes(complexDeletion)) complexDeletion = cd.complexDeletion(); complexCells.add(cd.iterator());
dynamicCells = Iterators.peekingIterator(complexData.iterator()); builder.addComplexDeletion(superColumnMapColumn, complexData.complexDeletion());
dynamicCells = Iterators.peekingIterator(complexData.iterator()); builder.addComplexDeletion(superColumnMapColumn, complexData.complexDeletion());