@Override public ByteBuffer getColumn(Column<ByteBuffer> element) { return element.getName(); }
@Override public String parseColumn( final Column<String> column ) { return column.getName(); }
@Override public Long parseColumn( final Column<Long> column ) { return column.getName(); } };
@Override public Long parseColumn( final Column<Long> column ) { return column.getName(); } };
@Override public Long parseColumn( final Column<Long> column ) { return column.getName(); } };
@Override public Long parseColumn( final Column<Long> column ) { return column.getName(); } };
@Override public Long parseColumn( final Column<Long> column ) { return column.getName(); } };
private List<MvccLogEntry> parseResults( final ColumnList<UUID> columns, final Id entityId ) { List<MvccLogEntry> results = new ArrayList<MvccLogEntry>( columns.size() ); for ( Column<UUID> col : columns ) { final UUID storedVersion = col.getName(); final StageStatus stage = col.getValue( SER ); results.add( new MvccLogEntryImpl( entityId, storedVersion, stage.stage, stage.state ) ); } return results; }
@Override public T parseColumn( final Column<C> column ) { final C edge = column.getName(); return createEdge( edge, column.getBooleanValue() ); }
@Override public MvccEntity parseColumn( Column<UUID> column ) { final EntityWrapper deSerialized; final UUID version = column.getName(); try { deSerialized = column.getValue( entityJsonSerializer ); } catch ( DataCorruptionException e ) { logger.error( "DATA CORRUPTION DETECTED when de-serializing entity with Id {} and version {}. This means the write was truncated.", id, version, e ); //return an empty entity, we can never load this one, and we don't want it to bring the system //to a grinding halt return new MvccEntityImpl( id, version, MvccEntity.Status.DELETED, Optional.<Entity>absent(),0 ); } //Inject the id into it. if ( deSerialized.entity.isPresent() ) { EntityUtils.setId( deSerialized.entity.get(), id ); } return new MvccEntityImpl( id, version, deSerialized.status, deSerialized.entity, 0 ); } }
final UUID version = column.getName();
return new Shard(column.getName(), column.getTimestamp(), column.getBooleanValue());
Locator locator = column.getName(); work.add(new ReRollWork(locator, gran, new Range(START_MILLIS, STOP_MILLIS)));
assertEquals( colName, column.getName() ); assertTrue( column.getBooleanValue() );
@Override public N getName() { return (N)getCmbComposite(astyanaxColumn.getName()); } @Override
private <T> void testColumnValue(ColumnList<String> result, String columnName, List<String> columnNames, T expectedValue) { // by column name Column<String> column = result.getColumnByName(columnName); Assert.assertEquals(columnName, column.getName()); testColumnValue(column, expectedValue); // // by column index // int index = columnNames.indexOf(columnName); // column = result.getColumnByIndex(index); // testColumnValue(column, expectedValue); }
@Override public SortedMap<String, String> getCheckpoints() throws ConnectionException { SortedMap<String, String> checkpoints = Maps.newTreeMap(tokenComparator); for (Column<String> column : keyspace.prepareQuery(columnFamily).getKey(bbKey).execute().getResult()) { checkpoints.put(column.getName(), column.getStringValue()); } return checkpoints; }
@Nullable @Override public ByteBuffer findMinRecord(UUID dataId, @Nullable ByteBuffer from) { // Use a column range with a "start" to skip past tombstones. ColumnList<ByteBuffer> columns = execute(_keyspace.prepareQuery(CF_DEDUP_DATA, ConsistencyLevel.CL_LOCAL_QUORUM) .getKey(dataId) .withColumnRange(new RangeBuilder() .setStart(Objects.firstNonNull(from, EMPTY_BUFFER)) .setLimit(1) .build())); return !columns.isEmpty() ? columns.getColumnByIndex(0).getName() : null; }
/** * Copies columns exactly, preserving Cassandra timestamp and ttl values. */ private <C> void putAll(ColumnListMutation<C> mutation, Iterable<Column<C>> columns) { for (Column<C> column : columns) { mutation.setTimestamp(column.getTimestamp()) .putColumn(column.getName(), column.getByteBufferValue(), column.getTtl()); } }