本文整理汇总了Java中org.apache.cassandra.db.ColumnFamily.cloneMeShallow方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnFamily.cloneMeShallow方法的具体用法?Java ColumnFamily.cloneMeShallow怎么用?Java ColumnFamily.cloneMeShallow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.cassandra.db.ColumnFamily
的用法示例。
在下文中一共展示了ColumnFamily.cloneMeShallow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: prune
import org.apache.cassandra.db.ColumnFamily; //导入方法依赖的package包/类
public ColumnFamily prune(DecoratedKey rowKey, ColumnFamily data)
{
if (optimizedFilter == null)
return data;
ColumnFamily pruned = data.cloneMeShallow();
IDiskAtomFilter filter = dataRange.columnFilter(rowKey.getKey());
Iterator<Cell> iter = filter.getColumnIterator(data);
filter.collectReducedColumns(pruned, QueryFilter.gatherTombstones(pruned, iter), cfs.gcBefore(timestamp), timestamp);
return pruned;
}
示例2: augment
import org.apache.cassandra.db.ColumnFamily; //导入方法依赖的package包/类
public Collection<Mutation> augment(ByteBuffer key, ColumnFamily update)
{
ColumnFamily extraUpdate = update.cloneMeShallow(ArrayBackedSortedColumns.factory, false);
extraUpdate.addColumn(new BufferCell(update.metadata().comparator.makeCellName(bytes("v2")), bytes(999)));
int newKey = toInt(key) + 1000;
return Collections.singletonList(new Mutation(ksName, bytes(newKey), extraUpdate));
}
示例3: updatesWithPaxosTime
import org.apache.cassandra.db.ColumnFamily; //导入方法依赖的package包/类
private static ColumnFamily updatesWithPaxosTime(ColumnFamily updates, UUID ballot)
{
ColumnFamily cf = updates.cloneMeShallow();
long t = UUIDGen.microsTimestamp(ballot);
// For the tombstones, we use t-1 so that when insert a collection literall, the range tombstone that deletes the previous values of
// the collection and we want that to have a lower timestamp and our new values. Since tombstones wins over normal insert, using t-1
// should not be a problem in general (see #6069).
cf.deletionInfo().updateAllTimestamp(t-1);
for (Column column : updates)
cf.addAtom(column.withUpdatedTimestamp(t));
return cf;
}