当前位置: 首页>>代码示例>>Java>>正文


Java DeletionInfo类代码示例

本文整理汇总了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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:17,代码来源:RowResolverTest.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:17,代码来源:RowResolverTest.java

示例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);
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:17,代码来源:RowResolverTest.java

示例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);
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:19,代码来源:RowResolverTest.java

示例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);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:12,代码来源:ImmutableBTreePartition.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:35,代码来源:AbstractCType.java

示例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());
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:9,代码来源:QueryFilter.java

示例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++;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:ColumnCounter.java

示例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;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:11,代码来源:ColumnCounter.java

示例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);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:28,代码来源:RowResolverTest.java

示例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++;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:8,代码来源:ColumnCounter.java

示例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;
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:11,代码来源:ColumnCounter.java

示例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);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:28,代码来源:RowResolverTest.java

示例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);
}
 
开发者ID:daidong,项目名称:GraphTrek,代码行数:28,代码来源:RowResolverTest.java

示例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;
}
 
开发者ID:dprguiuc,项目名称:Cassandra-Wasef,代码行数:12,代码来源:MetadataRegistry.java


注:本文中的org.apache.cassandra.db.DeletionInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。