@Override public Object getMetaData(Column<ByteBuffer> element, EntryMetaData meta) { switch(meta) { case TIMESTAMP: return element.getTimestamp(); case TTL: return element.getTtl(); default: throw new UnsupportedOperationException("Unsupported meta data: " + meta); } } }
@Override public int getTtl() { return _oldColumn.getTtl(); }
@Override public int getTtl() { return _oldColumn.getTtl(); }
@Override public Object getMetaData(Column<ByteBuffer> element, EntryMetaData meta) { switch(meta) { case TIMESTAMP: return element.getTimestamp(); case TTL: return element.getTtl(); default: throw new UnsupportedOperationException("Unsupported meta data: " + meta); } } }
@Override public Object getMetaData(Column<ByteBuffer> element, EntryMetaData meta) { switch(meta) { case TIMESTAMP: return element.getTimestamp(); case TTL: return element.getTtl(); default: throw new UnsupportedOperationException("Unsupported meta data: " + meta); } } }
@Override public synchronized Boolean apply(Row<K, C> row) { long size = 0; for (Column<C> column : row.getColumns()) { size += column.getRawName().limit() + column.getByteBufferValue().limit(); } StringBuilder sb = new StringBuilder(); sb.append(String.format("- row: '%s' size: '%dl' count: '%dl' \n", row.getKey(), size, row.getColumns().size())); if (showColumns) { for (Column<C> column : row.getColumns()) { sb.append(String.format(" '%s' (ts='%dl', ttl='%d')\n", column.getName(), column.getTimestamp(), column.getTtl())); } } try { out.write(sb.toString().getBytes()); } catch (IOException e) { } return true; }
@Override public synchronized Boolean apply(Row<K, C> row) { long size = 0; for (Column<C> column : row.getColumns()) { size += column.getRawName().limit() + column.getByteBufferValue().limit(); } StringBuilder sb = new StringBuilder(); sb.append(String.format("- row: '%s' size: '%dl' count: '%dl' \n", row.getKey(), size, row.getColumns().size())); if (showColumns) { for (Column<C> column : row.getColumns()) { sb.append(String.format(" '%s' (ts='%dl', ttl='%d')\n", column.getName(), column.getTimestamp(), column.getTtl())); } } try { out.write(sb.toString().getBytes()); } catch (IOException e) { } return true; }
ttl = column.getTtl();
/** * 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()); } }
/** * 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()); } }
/** * 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()); } }
/** * 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()); } }
ByteBuffer data = null; for (Column<C> column : result) { if (column.getTtl() == 0) { if (hasColumn) { throw new IllegalStateException("Row has multiple uniquneness locks");
ByteBuffer data = null; for (Column<C> column : result) { if (column.getTtl() == 0) { if (hasColumn) { throw new IllegalStateException("Row has multiple uniquneness locks");
for (Column<C> column : row.getColumns()) { mbRow.setTimestamp(column.getTimestamp()); mbRow.putColumn(column.getName(), column.getByteBufferValue(), column.getTtl());
for (Column<C> column : row.getColumns()) { mbRow.setTimestamp(column.getTimestamp()); mbRow.putColumn(column.getName(), column.getByteBufferValue(), column.getTtl());
if (entry.getTtl() != 0) continue;
.putColumn(name, column.getByteBufferValue(), column.getTtl()); chunkMutation.withRow(destPlacement.getBlobColumnFamily(), newRowKey) .setTimestamp(chunk.getTimestamp()) .putEmptyColumn(getColumn(ColumnGroup.B, chunkId), chunk.getTtl()) .putColumn(getColumn(ColumnGroup.Z, chunkId), chunk.getByteBufferValue(), chunk.getTtl()); progress.run(); execute(chunkMutation);
@Override public Message peekMessageByKey(String key) throws MessageQueueException { String groupRowKey = getCompositeKey(getName(), key); try { ColumnList<MessageMetadataEntry> columns = keyspace.prepareQuery(keyIndexColumnFamily) .setConsistencyLevel(consistencyLevel) .getRow(groupRowKey) .withColumnRange(metadataSerializer.buildRange() .greaterThanEquals((byte)MessageMetadataEntryType.MessageId.ordinal()) .lessThanEquals((byte)MessageMetadataEntryType.MessageId.ordinal()) .build() ) .execute() .getResult(); for (Column<MessageMetadataEntry> entry : columns) { if (entry.getTtl() != 0) continue; // Return the first one we get. Hmmm... maybe we want to do some validation checks here return peekMessage(entry.getName().getName()); } return null; } catch (NotFoundException e) { return null; } catch (ConnectionException e) { throw new MessageQueueException("Error fetching row " + groupRowKey, e); } }
for (Column<MessageMetadataEntry> currMessageEntry : columns) { MessageQueueEntry pendingMessageEntry = MessageQueueEntry.fromMetadata(currMessageEntry.getName()); if (currMessageEntry.getTtl() == 0) { long currMessageTriggerTime = pendingMessageEntry.getTimestamp(TimeUnit.MICROSECONDS);