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


Java BTree.empty方法代码示例

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


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

示例1: testSlicingAllSmallTrees

import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
@Test
public void testSlicingAllSmallTrees() throws ExecutionException, InterruptedException
{
    Object[] cur = BTree.empty();
    TreeSet<Integer> canon = new TreeSet<>();
    // we set FAN_FACTOR to 4, so 128 items is four levels deep, three fully populated
    for (int i = 0 ; i < 128 ; i++)
    {
        String id = String.format("[0..%d)", canon.size());
        System.out.println("Testing " + id);
        Futures.allAsList(testAllSlices(id, cur, canon)).get();
        Object[] next = null;
        while (next == null)
            next = BTree.update(cur, ICMP, Arrays.asList(i), true, SPORADIC_ABORT);
        cur = next;
        canon.add(i);
    }
}
 
开发者ID:vcostet,项目名称:cassandra-kmean,代码行数:19,代码来源:LongBTreeTest.java

示例2: PartitionUpdate

import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
private PartitionUpdate(CFMetaData metadata,
                        DecoratedKey key,
                        PartitionColumns columns,
                        MutableDeletionInfo deletionInfo,
                        int initialRowCapacity,
                        boolean canHaveShadowedData)
{
    super(metadata, key);
    this.deletionInfo = deletionInfo;
    this.holder = new Holder(columns, BTree.empty(), deletionInfo, Rows.EMPTY_STATIC_ROW, EncodingStats.NO_STATS);
    this.canHaveShadowedData = canHaveShadowedData;
    rowBuilder = builder(initialRowCapacity);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:14,代码来源:PartitionUpdate.java

示例3: testSlicingAllSmallTrees

import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
@Test
public void testSlicingAllSmallTrees() throws ExecutionException, InterruptedException
{
    Object[] cur = BTree.empty();
    TreeSet<Integer> canon = new TreeSet<>();
    // we set FAN_FACTOR to 4, so 128 items is four levels deep, three fully populated
    for (int i = 0 ; i < 128 ; i++)
    {
        String id = String.format("[0..%d)", canon.size());
        System.out.println("Testing " + id);
        Futures.allAsList(testAllSlices(id, cur, canon)).get();
        cur = BTree.update(cur, ICMP, Arrays.asList(i), true, null, null);
        canon.add(i);
    }
}
 
开发者ID:mafernandez-stratio,项目名称:cassandra-cqlMod,代码行数:16,代码来源:LongBTreeTest.java

示例4: emptyRow

import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
public static BTreeRow emptyRow(Clustering clustering)
{
    return new BTreeRow(clustering, BTree.empty(), Integer.MAX_VALUE);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:5,代码来源:BTreeRow.java

示例5: emptyUpdate

import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
/**
 * Creates a empty immutable partition update.
 *
 * @param metadata the metadata for the created update.
 * @param key the partition key for the created update.
 *
 * @return the newly created empty (and immutable) update.
 */
public static PartitionUpdate emptyUpdate(CFMetaData metadata, DecoratedKey key)
{
    MutableDeletionInfo deletionInfo = MutableDeletionInfo.live();
    Holder holder = new Holder(PartitionColumns.NONE, BTree.empty(), deletionInfo, Rows.EMPTY_STATIC_ROW, EncodingStats.NO_STATS);
    return new PartitionUpdate(metadata, key, holder, deletionInfo, false);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:15,代码来源:PartitionUpdate.java

示例6: fullPartitionDelete

import org.apache.cassandra.utils.btree.BTree; //导入方法依赖的package包/类
/**
 * Creates an immutable partition update that entirely deletes a given partition.
 *
 * @param metadata the metadata for the created update.
 * @param key the partition key for the partition that the created update should delete.
 * @param timestamp the timestamp for the deletion.
 * @param nowInSec the current time in seconds to use as local deletion time for the partition deletion.
 *
 * @return the newly created partition deletion update.
 */
public static PartitionUpdate fullPartitionDelete(CFMetaData metadata, DecoratedKey key, long timestamp, int nowInSec)
{
    MutableDeletionInfo deletionInfo = new MutableDeletionInfo(timestamp, nowInSec);
    Holder holder = new Holder(PartitionColumns.NONE, BTree.empty(), deletionInfo, Rows.EMPTY_STATIC_ROW, EncodingStats.NO_STATS);
    return new PartitionUpdate(metadata, key, holder, deletionInfo, false);
}
 
开发者ID:Netflix,项目名称:sstable-adaptor,代码行数:17,代码来源:PartitionUpdate.java


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