private static long getCqlRowSize(CqlRow cqlRow) { if (cqlRow == null) { return getNullSize(); } return getByteArraySize(cqlRow.getKey()) + getCollectionSize(cqlRow.getColumns(), ThriftObjectSizeUtils::getColumnSize); }
for (Iterator<CqlRow> rowsIter = result.getRowsIterator(); rowsIter.hasNext(); ) { CqlRow row = rowsIter.next(); ByteBuffer kbb = ByteBuffer.wrap(row.getKey());
public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); case COLUMNS: return getColumns(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); case COLUMNS: return getColumns(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case KEY: return getKey(); case COLUMNS: return getColumns(); } throw new IllegalStateException(); }
CqlResult result = executeQuery("select * from ColumnFamily"); for (CqlRow row : result.getRows()) { System.out.println(new String (row.getKey())); }
private final void populateColumns() { // clear column value tables values.clear(); indexMap.clear(); CqlRow row = rowsIterator.next(); curRowKey = row.getKey(); List<Column> cols = row.getColumns(); // loop through the columns for (Column col : cols) { TypedColumn c = createColumn(col); String columnName = c.getNameString(); values.add(c); indexMap.put(columnName, values.size()); // one greater than 0 based index of a list } }
public ThriftCqlRowsImpl(final List<CqlRow> rows, final Serializer<K> keySer, final Serializer<C> colSer) { this.rows = Lists.newArrayListWithCapacity(rows.size()); for (CqlRow row : rows) { byte[] keyBytes = row.getKey(); if (keyBytes == null || keyBytes.length == 0) { this.rows.add(new ThriftRowImpl<K, C>(null, null, new ThriftColumnListImpl<C>(row.getColumns(), colSer))); } else { this.rows.add(new ThriftRowImpl<K, C>(keySer .fromBytes(keyBytes), ByteBuffer.wrap(keyBytes), new ThriftColumnListImpl<C>(row.getColumns(), colSer))); } } }
public ThriftCqlRowsImpl(final List<CqlRow> rows, final Serializer<K> keySer, final Serializer<C> colSer) { this.rows = Lists.newArrayListWithCapacity(rows.size()); for (CqlRow row : rows) { byte[] keyBytes = row.getKey(); if (keyBytes == null || keyBytes.length == 0) { this.rows.add(new ThriftRowImpl<K, C>(null, null, new ThriftColumnListImpl<C>(row.getColumns(), colSer))); } else { this.rows.add(new ThriftRowImpl<K, C>(keySer .fromBytes(keyBytes), ByteBuffer.wrap(keyBytes), new ThriftColumnListImpl<C>(row.getColumns(), colSer))); } } }
private static long getCqlRowSize(CqlRow cqlRow) { if (cqlRow == null) { return getNullSize(); } return getByteArraySize(cqlRow.getKey()) + getCollectionSize(cqlRow.getColumns(), ThriftObjectSizeUtils::getColumnSize); }
ret.put(ByteBuffer.wrap(row.getKey()), filterKeyColumn(row));
for (Iterator<CqlRow> rowsIter = result.getRowsIterator(); rowsIter.hasNext(); ) { CqlRow row = rowsIter.next(); ByteBuffer kbb = ByteBuffer.wrap(row.getKey());