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


Java Util.cellname方法代码示例

本文整理汇总了Java中org.apache.cassandra.Util.cellname方法的典型用法代码示例。如果您正苦于以下问题:Java Util.cellname方法的具体用法?Java Util.cellname怎么用?Java Util.cellname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.cassandra.Util的用法示例。


在下文中一共展示了Util.cellname方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCreate

import org.apache.cassandra.Util; //导入方法依赖的package包/类
@Test
public void testCreate()
{
    long delta = 3L;
    CounterCell cell = new BufferCounterCell(Util.cellname("x"),
                                       CounterContext.instance().createLocal(delta),
                                       1L,
                                       Long.MIN_VALUE);

    Assert.assertEquals(delta, cell.total());
    Assert.assertEquals(1, cell.value().getShort(0));
    Assert.assertEquals(0, cell.value().getShort(2));
    Assert.assertTrue(CounterId.wrap(cell.value(), 4).isLocalId());
    Assert.assertEquals(1L, cell.value().getLong(4 + idLength));
    Assert.assertEquals(delta, cell.value().getLong(4 + idLength + clockLength));
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:17,代码来源:CounterCellTest.java

示例2: testCommittingAfterTruncation

import org.apache.cassandra.Util; //导入方法依赖的package包/类
@Test
public void testCommittingAfterTruncation() throws Exception
{
    ColumnFamilyStore cfs = Keyspace.open("Keyspace1").getColumnFamilyStore("Standard1");
    DecoratedKey key = Util.dk("key" + System.nanoTime());
    CellName name = Util.cellname("col");
    ByteBuffer value = ByteBufferUtil.bytes(0);
    ColumnFamily update = ArrayBackedSortedColumns.factory.create(cfs.metadata);
    update.addColumn(name, value, FBUtilities.timestampMicros());

    // CFS should be empty initially
    assertNoDataPresent(cfs, key);

    // Commit the proposal & verify the data is present
    Commit beforeTruncate = newProposal(0, key.getKey(), update);
    PaxosState.commit(beforeTruncate);
    assertDataPresent(cfs, key, name, value);

    // Truncate then attempt to commit again, mutation should
    // be ignored as the proposal predates the truncation
    cfs.truncateBlocking();
    PaxosState.commit(beforeTruncate);
    assertNoDataPresent(cfs, key);

    // Now try again with a ballot created after the truncation
    long timestamp = SystemKeyspace.getTruncatedAt(update.metadata().cfId) + 1;
    Commit afterTruncate = newProposal(timestamp, key.getKey(), update);
    PaxosState.commit(afterTruncate);
    assertDataPresent(cfs, key, name, value);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:31,代码来源:PaxosStateTest.java

示例3: expiring

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private Cell expiring(String name, String value, long timestamp, int expirationTime, boolean nativeCell)
{
    ExpiringCell cell = new BufferExpiringCell(Util.cellname(name), ByteBufferUtil.bytes(value), timestamp, 1, expirationTime);
    if (nativeCell)
        cell = new NativeExpiringCell(allocator, order.getCurrent(), cell);
    return cell;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:CellTest.java

示例4: regular

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private Cell regular(String name, ByteBuffer value, long timestamp, boolean nativeCell)
{
    Cell cell = new BufferCell(Util.cellname(name), value, timestamp);
    if (nativeCell)
        cell = new NativeCell(allocator, order.getCurrent(), cell);
    return cell;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:CellTest.java

示例5: deleted

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private Cell deleted(String name, int localDeletionTime, long timestamp, boolean nativeCell)
{
    DeletedCell cell = new BufferDeletedCell(Util.cellname(name), localDeletionTime, timestamp);
    if (nativeCell)
        cell = new NativeDeletedCell(allocator, order.getCurrent(), cell);
    return cell;
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:8,代码来源:CellTest.java

示例6: dc

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private static BufferDeletedCell dc(String name, int ldt, long timestamp)
{
    return new BufferDeletedCell(Util.cellname(name), ldt, timestamp);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:RemoveCellTest.java

示例7: b

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private static Composite b(int i)
{
    return Util.cellname(i);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:RangeTombstoneListTest.java

示例8: cn

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private static CellName cn(long l)
{
    return Util.cellname(l);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:5,代码来源:IndexHelperTest.java


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