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


Java Util.writeColumnFamily方法代码示例

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


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

示例1: testGetColumnWithWrongBF

import org.apache.cassandra.Util; //导入方法依赖的package包/类
@Test
public void testGetColumnWithWrongBF()
{
    Keyspace keyspace = Keyspace.open("Keyspace1");
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore("Standard1");
    cfs.truncateBlocking();

    List<Mutation> rms = new LinkedList<>();
    Mutation rm = new Mutation("Keyspace1", ByteBufferUtil.bytes("key1"));
    rm.add("Standard1", cellname("Column1"), ByteBufferUtil.bytes("asdf"), 0);
    rm.add("Standard1", cellname("Column2"), ByteBufferUtil.bytes("asdf"), 0);
    rms.add(rm);
    Util.writeColumnFamily(rms);

    List<SSTableReader> ssTables = keyspace.getAllSSTables();
    assertEquals(1, ssTables.size());
    ssTables.get(0).forceFilterFailures();
    ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(Util.dk("key2"), "Standard1", System.currentTimeMillis()));
    assertNull(cf);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:21,代码来源:ColumnFamilyStoreTest.java

示例2: testGetColumnWithWrongBF

import org.apache.cassandra.Util; //导入方法依赖的package包/类
@Test
public void testGetColumnWithWrongBF() throws IOException, ExecutionException, InterruptedException
{
    Keyspace keyspace = Keyspace.open("Keyspace1");
    ColumnFamilyStore cfs = keyspace.getColumnFamilyStore("Standard1");
    cfs.truncateBlocking();

    List<IMutation> rms = new LinkedList<IMutation>();
    RowMutation rm;
    rm = new RowMutation("Keyspace1", ByteBufferUtil.bytes("key1"));
    rm.add("Standard1", ByteBufferUtil.bytes("Column1"), ByteBufferUtil.bytes("asdf"), 0);
    rm.add("Standard1", ByteBufferUtil.bytes("Column2"), ByteBufferUtil.bytes("asdf"), 0);
    rms.add(rm);
    Util.writeColumnFamily(rms);

    List<SSTableReader> ssTables = keyspace.getAllSSTables();
    assertEquals(1, ssTables.size());
    ssTables.get(0).forceFilterFailures();
    ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(Util.dk("key2"), "Standard1", System.currentTimeMillis()));
    assertNull(cf);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:22,代码来源:ColumnFamilyStoreTest.java

示例3: insertKey1Key2

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private ColumnFamilyStore insertKey1Key2()
{
    ColumnFamilyStore cfs = Keyspace.open("Keyspace2").getColumnFamilyStore("Standard1");
    List<Mutation> rms = new LinkedList<>();
    Mutation rm;
    rm = new Mutation("Keyspace2", ByteBufferUtil.bytes("key1"));
    rm.add("Standard1", cellname("Column1"), ByteBufferUtil.bytes("asdf"), 0);
    rms.add(rm);
    Util.writeColumnFamily(rms);

    rm = new Mutation("Keyspace2", ByteBufferUtil.bytes("key2"));
    rm.add("Standard1", cellname("Column1"), ByteBufferUtil.bytes("asdf"), 0);
    rms.add(rm);
    return Util.writeColumnFamily(rms);
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:16,代码来源:ColumnFamilyStoreTest.java

示例4: insertKey1Key2

import org.apache.cassandra.Util; //导入方法依赖的package包/类
private ColumnFamilyStore insertKey1Key2() throws IOException, ExecutionException, InterruptedException
{
    List<IMutation> rms = new LinkedList<IMutation>();
    RowMutation rm;
    rm = new RowMutation("Keyspace2", ByteBufferUtil.bytes("key1"));
    rm.add("Standard1", ByteBufferUtil.bytes("Column1"), ByteBufferUtil.bytes("asdf"), 0);
    rms.add(rm);
    Util.writeColumnFamily(rms);

    rm = new RowMutation("Keyspace2", ByteBufferUtil.bytes("key2"));
    rm.add("Standard1", ByteBufferUtil.bytes("Column1"), ByteBufferUtil.bytes("asdf"), 0);
    rms.add(rm);
    return Util.writeColumnFamily(rms);
}
 
开发者ID:pgaref,项目名称:ACaZoo,代码行数:15,代码来源:ColumnFamilyStoreTest.java


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