本文整理汇总了Java中org.apache.cassandra.db.DeletionInfo类的典型用法代码示例。如果您正苦于以下问题:Java DeletionInfo类的具体用法?Java DeletionInfo怎么用?Java DeletionInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DeletionInfo类属于org.apache.cassandra.db包,在下文中一共展示了DeletionInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testResolveDeleted
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveDeleted()
{
// one CF with columns timestamped before a delete in another cf
ColumnFamily cf1 = ArrayBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf1.addColumn(column("one", "A", 0));
ColumnFamily cf2 = ArrayBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf2.delete(new DeletionInfo(1L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2), System.currentTimeMillis());
// no columns in the cf
assertColumns(resolved);
assertTrue(resolved.isMarkedForDelete());
assertEquals(1, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例2: testResolveDeleted
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveDeleted()
{
// one CF with columns timestamped before a delete in another cf
ColumnFamily cf1 = TreeMapBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf1.addColumn(column("one", "A", 0));
ColumnFamily cf2 = TreeMapBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf2.delete(new DeletionInfo(1L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2), System.currentTimeMillis());
// no columns in the cf
assertColumns(resolved);
assertTrue(resolved.isMarkedForDelete());
assertEquals(1, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例3: testResolveDeleted
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveDeleted()
{
// one CF with columns timestamped before a delete in another cf
ColumnFamily cf1 = ArrayBackedSortedColumns.factory.create(KEYSPACE1, "Standard1");
cf1.addColumn(column("one", "A", 0));
ColumnFamily cf2 = ArrayBackedSortedColumns.factory.create(KEYSPACE1, "Standard1");
cf2.delete(new DeletionInfo(1L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2), System.currentTimeMillis());
// no columns in the cf
assertColumns(resolved);
assertTrue(resolved.isMarkedForDelete());
assertEquals(1, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例4: testResolveDeletedSuper
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveDeletedSuper()
{
// subcolumn is newer than a tombstone on its parent, but not newer than the row deletion
ColumnFamily scf1 = ColumnFamily.create("Keyspace1", "Super1");
SuperColumn sc = superColumn(scf1, "super-foo", column("one", "A", 1));
sc.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));
scf1.addColumn(sc);
ColumnFamily scf2 = ColumnFamily.create("Keyspace1", "Super1");
scf2.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily superResolved = RowDataResolver.resolveSuperset(Arrays.asList(scf1, scf2));
// no columns in the cf
assertColumns(superResolved);
assertTrue(superResolved.isMarkedForDelete());
assertEquals(2, superResolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例5: ImmutableBTreePartition
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public ImmutableBTreePartition(CFMetaData metadata,
DecoratedKey partitionKey,
PartitionColumns columns,
Row staticRow,
Object[] tree,
DeletionInfo deletionInfo,
EncodingStats stats)
{
super(metadata, partitionKey);
this.holder = new Holder(columns, tree, deletionInfo, staticRow, stats);
}
示例6: AbstractCType
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
protected AbstractCType(boolean isByteOrderComparable)
{
reverseComparator = new Comparator<Composite>()
{
public int compare(Composite c1, Composite c2)
{
return AbstractCType.this.compare(c2, c1);
}
};
indexComparator = new Comparator<IndexInfo>()
{
public int compare(IndexInfo o1, IndexInfo o2)
{
return AbstractCType.this.compare(o1.lastName, o2.lastName);
}
};
indexReverseComparator = new Comparator<IndexInfo>()
{
public int compare(IndexInfo o1, IndexInfo o2)
{
return AbstractCType.this.compare(o1.firstName, o2.firstName);
}
};
serializer = new Serializer(this);
indexSerializer = new IndexInfo.Serializer(this);
sliceSerializer = new ColumnSlice.Serializer(this);
sliceQueryFilterSerializer = new SliceQueryFilter.Serializer(this);
deletionInfoSerializer = new DeletionInfo.Serializer(this);
rangeTombstoneSerializer = new RangeTombstone.Serializer(this);
rowIndexEntrySerializer = new RowIndexEntry.Serializer(this);
this.isByteOrderComparable = isByteOrderComparable;
}
示例7: delete
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public void delete(DeletionInfo target, ColumnFamily source)
{
target.add(source.deletionInfo().getTopLevelDeletion());
// source is the CF currently in the memtable, and it can be large compared to what the filter selects,
// so only consider those range tombstones that the filter do select.
for (Iterator<RangeTombstone> iter = filter.getRangeTombstoneIterator(source); iter.hasNext(); )
target.add(iter.next(), source.getComparator());
}
示例8: count
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public void count(Cell cell, DeletionInfo.InOrderTester tester)
{
if (!isLive(cell, tester, timestamp))
ignored++;
else
live++;
}
示例9: countAll
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public ColumnCounter countAll(ColumnFamily container)
{
if (container == null)
return this;
DeletionInfo.InOrderTester tester = container.inOrderDeletionTester();
for (Cell c : container)
count(c, tester);
return this;
}
示例10: testResolveMultipleDeleted
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveMultipleDeleted()
{
// deletes and columns with interleaved timestamp, with out of order return sequence
ColumnFamily cf1 = ArrayBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf1.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));
// these columns created after the previous deletion
ColumnFamily cf2 = ArrayBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf2.addColumn(column("one", "A", 1));
cf2.addColumn(column("two", "A", 1));
//this column created after the next delete
ColumnFamily cf3 = ArrayBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf3.addColumn(column("two", "B", 3));
ColumnFamily cf4 = ArrayBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2, cf3, cf4), System.currentTimeMillis());
// will have deleted marker and one column
assertColumns(resolved, "two");
assertColumn(resolved, "two", "B", 3);
assertTrue(resolved.isMarkedForDelete());
assertEquals(2, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例11: count
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public void count(Column column, DeletionInfo.InOrderTester tester)
{
if (!isLive(column, tester, timestamp))
ignored++;
else
live++;
}
示例12: countAll
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public ColumnCounter countAll(ColumnFamily container)
{
if (container == null)
return this;
DeletionInfo.InOrderTester tester = container.inOrderDeletionTester();
for (Column c : container)
count(c, tester);
return this;
}
示例13: testResolveMultipleDeleted
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveMultipleDeleted()
{
// deletes and columns with interleaved timestamp, with out of order return sequence
ColumnFamily cf1 = TreeMapBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf1.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));
// these columns created after the previous deletion
ColumnFamily cf2 = TreeMapBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf2.addColumn(column("one", "A", 1));
cf2.addColumn(column("two", "A", 1));
//this column created after the next delete
ColumnFamily cf3 = TreeMapBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf3.addColumn(column("two", "B", 3));
ColumnFamily cf4 = TreeMapBackedSortedColumns.factory.create("Keyspace1", "Standard1");
cf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2, cf3, cf4), System.currentTimeMillis());
// will have deleted marker and one column
assertColumns(resolved, "two");
assertColumn(resolved, "two", "B", 3);
assertTrue(resolved.isMarkedForDelete());
assertEquals(2, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例14: testResolveMultipleDeleted
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
@Test
public void testResolveMultipleDeleted()
{
// deletes and columns with interleaved timestamp, with out of order return sequence
ColumnFamily cf1 = ArrayBackedSortedColumns.factory.create(KEYSPACE1, "Standard1");
cf1.delete(new DeletionInfo(0L, (int) (System.currentTimeMillis() / 1000)));
// these columns created after the previous deletion
ColumnFamily cf2 = ArrayBackedSortedColumns.factory.create(KEYSPACE1, "Standard1");
cf2.addColumn(column("one", "A", 1));
cf2.addColumn(column("two", "A", 1));
//this column created after the next delete
ColumnFamily cf3 = ArrayBackedSortedColumns.factory.create(KEYSPACE1, "Standard1");
cf3.addColumn(column("two", "B", 3));
ColumnFamily cf4 = ArrayBackedSortedColumns.factory.create(KEYSPACE1, "Standard1");
cf4.delete(new DeletionInfo(2L, (int) (System.currentTimeMillis() / 1000)));
ColumnFamily resolved = RowDataResolver.resolveSuperset(Arrays.asList(cf1, cf2, cf3, cf4), System.currentTimeMillis());
// will have deleted marker and one column
assertColumns(resolved, "two");
assertColumn(resolved, "two", "B", 3);
assertTrue(resolved.isMarkedForDelete());
assertEquals(2, resolved.deletionInfo().getTopLevelDeletion().markedForDeleteAt);
}
示例15: drop
import org.apache.cassandra.db.DeletionInfo; //导入依赖的package包/类
public RowMutation drop(String target) {
long timestamp = FBUtilities.timestampMicros();
RowMutation rm = new RowMutation(Metadata.MetaData_KS, ByteBufferUtil.bytes(target)); // row key
ColumnFamily cf = rm.addOrGet(CFMetaData.MetadataRegistryCf);
int ldt = (int) (System.currentTimeMillis() / 1000);
cf.delete(new DeletionInfo(timestamp, ldt));
return rm;
}